diff --git a/backend/open_webui/apps/retrieval/main.py b/backend/open_webui/apps/retrieval/main.py index 613271596..d901cf719 100644 --- a/backend/open_webui/apps/retrieval/main.py +++ b/backend/open_webui/apps/retrieval/main.py @@ -649,7 +649,7 @@ def save_docs_to_vector_db( ) if existing_docs: log.info(f"Document with hash {metadata['hash']} already exists") - return True + raise ValueError(ERROR_MESSAGES.DUPLICATE_CONTENT) if split: text_splitter = RecursiveCharacterTextSplitter( diff --git a/backend/open_webui/constants.py b/backend/open_webui/constants.py index df6f9b37b..e8c456b9e 100644 --- a/backend/open_webui/constants.py +++ b/backend/open_webui/constants.py @@ -94,6 +94,8 @@ class ERROR_MESSAGES(str, Enum): lambda size="": f"Oops! The file you're trying to upload is too large. Please upload a file that is less than {size}." ) + DUPLICATE_CONTENT = "The content provided is a duplicate. Please ensure that the content is unique before proceeding." + class TASKS(str, Enum): def __str__(self) -> str: diff --git a/src/lib/components/workspace/Knowledge/Collection/Files.svelte b/src/lib/components/workspace/Knowledge/Collection/Files.svelte new file mode 100644 index 000000000..01a5ce720 --- /dev/null +++ b/src/lib/components/workspace/Knowledge/Collection/Files.svelte @@ -0,0 +1,20 @@ + + +