mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
refactor(SetTokenDialog): refactor to TS, modularize config logic into separate components
This commit is contained in:
parent
b6f21af69b
commit
8b91145953
15 changed files with 385 additions and 306 deletions
|
|
@ -31,7 +31,7 @@ router.get('/', async function (req, res) {
|
|||
key = require('../../data/auth.json');
|
||||
} catch (e) {
|
||||
if (i === 0) {
|
||||
console.log("No 'auth.json' file (service account key) found in /api/data/ for PaLM models");
|
||||
console.log('No \'auth.json\' file (service account key) found in /api/data/ for PaLM models');
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
@ -50,6 +50,7 @@ router.get('/', async function (req, res) {
|
|||
: false;
|
||||
const openAIApiKey = process.env.OPENAI_API_KEY;
|
||||
const azureOpenAIApiKey = process.env.AZURE_API_KEY;
|
||||
const userProvidedOpenAI = openAIApiKey ? openAIApiKey === 'user_provided' : azureOpenAIApiKey === 'user_provided';
|
||||
const openAI = openAIApiKey
|
||||
? { availableModels: getOpenAIModels(), userProvide: openAIApiKey === 'user_provided' }
|
||||
: false;
|
||||
|
|
@ -57,7 +58,7 @@ router.get('/', async function (req, res) {
|
|||
? { availableModels: getOpenAIModels({ azure: true}), userProvide: azureOpenAIApiKey === 'user_provided' }
|
||||
: false;
|
||||
const gptPlugins = openAIApiKey || azureOpenAIApiKey
|
||||
? { availableModels: getPluginModels(), availableTools, availableAgents: ['classic', 'functions'] }
|
||||
? { availableModels: getPluginModels(), availableTools, availableAgents: ['classic', 'functions'], userProvide: userProvidedOpenAI }
|
||||
: false;
|
||||
const bingAI = process.env.BINGAI_TOKEN
|
||||
? { userProvide: process.env.BINGAI_TOKEN == 'user_provided' }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue