mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
feat: support user-provided token to bingAI and chatgptBrowser
This commit is contained in:
parent
a953fc9f2b
commit
bbf2f8a6ca
22 changed files with 309 additions and 86 deletions
|
|
@ -39,7 +39,8 @@ router.post('/', async (req, res) => {
|
|||
jailbreakConversationId: req.body?.jailbreakConversationId ?? null,
|
||||
systemMessage: req.body?.systemMessage ?? null,
|
||||
context: req.body?.context ?? null,
|
||||
toneStyle: req.body?.toneStyle ?? 'fast'
|
||||
toneStyle: req.body?.toneStyle ?? 'fast',
|
||||
token: req.body?.token ?? null
|
||||
};
|
||||
else
|
||||
endpointOption = {
|
||||
|
|
@ -49,7 +50,8 @@ router.post('/', async (req, res) => {
|
|||
conversationSignature: req.body?.conversationSignature ?? null,
|
||||
clientId: req.body?.clientId ?? null,
|
||||
invocationId: req.body?.invocationId ?? null,
|
||||
toneStyle: req.body?.toneStyle ?? 'fast'
|
||||
toneStyle: req.body?.toneStyle ?? 'fast',
|
||||
token: req.body?.token ?? null
|
||||
};
|
||||
|
||||
console.log('ask log', {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ router.post('/', async (req, res) => {
|
|||
|
||||
// build endpoint option
|
||||
const endpointOption = {
|
||||
model: req.body?.model ?? 'text-davinci-002-render-sha'
|
||||
model: req.body?.model ?? 'text-davinci-002-render-sha',
|
||||
token: req.body?.token ?? null
|
||||
};
|
||||
|
||||
const availableModels = getChatGPTBrowserModels();
|
||||
|
|
|
|||
|
|
@ -18,8 +18,15 @@ const getChatGPTBrowserModels = () => {
|
|||
router.get('/', function (req, res) {
|
||||
const azureOpenAI = !!process.env.AZURE_OPENAI_KEY;
|
||||
const openAI = process.env.OPENAI_KEY ? { availableModels: getOpenAIModels() } : false;
|
||||
const bingAI = !!process.env.BINGAI_TOKEN;
|
||||
const chatGPTBrowser = process.env.CHATGPT_TOKEN ? { availableModels: getChatGPTBrowserModels() } : false;
|
||||
const bingAI = process.env.BINGAI_TOKEN
|
||||
? { userProvide: process.env.BINGAI_TOKEN == 'user_provide' }
|
||||
: false;
|
||||
const chatGPTBrowser = process.env.CHATGPT_TOKEN
|
||||
? {
|
||||
userProvide: process.env.CHATGPT_TOKEN == 'user_provide',
|
||||
availableModels: getChatGPTBrowserModels()
|
||||
}
|
||||
: false;
|
||||
|
||||
res.send(JSON.stringify({ azureOpenAI, openAI, bingAI, chatGPTBrowser }));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue