Feat: Add Azure support (#219)

feat(api): add support for Azure OpenAI API

- Add Azure OpenAI API environment variables to .env.example
- Modify chatgpt-client.js to use Azure OpenAI API if environment variables are present
- Modify askOpenAI.js to use arrow function syntax
- Modify handlers.js to add console.log statement for partial variable
This commit is contained in:
Danny Avila 2023-05-09 17:42:55 -04:00 committed by GitHub
parent e2dc994b63
commit 5dd9c11326
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 144 additions and 25 deletions

View file

@ -64,7 +64,7 @@ router.post('/', requireJwtAuth, async (req, res) => {
};
const availableModels = getOpenAIModels();
if (availableModels.find((model) => model === endpointOption.model) === undefined)
if (availableModels.find(model => model === endpointOption.model) === undefined)
return handleError(res, { text: 'Illegal request: model' });
console.log('ask log', {