From 79bf5a4b0cbc26ea38b46bd98c759a18b6732002 Mon Sep 17 00:00:00 2001 From: LuoChen Date: Thu, 10 Oct 2024 16:41:11 +0800 Subject: [PATCH] fix: tool_choice issue --- src/ai_powered/chat_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ai_powered/chat_bot.py b/src/ai_powered/chat_bot.py index 2bc6319..5fb92e3 100644 --- a/src/ai_powered/chat_bot.py +++ b/src/ai_powered/chat_bot.py @@ -38,7 +38,7 @@ async def chat_continue(self) -> str: model = model_config.model_name, messages = [*self._system_prompts, *self.conversation], tools = self._tool_schemas, - tool_choice = "auto" if len(self.tools) > 0 else "none", + tool_choice = "auto" if len(self.tools) > 0 else openai.NOT_GIVEN, ) assistant_message = response.choices[0].message