mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-04-23 06:09:43 +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:
parent
aa6c951e8c
commit
ce545274a6
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user