Skip to content

Commit a4e135b

Browse files
committed
fix: use .get() on image URL in ImagePromptValue.to_string()
1 parent 71651c4 commit a4e135b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/core/langchain_core/prompt_values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class ImagePromptValue(PromptValue):
123123

124124
def to_string(self) -> str:
125125
"""Return prompt (image URL) as string."""
126-
return self.image_url["url"]
126+
return self.image_url.get("url", "")
127127

128128
def to_messages(self) -> list[BaseMessage]:
129129
"""Return prompt (image URL) as messages."""

0 commit comments

Comments
 (0)