This commit is contained in:
Timothy J. Baek
2024-10-03 21:05:55 -07:00
parent 124a17e826
commit 6747478f67
4 changed files with 23 additions and 8 deletions

View File

@@ -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(

View File

@@ -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: