Closed johnnyreilly closed 2 months ago
We are also stuck I think it is similar to https://github.com/microsoft/semantic-kernel/issues/8956
That’s an unfortunate side effect of using serverless mode (and beta libraries). This is why we recommend running KM as a service - to keep KM’s internal dependencies separate from your app’s dependencies.
If your code references KM serverless classes and explicitly uses Azure.AI.OpenAI
, it’s important to align your app with the same version KM is using to prevent breaking changes, especially since the Azure OpenAI library is still in beta. The same applies to any other libraries KM depends on, if different versions are used in your solution.
For reference:
Context / Scenario
Following upgrading to
0.76.240930.3
, we started to see errors when we ran our application:Possible cause
After some further investigation it seems to be related to
Azure.AI.OpenAI
. It may not be directly a KM issue at all. KM works with:It doesn't with
or
It looks like it the issue there might be related to a property name change;
ApplicationId-> UserAgentApplicationId:Before: https://github.com/Azure/azure-sdk-for-net/blob/f5b4dfdd191e90df616209dd4d9d434a769dc8e0/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs#L302 After: https://github.com/Azure/azure-sdk-for-net/blob/c5bc53adb7006da46c9e5cbe1092f6e1e074b76d/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs#L306
So if you pin to beta-5 it's fine - but ideally it would be great to fix this in KM I guess?
Potential fix?
Would the fixes be required here?
What happened?
The error above happens when we try to use the following code (which worked with previous versions of KM):
Importance
I cannot use Kernel Memory with Azure.AI.OpenAI@2.0.0
Platform, Language, Versions
.NET 8, Kernel Memory 0.76.240930.3
Other thoughts
I'm also wondering if I should avoid directly referencing
Azure.AI.OpenAI
as a package reference as it's a transitive dependency of https://www.nuget.org/packages/Microsoft.SemanticKernel/#dependencies-body-tab