From 628310b12b41ec3439b6c1b8e2872996cfdeff6f Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 27 Aug 2024 15:58:02 +0200 Subject: [PATCH] refac --- src/lib/components/chat/MessageInput.svelte | 22 ++------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 4e93ff6b4..69c02d793 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -15,11 +15,11 @@ user as _user } from '$lib/stores'; import { blobToFile, findWordIndices } from '$lib/utils'; + import { transcribeAudio } from '$lib/apis/audio'; - import { processDocToVectorDB } from '$lib/apis/rag'; - import { uploadFile } from '$lib/apis/files'; + import { SUPPORTED_FILE_TYPE, SUPPORTED_FILE_EXTENSIONS, @@ -171,24 +171,6 @@ } }; - const processFileCountLimit = async (querySettings, inputFiles) => { - const maxFiles = querySettings.FILE_MAX_COUNT; - const currentFilesCount = files.length; - const inputFilesCount = inputFiles.length; - const totalFilesCount = currentFilesCount + inputFilesCount; - - if (currentFilesCount >= maxFiles || totalFilesCount > maxFiles) { - toast.error(`File count exceeds the limit of '${maxFiles}'. Please remove some files.`); - if (currentFilesCount >= maxFiles) { - return [false, null]; - } - if (totalFilesCount > maxFiles) { - inputFiles = inputFiles.slice(0, maxFiles - currentFilesCount); - } - } - return [true, inputFiles]; - }; - const inputFilesHandler = async (inputFiles) => { inputFiles.forEach((file) => { if (['image/gif', 'image/webp', 'image/jpeg', 'image/png'].includes(file['type'])) {