openai
openai copied to clipboard
Support Azure OpenAI.
I have a suggestion, can Azure OpenAI's API also be supported? If there is no time for development, I can also take care of it.
Please do, it was previously requested so I started an azure
branch but I couldn't test it personally since I can't have an Azure OpenAI access.
it is really highly appreciated, during your support for it I can help as well.
I modified the code and tailored it for ChatGPT, then I made updates to the README file. You can find the code in this branch (https://github.com/geeker-ai/dart_openai/tree/azure). Your review is much appreciated. This is the most basic adaptation I could conceive of. If you find this approach feasible, I can customize it for other models compatible with Azure.
@zmhu I've tested your modified code and I encountered an issue: "The method 'configureRestAPI' isn't defined for the type 'AzureOpenAi'." Could there be something I overlooked?
// Set your API key
AzureOpenAI.apiKey = Env.apiKey;
// Set your resource name and deployment name
AzureOpenAI.configureRestAPI(
yourResourceName: "your_resource_name",
yourDeploymentName: "your_deployment_name",
apiVersion: DateTime(2023, 06, 01),
);
Same behavior with the example. Thanks
Hi there, could you please provide an update on the current status of this feature? Thank you!
@zmhu @anasfik I will take on this issue as I have a paid account and can do the full testing. I will further update this branch.
@zmhu @anasfik do we want to try to place everything into the OpenAI singleton instead of creating a new "AzureOpenAI" class?
It's all OpenAI at the end of the day.