better
This commit is contained in:
parent
e34b6f3d8d
commit
7229a6d91f
|
@ -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<Config>) => {
|
||||
const currentConfig = loadConfig();
|
||||
|
||||
|
|
|
@ -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' };
|
||||
|
|
Loading…
Reference in New Issue