1010from typing_extensions import Any
1111
1212from openai .pagination import SyncCursorPage
13- from openai .types .chat .chat_completion_function_tool_param import ChatCompletionFunctionToolParam
13+ from openai .types .chat .chat_completion_tool_param import ChatCompletionToolParam
1414from openai .types .chat .chat_completion_message import FunctionCall
1515from openai .types .responses import Response
1616from openai .types .responses .response_item import ResponseItem
17- from openai .types .chat .chat_completion_message_function_tool_call import (
18- ChatCompletionMessageFunctionToolCall ,
17+ from openai .types .chat .chat_completion_message_tool_call import (
18+ ChatCompletionMessageToolCall ,
1919 Function ,
2020)
2121from openai .types .responses .tool import Tool
@@ -116,9 +116,9 @@ def _create_evaluation_row(self, input_items: SyncCursorPage[ResponseItem], resp
116116
117117 def _responses_tools_to_chat_completion_tools (
118118 self , tools : List [Tool ]
119- ) -> Sequence [ChatCompletionFunctionToolParam ]:
119+ ) -> Sequence [ChatCompletionToolParam ]:
120120 """Convert OpenAI Responses API tools to chat completion message function tool calls."""
121- chat_completion_tools : List [ChatCompletionFunctionToolParam ] = []
121+ chat_completion_tools : List [ChatCompletionToolParam ] = []
122122 for tool in tools :
123123 if tool .type == "function" :
124124 chat_completion_tools .append (
@@ -146,7 +146,7 @@ def _create_messages(self, input_items: SyncCursorPage[ResponseItem]) -> Iterabl
146146 be added before the assistant message with tool calls.
147147 """
148148 messages : list [Message ] = []
149- current_tool_calls : list [ChatCompletionMessageFunctionToolCall ] = []
149+ current_tool_calls : list [ChatCompletionMessageToolCall ] = []
150150 tool_call_outputs : list [Message ] = []
151151
152152 for item in input_items :
@@ -173,7 +173,7 @@ def _create_messages(self, input_items: SyncCursorPage[ResponseItem]) -> Iterabl
173173 # Collect tool call outputs to add before assistant message
174174 tool_call_outputs .append (Message (role = "tool" , content = item .output , tool_call_id = item .call_id ))
175175 elif item .type == "function_call" :
176- tool_call = ChatCompletionMessageFunctionToolCall (
176+ tool_call = ChatCompletionMessageToolCall (
177177 id = item .call_id , type = "function" , function = Function (name = item .name , arguments = item .arguments )
178178 )
179179 current_tool_calls .append (tool_call )
0 commit comments