mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
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:
@@ -391,8 +391,8 @@ def format_messages_for_gemini(
|
|||||||
for image_data in chat.images:
|
for image_data in chat.images:
|
||||||
if image_data.startswith("http"):
|
if image_data.startswith("http"):
|
||||||
image = get_image_from_url(image_data, type="bytes")
|
image = get_image_from_url(image_data, type="bytes")
|
||||||
else:
|
else:
|
||||||
image = get_image_from_base64(image_data, type="bytes")
|
image = get_image_from_base64(image_data, type="bytes")
|
||||||
parts.append(gtypes.Part.from_bytes(data=image.content, mime_type=image.type))
|
parts.append(gtypes.Part.from_bytes(data=image.content, mime_type=image.type))
|
||||||
else:
|
else:
|
||||||
parts.append(gtypes.Part.from_text(text="This is the message you previously sent:"))
|
parts.append(gtypes.Part.from_text(text="This is the message you previously sent:"))
|
||||||
|
|||||||
Reference in New Issue
Block a user