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,