diff --git a/semantic_router/llms/openai.py b/semantic_router/llms/openai.py index b830674017af7a5b50b591e8b483ff628b4679ef..7a887b8eaf80d345d270506463b32b992c11c886 100644 --- a/semantic_router/llms/openai.py +++ b/semantic_router/llms/openai.py @@ -2,6 +2,7 @@ import os from typing import List, Optional, Any import openai +from openai._types import NotGiven from semantic_router.llms import BaseLLM from semantic_router.schema import Message @@ -64,14 +65,14 @@ class OpenAILLM(BaseLLM): if function_schemas: tools = function_schemas else: - tools = None + tools = NotGiven completion = self.client.chat.completions.create( model=self.name, messages=[m.to_openai() for m in messages], temperature=self.temperature, max_tokens=self.max_tokens, - tools=tools, # type: ignore # MyPy expecting Iterable[ChatCompletionToolParam] | NotGiven, but dict is accepted by OpenAI. + tools=tools, ) if function_schemas: