Cannot use Azure OpenAI endpoint
Since openai version 1.x, the azure endpoint annoyingly uses a different class than the regular OpenAI class, namely AzureOpenAI (see here for the Microsoft Documentation).
With the current release, it is not possible to use the Azure OpenAI api. Would changing the openai_models.py to suit Azure make sense? Or should we implement this as a plugin?
i have made a very basic suggestion, by editing the current release to work with the azure api. see #414.
the corresponding extra-openai-models.yaml looks something like this:
- model_id: azure
api_type: azure
model_name: gpt-4
api_version: "2023-05-15"
api_base: https://your-endpoint.openai.azure.com/
This is a solid requirement. I have generally found the langchain and OpenAI library environment setting overlap/disconnect with the AZURE_OPENAI backend to be a bit maddening. Maybe a plugin, and deal with the fact that it's going to be a different set of environment variables potentially needed (through config or env).
i have written a plugin, which uses the AzureOpenAI class and allows using the llm cli with azure api keys. let me know if it works for you! https://github.com/fabge/llm-azure/