Added functionality to allow users to set custom api keys (#276)

* Added functionality to allow users to set custom api keys

* Added error handling

* Changed token to apiKey

* Changed apiKey to oaiApiKey

* added azure openai ui

* Removed logging

* Changed configure to Use

* Made checked position more rounded

* Made setting api key optional if it is openai

* Modified error handling

* Add support for insufficient_quota errors

* Fixed faulty error detection

* removed logging
This commit is contained in:
Anirudh 2023-05-18 04:51:30 +05:30 committed by GitHub
parent 08f3a77d58
commit 14104b276f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 207 additions and 32 deletions

View file

@ -40,7 +40,7 @@ router.get('/', async function (req, res) {
const azureOpenAI = !!process.env.AZURE_OPENAI_KEY;
const openAI =
process.env.OPENAI_KEY || process.env.AZURE_OPENAI_API_KEY
? { availableModels: getOpenAIModels() }
? { availableModels: getOpenAIModels(), userProvide: true }
: false;
const bingAI = process.env.BINGAI_TOKEN
? { userProvide: process.env.BINGAI_TOKEN == 'user_provided' }