From ecc2466f1ed21b45147e967ebe7b44ff531904e8 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 22 Dec 2023 20:31:42 -0800 Subject: [PATCH] feat: alternative models response support --- src/lib/components/chat/SettingsModal.svelte | 4 +++- src/routes/(app)/+layout.svelte | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index dbca0e792..5d4334c4a 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -323,7 +323,9 @@ return null; }); - const openAIModels = openaiModelRes?.data ?? null; + const openAIModels = Array.isArray(openaiModelRes) + ? openaiModelRes + : openaiModelRes?.data ?? null; models.push( ...(openAIModels diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index 94d242e1d..af8c75224 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -74,7 +74,9 @@ return null; }); - const openAIModels = openaiModelRes?.data ?? null; + const openAIModels = Array.isArray(openaiModelRes) + ? openaiModelRes + : openaiModelRes?.data ?? null; models.push( ...(openAIModels