diff --git a/src/config.ts b/src/config.ts index 7c0c7f1..172c8ca 100644 --- a/src/config.ts +++ b/src/config.ts @@ -41,6 +41,8 @@ export const getSearxngApiEndpoint = () => loadConfig().API_ENDPOINTS.SEARXNG; export const getOllamaApiEndpoint = () => loadConfig().API_ENDPOINTS.OLLAMA; +export const getOllamaAuthHeader = () => loadConfig().API_ENDPOINTS.OLLAMA_AUTH_HEADER; + export const updateConfig = (config: RecursivePartial) => { const currentConfig = loadConfig(); diff --git a/src/lib/providers.ts b/src/lib/providers.ts index 3bf23b6..224448f 100644 --- a/src/lib/providers.ts +++ b/src/lib/providers.ts @@ -13,6 +13,7 @@ export const getAvailableChatModelProviders = async () => { const openAIApiKey = getOpenaiApiKey(); const groqApiKey = getGroqApiKey(); const ollamaEndpoint = getOllamaApiEndpoint(); + const ollamaAuthHeader = getOllamaAuthHeader(); const models = {}; @@ -96,10 +97,10 @@ export const getAvailableChatModelProviders = async () => { if (ollamaEndpoint) { let headers; - if (typeof process.env['OLLAMA_AUTH_HEADER'] !== undefined) { + if (typeof ollamaAuthHeader !== undefined) { headers = { 'Content-Type': 'application/json', - 'Authorization': process.env['OLLAMA_AUTH_HEADER'] + 'Authorization': ollamaAuthHeader }; } else { headers = { 'Content-Type': 'application/json' };