diff options
| author | sigoden <sigoden@gmail.com> | 2024-12-10 12:38:42 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-10 12:38:42 +0800 |
| commit | 2e7ff29e967dba987d9f238f73dcd87a569d2035 (patch) | |
| tree | c668e172d4c58598e136bd3e723e2ec3c8eb331e /src/client/cohere.rs | |
| parent | 6dbc32836a46d16ceace198883a28e5d311b94a5 (diff) | |
| download | aichat-2e7ff29e967dba987d9f238f73dcd87a569d2035.tar.gz | |
refactor: body data for cohere v2 chat api (#1048)
Diffstat (limited to 'src/client/cohere.rs')
| -rw-r--r-- | src/client/cohere.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/cohere.rs b/src/client/cohere.rs index 457ea66..5f61454 100644 --- a/src/client/cohere.rs +++ b/src/client/cohere.rs @@ -49,7 +49,12 @@ fn prepare_chat_completions( .unwrap_or_else(|_| API_BASE.to_string()); let url = format!("{}/chat", api_base.trim_end_matches('/')); - let body = openai_build_chat_completions_body(data, &self_.model); + let mut body = openai_build_chat_completions_body(data, &self_.model); + if let Some(obj) = body.as_object_mut() { + if let Some(top_p) = obj.remove("top_p") { + obj.insert("p".to_string(), top_p); + } + } let mut request_data = RequestData::new(url, body); |
