Merge pull request #11515 from davizucon/main

fix: url value when response contains url tag
This commit is contained in:
Timothy Jaeryang Baek 2025-03-11 18:37:05 +00:00 committed by GitHub
commit 6399aaf4b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -517,10 +517,8 @@ async def image_generations(
images = []
for image in res["data"]:
if "url" in image:
image_data, content_type = load_url_image_data(
image["url"], headers
)
if image_url := image.get("url", None):
image_data, content_type = load_url_image_data(image_url, headers)
else:
image_data, content_type = load_b64_image_data(image["b64_json"])