mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-12-17 09:08:15 +00:00
adding the ability to configure ollama chat options and embeddings params via the config.toml file
This commit is contained in:
@@ -9,6 +9,8 @@ import {
|
||||
getAnthropicApiKey,
|
||||
getGeminiApiKey,
|
||||
getOpenaiApiKey,
|
||||
getOllamaChatOptions,
|
||||
getOllamaEmbeddingsParams,
|
||||
updateConfig,
|
||||
} from '../config';
|
||||
import logger from '../utils/logger';
|
||||
@@ -54,6 +56,8 @@ router.get('/', async (_, res) => {
|
||||
config['anthropicApiKey'] = getAnthropicApiKey();
|
||||
config['groqApiKey'] = getGroqApiKey();
|
||||
config['geminiApiKey'] = getGeminiApiKey();
|
||||
config['ollamaChatOptions'] = getOllamaChatOptions();
|
||||
config['ollamaEmbeddingsParams'] = getOllamaEmbeddingsParams();
|
||||
|
||||
res.status(200).json(config);
|
||||
} catch (err: any) {
|
||||
@@ -75,6 +79,7 @@ router.post('/', async (req, res) => {
|
||||
API_ENDPOINTS: {
|
||||
OLLAMA: config.ollamaApiUrl,
|
||||
},
|
||||
OLLAMA_OPTIONS: config.ollamaOptions,
|
||||
};
|
||||
|
||||
updateConfig(updatedConfig);
|
||||
|
||||
Reference in New Issue
Block a user