fix is_function_tool_call

This commit is contained in:
Ashwin Bharambe 2025-06-02 14:36:37 -07:00
parent fd15a6832c
commit 021976713b

View file

@ -261,15 +261,14 @@ class OpenAIResponsesImpl:
def _is_function_tool_call( def _is_function_tool_call(
self, self,
tool_call: OpenAIChatCompletionToolCall, tool_call: OpenAIChatCompletionToolCall,
tools: list[OpenAIResponseInputTool] | None, tools: list[OpenAIResponseInputTool],
) -> bool: ) -> bool:
"""Check if a tool call is a function tool call (client-side) vs non-function (server-side).""" if not tool_call.function:
if not tools:
return False return False
for t in tools:
# If the first tool is a function, assume all tools are functions if t.type == "function" and t.name == tool_call.function.name:
# This matches the logic in _process_response_choices return True
return tools[0].type == "function" return False
async def _process_response_choices( async def _process_response_choices(
self, self,