From 95b8edf6b3e1ac53749bddf70488836a931860a1 Mon Sep 17 00:00:00 2001 From: Danny Liu Date: Tue, 20 Feb 2024 16:00:57 -0800 Subject: [PATCH] use cancelChatCompletion API call instead of stopResponse function --- src/lib/components/chat/Messages.svelte | 4 ++-- src/routes/(app)/+page.svelte | 1 - src/routes/(app)/c/[id]/+page.svelte | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/Messages.svelte b/src/lib/components/chat/Messages.svelte index 9efab1e5..e8b9a80f 100644 --- a/src/lib/components/chat/Messages.svelte +++ b/src/lib/components/chat/Messages.svelte @@ -11,12 +11,12 @@ import ResponseMessage from './Messages/ResponseMessage.svelte'; import Placeholder from './Messages/Placeholder.svelte'; import Spinner from '../common/Spinner.svelte'; + import { cancelChatCompletion } from '$lib/apis/ollama'; export let chatId = ''; export let sendPrompt: Function; export let continueGeneration: Function; export let regenerateResponse: Function; - export let stopResponse: Function; export let processing = ''; export let bottomPadding = false; @@ -229,7 +229,7 @@ await updateChatById(localStorage.token, chatId, { history }); await chats.set(await getChatList(localStorage.token)); - stopResponse(); + await cancelChatCompletion(localStorage.token, chatId); }; diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index b93dc860..33409ec3 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -828,7 +828,6 @@ {sendPrompt} {continueGeneration} {regenerateResponse} - {stopResponse} /> diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 737a13e0..be84467d 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -858,7 +858,6 @@ {sendPrompt} {continueGeneration} {regenerateResponse} - {stopResponse} />