Skip to content

The agent engineering platform.

community: Fixes use of ImagePromptTemplate with Ollama (#24140)

Atul R457677c1b732
diff --git a/libs/community/langchain_community/chat_models/ollama.py b/libs/community/langchain_community/chat_models/ollama.py
index ca936a1c51..298bfca97f 100644
--- a/libs/community/langchain_community/chat_models/ollama.py
+++ b/libs/community/langchain_community/chat_models/ollama.py
@@ -144,7 +144,7 @@ class ChatOllama(BaseChatModel, _OllamaCommon):
elif (
isinstance(temp_image_url, dict) and "url" in temp_image_url
):
- image_url = temp_image_url
+ image_url = temp_image_url["url"]
else:
raise ValueError(
"Only string image_url or dict with string 'url' "