fix: qwen fc error (#6620)

Co-authored-by: dufei <du_fei@venusgroup.com.cn>
This commit is contained in:
dufei 2024-07-24 16:56:06 +08:00 committed by GitHub
parent f324374b95
commit 5af2df0cd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -425,7 +425,7 @@ You should also complete the text started with ``` but not tell ``` directly.
raise ValueError(f"Got unknown type {message}")
return message_text
def _convert_messages_to_prompt(self, messages: list[PromptMessage]) -> str:
"""
Format a list of messages into a full prompt for the Anthropic model
@ -500,6 +500,9 @@ You should also complete the text started with ``` but not tell ``` directly.
tongyi_messages.append({
'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 []
})
elif isinstance(prompt_message, ToolPromptMessage):
tongyi_messages.append({