Skip to content

Commit

Permalink
fix: 'validation error for ToolInvokeMessage' when blob_message meta …
Browse files Browse the repository at this point in the history
…is None (#11212)
  • Loading branch information
catusax authored Nov 29, 2024
1 parent 0554898 commit d96a284
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/core/tools/tool/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,12 @@ def create_blob_message(self, blob: bytes, meta: Optional[dict] = None, save_as:
:param blob: the blob
:return: the blob message
"""
return ToolInvokeMessage(type=ToolInvokeMessage.MessageType.BLOB, message=blob, meta=meta, save_as=save_as)
return ToolInvokeMessage(
type=ToolInvokeMessage.MessageType.BLOB,
message=blob,
meta=meta or {},
save_as=save_as,
)

def create_json_message(self, object: dict) -> ToolInvokeMessage:
"""
Expand Down

0 comments on commit d96a284

Please sign in to comment.