From 892591f89444182f704f63805a75624af448482e Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 24 Dec 2023 00:47:31 -0800 Subject: [PATCH] feat: no text response error message --- src/routes/(app)/+page.svelte | 7 +++++++ src/routes/(app)/c/[id]/+page.svelte | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index c0885d192..0d1055f9c 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -245,6 +245,13 @@ } } else { responseMessage.done = true; + + if (responseMessage.content == '') { + responseMessage.error = true; + responseMessage.content = + 'Oops! No text generated from Ollama, Please try again.'; + } + responseMessage.context = data.context ?? null; responseMessage.info = { total_duration: data.total_duration, diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 6ff95cd55..1b2c7053b 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -259,6 +259,13 @@ } } else { responseMessage.done = true; + + if (responseMessage.content == '') { + responseMessage.error = true; + responseMessage.content = + 'Oops! No text generated from Ollama, Please try again.'; + } + responseMessage.context = data.context ?? null; responseMessage.info = { total_duration: data.total_duration,