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 getOllamaApiEndpoint = () => loadConfig().API_ENDPOINTS.OLLAMA;
|
||||||
|
|
||||||
|
export const getOllamaAuthHeader = () => loadConfig().API_ENDPOINTS.OLLAMA_AUTH_HEADER;
|
||||||
|
|
||||||
export const updateConfig = (config: RecursivePartial<Config>) => {
|
export const updateConfig = (config: RecursivePartial<Config>) => {
|
||||||
const currentConfig = loadConfig();
|
const currentConfig = loadConfig();
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ export const getAvailableChatModelProviders = async () => {
|
||||||
const openAIApiKey = getOpenaiApiKey();
|
const openAIApiKey = getOpenaiApiKey();
|
||||||
const groqApiKey = getGroqApiKey();
|
const groqApiKey = getGroqApiKey();
|
||||||
const ollamaEndpoint = getOllamaApiEndpoint();
|
const ollamaEndpoint = getOllamaApiEndpoint();
|
||||||
|
const ollamaAuthHeader = getOllamaAuthHeader();
|
||||||
|
|
||||||
const models = {};
|
const models = {};
|
||||||
|
|
||||||
|
@ -96,10 +97,10 @@ export const getAvailableChatModelProviders = async () => {
|
||||||
|
|
||||||
if (ollamaEndpoint) {
|
if (ollamaEndpoint) {
|
||||||
let headers;
|
let headers;
|
||||||
if (typeof process.env['OLLAMA_AUTH_HEADER'] !== undefined) {
|
if (typeof ollamaAuthHeader !== undefined) {
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Authorization': process.env['OLLAMA_AUTH_HEADER']
|
'Authorization': ollamaAuthHeader
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
headers = { 'Content-Type': 'application/json' };
|
headers = { 'Content-Type': 'application/json' };
|
||||||
|
|
Loading…
Reference in New Issue