Fix openAI tool calls (#118577)

pull/118845/head
Paulus Schoutsen 2024-05-31 13:28:52 -04:00
parent b459559c8b
commit c01c155037
1 changed files with 4 additions and 2 deletions

View File

@ -247,11 +247,13 @@ class OpenAIConversationEntity(
)
for tool_call in message.tool_calls
]
return ChatCompletionAssistantMessageParam(
param = ChatCompletionAssistantMessageParam(
role=message.role,
tool_calls=tool_calls,
content=message.content,
)
if tool_calls:
param["tool_calls"] = tool_calls
return param
messages.append(message_convert(response))
tool_calls = response.tool_calls