Merge pull request #1429 from pipecat-ai/fixing_set_tool_issue

Only checking the length if tools is a list.
This commit is contained in:
Filipi da Silva Fuchter
2025-03-21 13:56:45 -03:00
committed by GitHub

View File

@@ -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