Fix openAI tool calls (#118577)

This commit is contained in:
Paulus Schoutsen 2024-05-31 13:28:52 -04:00 committed by GitHub
parent 51d8f83a54
commit 80e9ff672a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -231,11 +231,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