mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 03:25:57 +08:00
fix: qwen fc error (#6620)
Co-authored-by: dufei <du_fei@venusgroup.com.cn>
This commit is contained in:
parent
f324374b95
commit
5af2df0cd5
@ -425,7 +425,7 @@ You should also complete the text started with ``` but not tell ``` directly.
|
|||||||
raise ValueError(f"Got unknown type {message}")
|
raise ValueError(f"Got unknown type {message}")
|
||||||
|
|
||||||
return message_text
|
return message_text
|
||||||
|
|
||||||
def _convert_messages_to_prompt(self, messages: list[PromptMessage]) -> str:
|
def _convert_messages_to_prompt(self, messages: list[PromptMessage]) -> str:
|
||||||
"""
|
"""
|
||||||
Format a list of messages into a full prompt for the Anthropic model
|
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({
|
tongyi_messages.append({
|
||||||
'role': 'assistant',
|
'role': 'assistant',
|
||||||
'content': content if not rich_content else [{"text": content}],
|
'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):
|
elif isinstance(prompt_message, ToolPromptMessage):
|
||||||
tongyi_messages.append({
|
tongyi_messages.append({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user