mirror of
https://github.com/open-webui/open-webui.git
synced 2026-02-24 04:00:31 +01:00
fix: don't pollute model text context with encoded images (#20916)
This commit is contained in:
@@ -1455,7 +1455,9 @@ def add_file_context(messages: list, chat_id: str, user) -> list:
|
||||
|
||||
for message, stored_message in zip(messages, stored_messages):
|
||||
files_with_urls = [
|
||||
file for file in stored_message.get("files", []) if file.get("url")
|
||||
file
|
||||
for file in stored_message.get("files", [])
|
||||
if file.get("url") and not file.get("url").startswith("data:")
|
||||
]
|
||||
if not files_with_urls:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user