From 224abd14e0e15fc3f41e73ee04d3ea1ebe269f0a Mon Sep 17 00:00:00 2001 From: sabaimran Date: Sat, 30 Nov 2024 14:39:27 -0800 Subject: [PATCH] Only add the image_url to the constructed chat message if it is a url --- src/khoj/processor/conversation/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/khoj/processor/conversation/utils.py b/src/khoj/processor/conversation/utils.py index 86c2d87e..a24ef899 100644 --- a/src/khoj/processor/conversation/utils.py +++ b/src/khoj/processor/conversation/utils.py @@ -344,7 +344,8 @@ def construct_structured_message( constructed_messages.append({"type": "text", "text": attached_file_context}) if vision_enabled and images: for image in images: - constructed_messages.append({"type": "image_url", "image_url": {"url": image}}) + if image.startswith("https://"): + constructed_messages.append({"type": "image_url", "image_url": {"url": image}}) return constructed_messages if not is_none_or_empty(attached_file_context):