mirror of
https://github.com/open-webui/open-webui
synced 2024-11-07 00:59:52 +00:00
refac
This commit is contained in:
parent
124a17e826
commit
6747478f67
@ -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(
|
||||
|
@ -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:
|
||||
|
@ -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>
|
@ -1,7 +0,0 @@
|
||||
<script lang="ts">
|
||||
export let files = [];
|
||||
</script>
|
||||
|
||||
<div>
|
||||
{JSON.stringify(files)}
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user