chore: add create_json_message api for tools (#5440)
This commit is contained in:
parent
ba67206bb9
commit
1e28a8c033
7 changed files with 48 additions and 160 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import json
|
||||
from copy import deepcopy
|
||||
from datetime import datetime, timezone
|
||||
from mimetypes import guess_type
|
||||
|
|
@ -188,6 +189,8 @@ class ToolEngine:
|
|||
elif response.type == ToolInvokeMessage.MessageType.IMAGE_LINK or \
|
||||
response.type == ToolInvokeMessage.MessageType.IMAGE:
|
||||
result += "image has been created and sent to user already, you do not need to create it, just tell the user to check it now."
|
||||
elif response.type == ToolInvokeMessage.MessageType.JSON:
|
||||
result += f"tool response: {json.dumps(response.message, ensure_ascii=False)}."
|
||||
else:
|
||||
result += f"tool response: {response.message}."
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue