Skip to content

Commit

Permalink
core[patch]: update image util err msg (#27803)
Browse files Browse the repository at this point in the history
  • Loading branch information
baskaryan authored Oct 31, 2024
1 parent 181bcd0 commit e4e2aa0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/core/langchain_core/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

def __getattr__(name: str) -> Any:
if name in ("encode_image", "image_to_data_url"):
msg = f"'{name}' has been removed for security reasons."
msg = (
f"'{name}' has been removed for security reasons.\n\n"
f"Usage of this utility in environments with user-input paths is a "
f"security vulnerability. Out of an abundance of caution, the utility "
f"has been removed to prevent possible misuse."
)
raise ValueError(msg)
raise AttributeError(name)

0 comments on commit e4e2aa0

Please sign in to comment.