Timothy Jaeryang Baek 5 kuukautta sitten
vanhempi
commit
12c8257c92

+ 2 - 5
backend/open_webui/apps/retrieval/main.py

@@ -893,10 +893,7 @@ def process_file(
             # Update the content in the file
             # Usage: /files/{file_id}/data/content/update
 
-            VECTOR_DB_CLIENT.delete(
-                collection_name=f"file-{file.id}",
-                filter={"file_id": file.id},
-            )
+            VECTOR_DB_CLIENT.delete(collection_name=f"file-{file.id}")
 
             docs = [
                 Document(
@@ -1001,7 +998,7 @@ def process_file(
                 collection_name=collection_name,
                 metadata={
                     "file_id": file.id,
-                    "name": file.meta.get("name", file.filename),
+                    "name": file.filename,
                     "hash": hash,
                 },
                 add=(True if form_data.collection_name else False),

+ 6 - 1
src/lib/components/common/RichTextInput.svelte

@@ -36,6 +36,10 @@
 	let element;
 	let editor;
 
+	const options = {
+		throwOnError: false
+	};
+
 	// Function to find the next template in the document
 	function findNextTemplate(doc, from = 0) {
 		const patterns = [
@@ -113,6 +117,7 @@
 	};
 
 	onMount(() => {
+		const content = marked.parse(value);
 		editor = new Editor({
 			element: element,
 			extensions: [
@@ -124,7 +129,7 @@
 				Typography,
 				Placeholder.configure({ placeholder })
 			],
-			content: marked.parse(value),
+			content: content,
 			autofocus: true,
 			onTransaction: () => {
 				// force re-render so `editor.isActive` works as expected