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):
|
for message, stored_message in zip(messages, stored_messages):
|
||||||
files_with_urls = [
|
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:
|
if not files_with_urls:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user