mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-08-14 03:38:29 +00:00
Add config params for keycloak
This commit is contained in:
@ -11,6 +11,11 @@ interface Config {
|
||||
KEEP_ALIVE: string;
|
||||
SEARCH_ENGINE_BACKEND: string;
|
||||
};
|
||||
KEYCLOAK: {
|
||||
URL: string;
|
||||
REALM: string;
|
||||
CLIENT_ID: string;
|
||||
};
|
||||
MODELS: {
|
||||
OPENAI: {
|
||||
API_KEY: string;
|
||||
@ -74,7 +79,8 @@ export const getAnthropicApiKey = () => loadConfig().MODELS.ANTHROPIC.API_KEY;
|
||||
|
||||
export const getGeminiApiKey = () => loadConfig().MODELS.GEMINI.API_KEY;
|
||||
|
||||
export const getSearchEngineBackend = () => loadConfig().GENERAL.SEARCH_ENGINE_BACKEND;
|
||||
export const getSearchEngineBackend = () =>
|
||||
loadConfig().GENERAL.SEARCH_ENGINE_BACKEND;
|
||||
|
||||
export const getGoogleApiKey = () => loadConfig().SEARCH_ENGINES.GOOGLE.API_KEY;
|
||||
|
||||
@ -82,7 +88,8 @@ export const getGoogleCseId = () => loadConfig().SEARCH_ENGINES.GOOGLE.CSE_ID;
|
||||
|
||||
export const getBraveApiKey = () => loadConfig().SEARCH_ENGINES.BRAVE.API_KEY;
|
||||
|
||||
export const getBingSubscriptionKey = () => loadConfig().SEARCH_ENGINES.BING.SUBSCRIPTION_KEY;
|
||||
export const getBingSubscriptionKey = () =>
|
||||
loadConfig().SEARCH_ENGINES.BING.SUBSCRIPTION_KEY;
|
||||
|
||||
export const getSearxngApiEndpoint = () =>
|
||||
process.env.SEARXNG_API_URL || loadConfig().SEARCH_ENGINES.SEARXNG.ENDPOINT;
|
||||
@ -98,6 +105,12 @@ export const getCustomOpenaiApiUrl = () =>
|
||||
export const getCustomOpenaiModelName = () =>
|
||||
loadConfig().MODELS.CUSTOM_OPENAI.MODEL_NAME;
|
||||
|
||||
export const getKeyCloakUrl = () => loadConfig().KEYCLOAK.URL;
|
||||
|
||||
export const getKeyCloakRealm = () => loadConfig().KEYCLOAK.REALM;
|
||||
|
||||
export const getKeyCloakClientId = () => loadConfig().KEYCLOAK.CLIENT_ID;
|
||||
|
||||
const mergeConfigs = (current: any, update: any): any => {
|
||||
if (update === null || update === undefined) {
|
||||
return current;
|
||||
|
Reference in New Issue
Block a user