mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Fix openAI tool calls (#118577)
This commit is contained in:
parent
51d8f83a54
commit
80e9ff672a
@ -231,11 +231,13 @@ class OpenAIConversationEntity(
|
|||||||
)
|
)
|
||||||
for tool_call in message.tool_calls
|
for tool_call in message.tool_calls
|
||||||
]
|
]
|
||||||
return ChatCompletionAssistantMessageParam(
|
param = ChatCompletionAssistantMessageParam(
|
||||||
role=message.role,
|
role=message.role,
|
||||||
tool_calls=tool_calls,
|
|
||||||
content=message.content,
|
content=message.content,
|
||||||
)
|
)
|
||||||
|
if tool_calls:
|
||||||
|
param["tool_calls"] = tool_calls
|
||||||
|
return param
|
||||||
|
|
||||||
messages.append(message_convert(response))
|
messages.append(message_convert(response))
|
||||||
tool_calls = response.tool_calls
|
tool_calls = response.tool_calls
|
||||||
|
Loading…
x
Reference in New Issue
Block a user