Bläddra i källkod

fix: web/youtube attachements

Timothy Jaeryang Baek 1 månad sedan
förälder
incheckning
487979859a
2 ändrade filer med 7 tillägg och 4 borttagningar
  1. 5 2
      backend/open_webui/retrieval/utils.py
  2. 2 2
      src/lib/components/chat/Chat.svelte

+ 5 - 2
backend/open_webui/retrieval/utils.py

@@ -487,9 +487,12 @@ def get_sources_from_items(
 
 
         if item.get("type") == "text":
         if item.get("type") == "text":
             # Raw 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
                 # if item has file data, use it
                 query_result = {
                 query_result = {
                     "documents": [
                     "documents": [

+ 2 - 2
src/lib/components/chat/Chat.svelte

@@ -671,7 +671,7 @@
 		console.log(url);
 		console.log(url);
 
 
 		const fileItem = {
 		const fileItem = {
-			type: 'doc',
+			type: 'text',
 			name: url,
 			name: url,
 			collection_name: '',
 			collection_name: '',
 			status: 'uploading',
 			status: 'uploading',
@@ -704,7 +704,7 @@
 		console.log(url);
 		console.log(url);
 
 
 		const fileItem = {
 		const fileItem = {
-			type: 'doc',
+			type: 'text',
 			name: url,
 			name: url,
 			collection_name: '',
 			collection_name: '',
 			status: 'uploading',
 			status: 'uploading',