semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

Update SK to use official Azure OpenAI .NET SDK

Open luisquintanilla opened this issue 2 years ago • 4 comments
trafficstars

Update Azure OpenAI Service client to use the official .NET SDK.

https://www.nuget.org/packages/Azure.AI.OpenAI/

luisquintanilla avatar Mar 16 '23 16:03 luisquintanilla

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.

dluc avatar Mar 17 '23 04:03 dluc

@luisquintanilla , I have added this to the project team so we can track this.

evchaki avatar Mar 21 '23 21:03 evchaki

@luisquintanilla , I have added this to the project team so we can track this.

Sounds great. Thanks!

luisquintanilla avatar Mar 21 '23 21:03 luisquintanilla

@dluc I believe you are working on this.

microsoftShannon avatar Apr 13 '23 21:04 microsoftShannon

@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.

dluc avatar Apr 19 '23 06:04 dluc