mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-09-18 07:11:34 +00:00
Update config.ts
resolve conflict
This commit is contained in:
@@ -11,6 +11,9 @@ import {
|
|||||||
getGeminiApiKey,
|
getGeminiApiKey,
|
||||||
getOpenaiApiKey,
|
getOpenaiApiKey,
|
||||||
updateConfig,
|
updateConfig,
|
||||||
|
getCustomOpenaiApiUrl,
|
||||||
|
getCustomOpenaiApiKey,
|
||||||
|
getCustomOpenaiModelName,
|
||||||
} from '../config';
|
} from '../config';
|
||||||
import logger from '../utils/logger';
|
import logger from '../utils/logger';
|
||||||
|
|
||||||
@@ -56,6 +59,9 @@ router.get('/', async (_, res) => {
|
|||||||
config['anthropicApiKey'] = getAnthropicApiKey();
|
config['anthropicApiKey'] = getAnthropicApiKey();
|
||||||
config['groqApiKey'] = getGroqApiKey();
|
config['groqApiKey'] = getGroqApiKey();
|
||||||
config['geminiApiKey'] = getGeminiApiKey();
|
config['geminiApiKey'] = getGeminiApiKey();
|
||||||
|
config['customOpenaiApiUrl'] = getCustomOpenaiApiUrl();
|
||||||
|
config['customOpenaiApiKey'] = getCustomOpenaiApiKey();
|
||||||
|
config['customOpenaiModelName'] = getCustomOpenaiModelName()
|
||||||
|
|
||||||
res.status(200).json(config);
|
res.status(200).json(config);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
@@ -68,15 +74,30 @@ router.post('/', async (req, res) => {
|
|||||||
const config = req.body;
|
const config = req.body;
|
||||||
|
|
||||||
const updatedConfig = {
|
const updatedConfig = {
|
||||||
API_KEYS: {
|
MODELS: {
|
||||||
OPENAI: config.openaiApiKey,
|
OPENAI: {
|
||||||
GROQ: config.groqApiKey,
|
API_KEY: config.openaiApiKey,
|
||||||
ANTHROPIC: config.anthropicApiKey,
|
},
|
||||||
GEMINI: config.geminiApiKey,
|
GROQ: {
|
||||||
},
|
API_KEY: config.groqApiKey,
|
||||||
API_ENDPOINTS: {
|
},
|
||||||
OLLAMA: config.ollamaApiUrl,
|
ANTHROPIC: {
|
||||||
LMSTUDIO: config.lmStudioApiUrl,
|
API_KEY: config.anthropicApiKey,
|
||||||
|
},
|
||||||
|
GEMINI: {
|
||||||
|
API_KEY: config.geminiApiKey,
|
||||||
|
},
|
||||||
|
OLLAMA: {
|
||||||
|
API_URL: config.ollamaApiUrl,
|
||||||
|
},
|
||||||
|
LMSTUDIO: {
|
||||||
|
API_URL: config.lmStudioApiUrl,
|
||||||
|
},
|
||||||
|
CUSTOM_OPENAI: {
|
||||||
|
API_URL: config.customOpenaiApiUrl,
|
||||||
|
API_KEY: config.customOpenaiApiKey,
|
||||||
|
MODEL_NAME: config.customOpenaiModelName,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user