summaryrefslogtreecommitdiffstats
path: root/src/client/openai.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-08-24 12:44:11 +0800
committerGitHub <noreply@github.com>2024-08-24 12:44:11 +0800
commit34ef752359062499d9f49c0a0155c8a11fd6f24b (patch)
tree566b6614aaa7596c5760271029aa42d83d4bb9dc /src/client/openai.rs
parent8e4b9a383d07a92f53a00ba6bdb304895ee32c41 (diff)
downloadaichat-34ef752359062499d9f49c0a0155c8a11fd6f24b.tar.gz
feat: support ai21 client (#800)
Diffstat (limited to 'src/client/openai.rs')
-rw-r--r--src/client/openai.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/client/openai.rs b/src/client/openai.rs
index 3e1707f..ed577bc 100644
--- a/src/client/openai.rs
+++ b/src/client/openai.rs
@@ -206,6 +206,7 @@ pub fn openai_build_chat_completions_body(data: ChatCompletionsData, model: &Mod
},
})
}).collect();
+ let text = if text.is_empty() { Value::Null } else { text.into() };
let mut messages = vec![
json!({ "role": MessageRole::Assistant, "content": text, "tool_calls": tool_calls })
];