From 3c55773bb2b4ec0700793edf51b12788c9972caf Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 19 May 2024 18:17:18 -0700 Subject: [PATCH] fix --- src/routes/(app)/+page.svelte | 8 ++++---- src/routes/(app)/c/[id]/+page.svelte | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index 6ef6b7d0e..04729b8ec 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -341,12 +341,12 @@ scrollToBottom(); const messagesBody = [ - $settings.system || Array.isArray(responseMessage?.userContext ?? null) + ($settings.system || responseMessage?.userContext) ?? null ? { role: 'system', content: - $settings.system + Array.isArray(responseMessage?.userContext ?? null) - ? `\n\nUser Context:\n${userContext.join('\n')}` + $settings.system + responseMessage?.userContext ?? null + ? `\n\nUser Context:\n${(responseMessage?.userContext ?? []).join('\n')}` : '' } : undefined, @@ -605,7 +605,7 @@ role: 'system', content: $settings.system + (responseMessage?.userContext ?? null) - ? `\n\nUser Context:\n${responseMessage.userContext.join('\n')}` + ? `\n\nUser Context:\n${(responseMessage?.userContext ?? []).join('\n')}` : '' } : undefined, diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 2da659e72..449f5c658 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -347,12 +347,12 @@ scrollToBottom(); const messagesBody = [ - $settings.system || Array.isArray(responseMessage?.userContext ?? null) + ($settings.system || responseMessage?.userContext) ?? null ? { role: 'system', content: - $settings.system + Array.isArray(responseMessage?.userContext ?? null) - ? `\n\nUser Context:\n${userContext.join('\n')}` + $settings.system + responseMessage?.userContext ?? null + ? `\n\nUser Context:\n${(responseMessage?.userContext ?? []).join('\n')}` : '' } : undefined, @@ -611,7 +611,7 @@ role: 'system', content: $settings.system + (responseMessage?.userContext ?? null) - ? `\n\nUser Context:\n${responseMessage.userContext.join('\n')}` + ? `\n\nUser Context:\n${(responseMessage?.userContext ?? []).join('\n')}` : '' } : undefined,