From b4a40e3fedb438570770a224b890ea24f6e660a9 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 18 May 2024 19:06:21 +0800 Subject: feat: support function calling (#514) * feat: support function calling * fix on Windows OS * implement multi-steps function calling * fix on Windows OS * add error for client not support function calling * refactor message data structure and make claude client supporting function calling * support reuse previous call results * improve error handling for function calling * use prefix `may_` as indicator for `execute` type fucntions --- src/client/prompt_format.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/client/prompt_format.rs') diff --git a/src/client/prompt_format.rs b/src/client/prompt_format.rs index 8a90924..320f105 100644 --- a/src/client/prompt_format.rs +++ b/src/client/prompt_format.rs @@ -108,6 +108,7 @@ pub fn generate_prompt(messages: &[Message], format: PromptFormat) -> anyhow::Re } parts.join("\n\n") } + MessageContent::ToolResults(_) => String::new(), }; match role { MessageRole::System => prompt.push_str(&format!( -- cgit v1.2.3