From f60df039979b8642aa82fec9e6ce56acb3a80f50 Mon Sep 17 00:00:00 2001 From: sigoden Date: Wed, 26 Jun 2024 23:04:06 +0800 Subject: [PATCH] refactor: enable function_calling by default (#656) --- config.example.yaml | 2 +- src/function.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.example.yaml b/config.example.yaml index 52b311c..262f41b 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -27,7 +27,7 @@ summary_prompt: 'This is a summary of the chat history as a recap: ' # ---- function-calling & agent ---- # Controls the function calling feature. For setup instructions, visit https://github.com/sigoden/llm-functions -function_calling: false +function_calling: true # Regex for seletecting dangerous functions # User confirmation is required when executing these functions # e.g. 'execute_command|execute_js_code' 'execute_.*' diff --git a/src/function.rs b/src/function.rs index b91722c..8528af5 100644 --- a/src/function.rs +++ b/src/function.rs @@ -72,10 +72,10 @@ impl Functions { vec![] }; - let func_names = declarations.iter().map(|v| v.name.clone()).collect(); + let names = declarations.iter().map(|v| v.name.clone()).collect(); Ok(Self { - names: func_names, + names, declarations, }) }