From 0ec370b48c951a69459f9232b56df882765ccb52 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 22 Jun 2024 14:07:58 +0800 Subject: refactor: improve clients (#632) --- src/client/cohere.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/client/cohere.rs') 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, ] }) -- cgit v1.2.3