Python: fix: exclude null file_id from input_image payload to prevent 400 sch… (#5125)

* fix: exclude null file_id from input_image payload to prevent 400 schema error (#5120)

* test: add case for additional_properties present without file_id key

---------

Co-authored-by: Sergey Borisov <sergey.borisov@dataimpact.io>
This commit is contained in:
S3rj
2026-04-22 00:29:00 +02:00
committed by GitHub
Unverified
parent f2b215a2f6
commit bca40a7e90
2 changed files with 12 additions and 1 deletions
@@ -1405,7 +1405,7 @@ class RawOpenAIChatClient( # type: ignore[misc]
else "auto",
}
file_id = content.additional_properties.get("file_id") if content.additional_properties else None
if file_id:
if file_id is not None:
result["file_id"] = file_id
return result
if content.has_top_level_media_type("audio"):