From 487979859a6ffcfd60468f523822cdf838fbef5b Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 1 Sep 2025 01:22:50 +0400 Subject: [PATCH] fix: web/youtube attachements --- backend/open_webui/retrieval/utils.py | 7 +++++-- src/lib/components/chat/Chat.svelte | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/open_webui/retrieval/utils.py b/backend/open_webui/retrieval/utils.py index 8d4efd3f72..4ef6dbce3b 100644 --- a/backend/open_webui/retrieval/utils.py +++ b/backend/open_webui/retrieval/utils.py @@ -487,9 +487,12 @@ def get_sources_from_items( if item.get("type") == "text": # Raw Text - # Used during temporary chat file uploads + # Used during temporary chat file uploads or web page & youtube attachements - if item.get("file"): + if item.get("collection_name"): + # If item has a collection name, use it + collection_names.append(item.get("collection_name")) + elif item.get("file"): # if item has file data, use it query_result = { "documents": [ diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 284ddd7ad1..8ad7da577e 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -671,7 +671,7 @@ console.log(url); const fileItem = { - type: 'doc', + type: 'text', name: url, collection_name: '', status: 'uploading', @@ -704,7 +704,7 @@ console.log(url); const fileItem = { - type: 'doc', + type: 'text', name: url, collection_name: '', status: 'uploading',