Fixed a bug for "detail" attribute in input image (#685)

When an input image is given as input, the code tries to access the
'detail' key, that may not be present as noted in #159.

With this pull request, now it tries to access the key, otherwise set
the value to `None`.
@pakrym-oai  or @rm-openai let me know if you want any changes.
This commit is contained in:
Daniele Morotti 2025-05-14 17:31:42 +02:00 committed by GitHub
parent f9763495b8
commit 2c46dae377
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -234,7 +234,7 @@ class Converter:
type="image_url",
image_url={
"url": casted_image_param["image_url"],
"detail": casted_image_param["detail"],
"detail": casted_image_param.get("detail", "auto"),
},
)
)