Update api/core/datasource/utils/message_transformer.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Jyong 2025-09-17 17:51:53 +08:00 committed by GitHub
parent 69a402ba99
commit caf4b16b8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ class DatasourceFileMessageTransformer:
mimetype = meta.get("mime_type")
if not mimetype:
mimetype = guess_type(filename)[0] or "application/octet-stream" # pyright: ignore[reportArgumentType]
mimetype = (guess_type(filename)[0] if filename else None) or "application/octet-stream"
# if message is str, encode it to bytes