summaryrefslogtreecommitdiffstats
path: root/src/client/ollama.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-25 10:15:54 +0800
committerGitHub <noreply@github.com>2024-04-25 10:15:54 +0800
commit4db9b309803796bc5f996d0b3713344eb44207ec (patch)
treea0ba8f3a2da32e5392e22272c641e3939de49be6 /src/client/ollama.rs
parent8dacea4deb0fe67c0cdbe15bd47e6e50c1dd12a1 (diff)
downloadaichat-4db9b309803796bc5f996d0b3713344eb44207ec.tar.gz
refactor: rewrite list models of all clients (#436)
Diffstat (limited to 'src/client/ollama.rs')
-rw-r--r--src/client/ollama.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/client/ollama.rs b/src/client/ollama.rs
index 434e487..1394ced 100644
--- a/src/client/ollama.rs
+++ b/src/client/ollama.rs
@@ -179,15 +179,14 @@ fn build_body(data: SendData, model: &Model) -> Result<Value> {
"options": {},
});
- if let Some(num_predict) = model.max_output_tokens {
- body["options"]["num_predict"] = num_predict.into();
+ if let Some(v) = model.max_output_tokens {
+ body["options"]["num_predict"] = v.into();
}
-
- if let Some(temperature) = temperature {
- body["options"]["temperature"] = temperature.into();
+ if let Some(v) = temperature {
+ body["options"]["temperature"] = v.into();
}
- if let Some(top_p) = top_p {
- body["options"]["top_p"] = top_p.into();
+ if let Some(v) = top_p {
+ body["options"]["top_p"] = v.into();
}
Ok(body)