Url encode add model check url
This commit is contained in:
parent
d670072a69
commit
9a5e7ddb89
|
@ -333,7 +333,7 @@ void addModel(BuildContext context, Function setState) async {
|
||||||
placeholder: "llama3:latest",
|
placeholder: "llama3:latest",
|
||||||
enableSuggestions: false,
|
enableSuggestions: false,
|
||||||
validator: (content) async {
|
validator: (content) async {
|
||||||
var model = content;
|
var model = content.trim();
|
||||||
model = model.removeSuffix(":latest");
|
model = model.removeSuffix(":latest");
|
||||||
if (model == "") return false;
|
if (model == "") return false;
|
||||||
canceled = false;
|
canceled = false;
|
||||||
|
@ -395,8 +395,9 @@ void addModel(BuildContext context, Function setState) async {
|
||||||
}
|
}
|
||||||
http.Response response;
|
http.Response response;
|
||||||
try {
|
try {
|
||||||
response = await http.get(Uri.parse("$endpoint$model")).timeout(
|
response = await http
|
||||||
Duration(
|
.get(Uri.parse("$endpoint${Uri.encodeComponent(model)}"))
|
||||||
|
.timeout(Duration(
|
||||||
seconds: (10.0 * (prefs!.getDouble("timeoutMultiplier") ?? 1.0))
|
seconds: (10.0 * (prefs!.getDouble("timeoutMultiplier") ?? 1.0))
|
||||||
.round()));
|
.round()));
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
|
|
Loading…
Reference in New Issue