From a93645aee8086368894db238d3f33bfbe7baec11 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 9 Jun 2024 15:08:23 -0700 Subject: [PATCH] refac --- backend/apps/ollama/main.py | 1 - src/lib/components/chat/Chat.svelte | 26 ++++++++++++-------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/backend/apps/ollama/main.py b/backend/apps/ollama/main.py index 5d7d2fac4..144755418 100644 --- a/backend/apps/ollama/main.py +++ b/backend/apps/ollama/main.py @@ -881,7 +881,6 @@ async def generate_openai_chat_completion( model_info = Models.get_model_by_id(model_id) if model_info: - print(model_info) if model_info.base_model_id: payload["model"] = model_info.base_model_id diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index d6f4d2464..c47e8d3a3 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -506,20 +506,18 @@ messages = messages; const prompt = history.messages[parentId].content; - let searchQuery = prompt; - if (prompt.length > 100) { - searchQuery = await generateSearchQuery(localStorage.token, model, messages, prompt); - if (!searchQuery) { - toast.warning($i18n.t('No search query generated')); - responseMessage.status = { - ...responseMessage.status, - done: true, - error: true, - description: 'No search query generated' - }; - messages = messages; - return; - } + let searchQuery = await generateSearchQuery(localStorage.token, model, messages, prompt); + if (!searchQuery) { + toast.warning($i18n.t('No search query generated')); + responseMessage.status = { + ...responseMessage.status, + done: true, + error: true, + description: 'No search query generated' + }; + messages = messages; + + searchQuery = prompt; } responseMessage.status = {