Closed grantcolin closed 4 months ago
Hi +1 on needing Azure OpenAI supported, noticed it is required by several academic institutes in my region.
I would definitely merge a pull request that provided this functionality. It sounds like it would need to both provide a checkbox on the settings page to "enable Azure endpoints" as well as a textbox that allows the admin to enter their service name. However, I would need to understand the Azure URL better before I could implement this myself. How does the domain change when different models are used, especially GPT vs non-GPT models? What is the significance of the api-version parameter, and how often would that need to be updated?
Hi. I think all you need on the settings form
is a checkbox - use Azure Openai a text field for the AZ openai api endpoint which will be different for each user (visible if AZ openai is checked) and as above in classes/completion/chat.php wrap the apikey / response lines in an if az openai=checked
the lines that are required to be changed to use AZ openai are:
'api-key: ' . $this->apikey,
and
$response = $curl->post("https://
the curl->post being a variable from the settings text field for api endpoint.
Hope that helps. If I have time I will create a pull request.
Just to update everyone on this issue, development on this has been sponsored and I've been given access to an Azure account so that I can understand and test the API. An upcoming 2.1 release will include support for Azure endpoints by creating a new selectable API type, "azure," that adds a "resource name," "deployment ID," and "API version" setting. This should release in the next few weeks.
Support for Azure is included in version 2.1.2, released today.
Hi. I have modded the plugin to work with Azure openai api but it would be good if this was an option out of the box. https://learn.microsoft.com/en-us/azure/cognitive-services/openai/reference
See change for Azure openai support here using gpt-3.5-turbo model
//'Authorization: Bearer ' . $this->apikey, 'api-key: ' . $this->apikey, 'Content-Type: application/json' ), )); //$response = $curl->post("https://api.openai.com/v1/chat/completions",
// the api endpoint in azure is different for each customer. Would be good if that could be configured within settings