diff --git a/src/lib/components/admin/Settings/Connections.svelte b/src/lib/components/admin/Settings/Connections.svelte index 6031b591c..407810c9f 100644 --- a/src/lib/components/admin/Settings/Connections.svelte +++ b/src/lib/components/admin/Settings/Connections.svelte @@ -148,18 +148,22 @@ OLLAMA_API_CONFIGS = ollamaConfig.OLLAMA_API_CONFIGS; if (ENABLE_OPENAI_API) { - OPENAI_API_BASE_URLS.forEach(async (url, idx) => { - const res = await getOpenAIModels(localStorage.token, idx); - if (res.pipelines) { - pipelineUrls[url] = true; - } - }); - for (const url of OPENAI_API_BASE_URLS) { if (!OPENAI_API_CONFIGS[url]) { OPENAI_API_CONFIGS[url] = {}; } } + + OPENAI_API_BASE_URLS.forEach(async (url, idx) => { + OPENAI_API_CONFIGS[url] = OPENAI_API_CONFIGS[url] || {}; + if (!(OPENAI_API_CONFIGS[url]?.enable ?? true)) { + return; + } + const res = await getOpenAIModels(localStorage.token, idx); + if (res.pipelines) { + pipelineUrls[url] = true; + } + }); } if (ENABLE_OLLAMA_API) { diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 2767b296e..4d8ea5d70 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -291,7 +291,7 @@