diff options
| author | sigoden <sigoden@gmail.com> | 2024-06-22 14:07:58 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-22 14:07:58 +0800 |
| commit | 0ec370b48c951a69459f9232b56df882765ccb52 (patch) | |
| tree | c12bab3bd72acc97adcd835b8d5aea82d1b96cd3 /src/client/cohere.rs | |
| parent | 250e0eb7fee0d180b08b7d38d10c530e9a6a120d (diff) | |
| download | aichat-0ec370b48c951a69459f9232b56df882765ccb52.tar.gz | |
refactor: improve clients (#632)
Diffstat (limited to 'src/client/cohere.rs')
| -rw-r--r-- | src/client/cohere.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/cohere.rs b/src/client/cohere.rs index 698c2a6..3e1cb2b 100644 --- a/src/client/cohere.rs +++ b/src/client/cohere.rs @@ -220,8 +220,8 @@ fn build_chat_completions_body(data: ChatCompletionsData, model: &Model) -> Resu .collect(); Some(json!({ "role": role, "message": list.join("\n\n") })) } - MessageContent::ToolResults((tool_call_results, _)) => { - tool_results = Some(tool_call_results); + MessageContent::ToolResults((results, _)) => { + tool_results = Some(results); None } } @@ -263,14 +263,14 @@ fn build_chat_completions_body(data: ChatCompletionsData, model: &Model) -> Resu if let Some(tool_results) = tool_results { let tool_results: Vec<_> = tool_results .into_iter() - .map(|tool_call_result| { + .map(|tool_result| { json!({ "call": { - "name": tool_call_result.call.name, - "parameters": tool_call_result.call.arguments, + "name": tool_result.call.name, + "parameters": tool_result.call.arguments, }, "outputs": [ - tool_call_result.output, + tool_result.output, ] }) |
