From 61ffd20c1e5c3553909dbd0782bb10cd42f5f0a6 Mon Sep 17 00:00:00 2001 From: jekalmin Date: Sun, 24 Dec 2023 22:48:26 +0900 Subject: [PATCH] [#57] make functions optional --- custom_components/extended_openai_conversation/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/extended_openai_conversation/__init__.py b/custom_components/extended_openai_conversation/__init__.py index f3acefe..68c4d39 100644 --- a/custom_components/extended_openai_conversation/__init__.py +++ b/custom_components/extended_openai_conversation/__init__.py @@ -284,6 +284,9 @@ async def query( DEFAULT_MAX_FUNCTION_CALLS_PER_CONVERSATION, ): function_call = "none" + if len(functions) == 0: + functions = None + function_call = None model_key = self.entry.options.get( CONF_MODEL_KEY, get_default_model_key(api_base)