From 3ed764a7699f8d290687f23d7ff30c7cc8f932d9 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Fri, 21 Mar 2025 12:56:05 -0300 Subject: [PATCH] Only checking the length if tools is a list. --- src/pipecat/processors/aggregators/openai_llm_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipecat/processors/aggregators/openai_llm_context.py b/src/pipecat/processors/aggregators/openai_llm_context.py index 2e5ade0a0..948e3e101 100644 --- a/src/pipecat/processors/aggregators/openai_llm_context.py +++ b/src/pipecat/processors/aggregators/openai_llm_context.py @@ -157,7 +157,7 @@ class OpenAILLMContext: self._tool_choice = tool_choice def set_tools(self, tools: List[ChatCompletionToolParam] | NotGiven | ToolsSchema = NOT_GIVEN): - if tools != NOT_GIVEN and len(tools) == 0: + if tools != NOT_GIVEN and isinstance(tools, list) and len(tools) == 0: tools = NOT_GIVEN self._tools = tools