fix: OpenAI Provider json, jsonl file load error

This commit is contained in:
Shu Yao 2026-01-12 18:16:57 +08:00
parent 7bb72f56e6
commit 4648ea662c

View File

@ -544,7 +544,13 @@ class OpenAIProvider(ModelProvider):
mime = (attachment.mime_type or "").lower()
name = (attachment.name or "").lower()
if not mime.startswith("text/"):
is_json = mime in {
"application/json",
"application/jsonl",
"application/x-ndjson",
"application/ndjson",
} or name.endswith((".json", ".jsonl", ".ndjson"))
if not (mime.startswith("text/") or is_json):
return None
if attachment.remote_file_id:
return None # nothing to inline if already remote-only