Fix extracting image by URL in chat history when using Nano Banana Pro

Logical error due to else conditional being not correctly indented.
This would result in error in using gemini 3 pro image when images are
in S3 bucket.
This commit is contained in:
Debanjum
2025-11-29 17:08:17 -08:00
parent 856864147b
commit e2340c709f

View File

@@ -391,8 +391,8 @@ def format_messages_for_gemini(
for image_data in chat.images:
if image_data.startswith("http"):
image = get_image_from_url(image_data, type="bytes")
else:
image = get_image_from_base64(image_data, type="bytes")
else:
image = get_image_from_base64(image_data, type="bytes")
parts.append(gtypes.Part.from_bytes(data=image.content, mime_type=image.type))
else:
parts.append(gtypes.Part.from_text(text="This is the message you previously sent:"))