summaryrefslogtreecommitdiffstats
path: root/src/client/claude.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-04-24 16:12:38 +0800
committerGitHub <noreply@github.com>2024-04-24 16:12:38 +0800
commita17f349daa0609402c51205929b9f2b32f6fb1bb (patch)
tree380dd9c158f8d9278355634a8d474df3a90f8d25 /src/client/claude.rs
parent040c48b9b392e3329d3f1de8eeb1b8773129773c (diff)
downloadaichat-a17f349daa0609402c51205929b9f2b32f6fb1bb.tar.gz
feat: support customizing `top_p` parameter (#434)
Diffstat (limited to 'src/client/claude.rs')
-rw-r--r--src/client/claude.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/claude.rs b/src/client/claude.rs
index 283ae99..054731c 100644
--- a/src/client/claude.rs
+++ b/src/client/claude.rs
@@ -140,6 +140,7 @@ fn build_body(data: SendData, model: &Model) -> Result<Value> {
let SendData {
mut messages,
temperature,
+ top_p,
stream,
} = data;
@@ -205,6 +206,9 @@ fn build_body(data: SendData, model: &Model) -> Result<Value> {
if let Some(v) = temperature {
body["temperature"] = v.into();
}
+ if let Some(v) = top_p {
+ body["top_p"] = v.into();
+ }
if stream {
body["stream"] = true.into();
}