瀏覽代碼

fix: qwen fc error (#6620)

Co-authored-by: dufei <du_fei@venusgroup.com.cn>
tags/0.6.16
dufei 1 年之前
父節點
當前提交
5af2df0cd5
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. 4
    1
      api/core/model_runtime/model_providers/tongyi/llm/llm.py

+ 4
- 1
api/core/model_runtime/model_providers/tongyi/llm/llm.py 查看文件

@@ -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({

Loading…
取消
儲存