mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 19:36:53 +08:00
refactor(tool-engine): Optimize tool engine response handling (#14216)
Co-authored-by: xudong2.zhang <xudong2.zhang@zkh.com> Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
@@ -246,10 +246,11 @@ class ToolEngine:
|
|||||||
+ "you do not need to create it, just tell the user to check it now."
|
+ "you do not need to create it, just tell the user to check it now."
|
||||||
)
|
)
|
||||||
elif response.type == ToolInvokeMessage.MessageType.JSON:
|
elif response.type == ToolInvokeMessage.MessageType.JSON:
|
||||||
text = json.dumps(cast(ToolInvokeMessage.JsonMessage, response.message).json_object, ensure_ascii=False)
|
result = json.dumps(
|
||||||
result += f"tool response: {text}."
|
cast(ToolInvokeMessage.JsonMessage, response.message).json_object, ensure_ascii=False
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
result += f"tool response: {response.message!r}."
|
result += str(response.message)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user