fix: fix mime type is none (#29579)

This commit is contained in:
wangxiaolei
2025-12-15 10:09:11 +08:00
committed by GitHub
parent 61199663e7
commit 916df2d0f7
2 changed files with 88 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ class ToolFileMessageTransformer:
meta = message.meta or {}
mimetype = meta.get("mime_type", "application/octet-stream")
if not mimetype:
mimetype = "application/octet-stream"
# get filename from meta
filename = meta.get("filename", None)
# if message is str, encode it to bytes