Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #14711
What it does
It fixes #14711 and adds support for accessing an OpenAI model deployed on Azure.
To make this work, the
AzureOpenAI
class needs to be used, as described in the openai-node docs.To build up the request with
AzureOpenAI
you need to pass aapiVersion
. This PR therefore adds the option to configure theapiVersion
in the settings. If noapiVersion
is configured, the defaultOpenAI
object is used for initialization.I also noticed that it can happen, that the OpenAI model version deployed on Azure might not yet support the developer role. Therefore I also added the option to configure whether the developer role is supported or not, which defaults to
true
.How to test
The reviewer would need to have an OpenAI model available in Azure and then configure a custom openai model like this:
Of course a non Azure model deployment should still work as before.
Follow-ups
Breaking changes
Attribution
Review checklist
Reminder for reviewers