fix: tongyi empty tool_calls is not supported in message (#6719)

pull/6723/head
Joe 2 years ago committed by GitHub
parent 3d3677e912
commit e4542215cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -501,8 +501,7 @@ You should also complete the text started with ``` but not tell ``` directly.
'role': 'assistant',
'content': content if not rich_content else [{"text": content}],
'tool_calls': [tool_call.model_dump() for tool_call in
prompt_message.tool_calls] if prompt_message.tool_calls else []
prompt_message.tool_calls] if prompt_message.tool_calls else None
})
elif isinstance(prompt_message, ToolPromptMessage):
tongyi_messages.append({

Loading…
Cancel
Save