diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index bcfa40618..3df52bee0 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -85,6 +85,7 @@ }; const sendPromptOllama = async (model, userPrompt, parentId) => { + console.log('sendPromptOllama'); let responseMessageId = uuidv4(); let responseMessage = { @@ -214,7 +215,7 @@ }; const sendPromptOpenAI = async (model, userPrompt, parentId) => { - if (settings.OPENAI_API_KEY) { + if ($settings.OPENAI_API_KEY) { if (models) { let responseMessageId = uuidv4(); @@ -242,7 +243,7 @@ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: `Bearer ${settings.OPENAI_API_KEY}` + Authorization: `Bearer ${$settings.OPENAI_API_KEY}` }, body: JSON.stringify({ model: model, @@ -251,7 +252,7 @@ $settings.system ? { role: 'system', - content: settings.system + content: $settings.system } : undefined, ...messages diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 410f04d66..00070f900 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -251,7 +251,7 @@ }; const sendPromptOpenAI = async (model, userPrompt, parentId) => { - if (settings.OPENAI_API_KEY) { + if ($settings.OPENAI_API_KEY) { if (models) { let responseMessageId = uuidv4(); @@ -279,7 +279,7 @@ method: 'POST', headers: { 'Content-Type': 'application/json', - Authorization: `Bearer ${settings.OPENAI_API_KEY}` + Authorization: `Bearer ${$settings.OPENAI_API_KEY}` }, body: JSON.stringify({ model: model, @@ -288,7 +288,7 @@ $settings.system ? { role: 'system', - content: settings.system + content: $settings.system } : undefined, ...messages