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:

View File

@ -0,0 +1,20 @@
<script lang="ts">
import FileItem from '$lib/components/common/FileItem.svelte';
export let files = [];
</script>
<div class=" max-h-full flex flex-col w-full">
{#each files as file (file.id)}
<div class="mt-2 px-2">
<FileItem
className="w-full"
colorClassName="bg-transparent hover:bg-gray-50 dark:hover:bg-gray-850 transition"
{file}
name={file.meta.name}
type="file"
dismissible
/>
</div>
{/each}
</div>

View File

@ -1,7 +0,0 @@
<script lang="ts">
export let files = [];
</script>
<div>
{JSON.stringify(files)}
</div>