betalgo / openai

OpenAI .NET sdk - Azure OpenAI, ChatGPT, Whisper, and DALL-E
https://betalgo.github.io/openai/
MIT License
2.89k stars 521 forks source link

Azure OpenAI Support #500

Closed piggy0713 closed 6 months ago

piggy0713 commented 6 months ago

Describe the bug I attempted to follow the setup guide provided on the Betalgo GitHub wiki for integrating with Azure OpenAI, available at https://github.com/betalgo/openai/wiki/Azure-OpenAI. The guide does not mention how to specify or use the Azure OpenAI endpoint, and after setting up my configuration as instructed, the integration does not work as expected.

Your code piece I set up my configuration following the guide, which lacks details on specifying the Azure OpenAI endpoint. Despite using the provided options, the service is not functioning correctly.

{
 "OpenAIServiceOptions": {
    "ApiKey": "35...3a", //How can I get an app key? https://azure.microsoft.com/en-us/products/cognitive-services/openai-service
    "DeploymentId": "test1", // marked as 2 in the above screenshot
    "ResourceName": "betalgotest", // marked as 1 in the above screenshot
    "ProviderType": "Azure", //Important, don't forget to add this if you want to use Azure OpenAI
    //"ApiVersion": "2022-12-01" //optional
  }
}