瀏覽代碼

fix: ensure original response are maintained by yielding text messages in ApiTool (#23456) (#25973)

tags/1.9.0
Yeuoly 1 月之前
父節點
當前提交
4047a6bb12
No account linked to committer's email address
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      api/core/tools/custom_tool/tool.py

+ 4
- 0
api/core/tools/custom_tool/tool.py 查看文件

@@ -396,6 +396,10 @@ class ApiTool(Tool):
# assemble invoke message based on response type
if parsed_response.is_json and isinstance(parsed_response.content, dict):
yield self.create_json_message(parsed_response.content)

# FIXES: https://github.com/langgenius/dify/pull/23456#issuecomment-3182413088
# We need never break the original flows
yield self.create_text_message(response.text)
else:
# Convert to string if needed and create text message
text_response = (

Loading…
取消
儲存