Fix: Azure "user_provided" Frontend Credentials and Save Last Selected Bing Settings (#587)

* fix(Messages.jsx): fix <body> tag warning

* fix(NewConversationMenu): update localStorage with lastBingSettings when endpoint is 'bingAI'
fix(getDefaultConversation): retrieve lastBingSettings from localStorage and use it to set default values for jailbreak and toneStyle when endpoint is 'bingAI'
feat(settings.spec.js): add test to check if the active class is set on the selected endpoint in the settings menu

* fix(BingAIOptions): add data-testid to BingAIOptions SelectDropDown component
fix(settings.spec.js): update test to include additional steps for testing settings persistence

* fix(azure): support user_provided credentials from client
This commit is contained in:
Danny Avila 2023-07-05 09:18:45 -04:00 committed by GitHub
parent 04e4259005
commit 75250f3a5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 76 additions and 15 deletions

View file

@ -141,7 +141,7 @@ const ask = async ({ text, endpointOption, parentMessageId = null, endpoint, con
let oaiApiKey = req.body?.token ?? process.env.OPENAI_API_KEY;
if (process.env.AZURE_API_KEY && endpoint === 'azureOpenAI') {
clientOptions.azure = getAzureCredentials();
clientOptions.azure = JSON.parse(req.body?.token) ?? getAzureCredentials();
// clientOptions.reverseProxyUrl = process.env.AZURE_REVERSE_PROXY ?? genAzureChatCompletion({ ...clientOptions.azure });
oaiApiKey = clientOptions.azure.azureOpenAIApiKey;
}