mirror of
https://github.com/langgenius/dify.git
synced 2026-04-30 23:48:04 +08:00
chore: change the mcp tool return
This commit is contained in:
@ -54,7 +54,6 @@ class MCPTool(Tool):
|
||||
|
||||
for content in result.content:
|
||||
if isinstance(content, TextContent):
|
||||
yield self.create_text_message(content.text)
|
||||
try:
|
||||
content_json = json.loads(content.text)
|
||||
if isinstance(content_json, dict):
|
||||
@ -63,9 +62,9 @@ class MCPTool(Tool):
|
||||
for item in content_json:
|
||||
yield self.create_json_message(item)
|
||||
else:
|
||||
pass
|
||||
yield self.create_text_message(content.text)
|
||||
except json.JSONDecodeError:
|
||||
pass
|
||||
yield self.create_text_message(content.text)
|
||||
|
||||
elif isinstance(content, ImageContent):
|
||||
yield self.create_blob_message(
|
||||
|
||||
Reference in New Issue
Block a user