mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 23:41:46 +00:00
fix: use .get()
on image URL in ImagePromptValue.to_string()
This commit is contained in:
@@ -123,7 +123,7 @@ class ImagePromptValue(PromptValue):
|
||||
|
||||
def to_string(self) -> str:
|
||||
"""Return prompt (image URL) as string."""
|
||||
return self.image_url["url"]
|
||||
return self.image_url.get("url", "")
|
||||
|
||||
def to_messages(self) -> list[BaseMessage]:
|
||||
"""Return prompt (image URL) as messages."""
|
||||
|
Reference in New Issue
Block a user