semantic-kernel
semantic-kernel copied to clipboard
Update SK to use official Azure OpenAI .NET SDK
Update Azure OpenAI Service client to use the official .NET SDK.
https://www.nuget.org/packages/Azure.AI.OpenAI/
thanks @luisquintanilla, yes, we are familiar with the package and plan to use the official library eventually. There are a few aspects to consider, such as batching, HTTP retry logic, mapping model names to deployments, support for the many OpenAI endpoints, etc. I think this will eventually be part of the ongoing effort about extending the list of models and endpoints, which is going to improve the underlying design of backends and connectors.
@luisquintanilla , I have added this to the project team so we can track this.
@luisquintanilla , I have added this to the project team so we can track this.
Sounds great. Thanks!
@dluc I believe you are working on this.
@luisquintanilla work done, v0.12 now uses the Azure SDK for text, chat and embeddings. We still have a custom client for DALL-E2. Please let us know if there are updates, we'll keep an eye on the nuget feed ;-) Would be nice having an official support for OpenAI OrgId. For now we used a work around injecting a header.
Some things we could not figure out yet:
- how exactly to wire up ILogger into the Azure SDK. I'm still digging through https://learn.microsoft.com/en-us/dotnet/azure/sdk/logging - I think it would be nice making it a one liner for the SDK users
- how exactly to inject a custom HTTP handler, I tried following the instructions (https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Configuration.md#azure-client-configuration-samples) and I got a bunch of errors so for now some code is commented out.