I am trying to create a Kernel Memory that would be used within the Kernel of an Agent.
var memory = new KernelMemoryBuilder() .WithOpenAIDefaults(apiKey) .Build();
As I understand from the Semantic Kernel team, this is happening because Kernel Memory assembly is not updated with the latest changes from SK v1.18.0-rc, which uses Azure/OpenAI v2 SDK
I get the following exception when using the 1.18.0-rc version of Microsoft.SemanticKernel.Connectors.OpenAI but do not get the exception when using the 1.17.1 version.
System.TypeLoadException
HResult=0x80131522
Message=Could not load type 'Azure.AI.OpenAI.OpenAIClient' from assembly 'Azure.AI.OpenAI, Version=2.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'.
Source=Microsoft.KernelMemory.AI.OpenAI
StackTrace:
at Microsoft.KernelMemory.AI.OpenAI.OpenAITextEmbeddingGenerator..ctor(OpenAIConfig config, ITextTokenizer textTokenizer, ILoggerFactory loggerFactory, HttpClient httpClient)
at Microsoft.KernelMemory.KernelMemoryBuilderExtensions.WithOpenAIDefaults(IKernelMemoryBuilder builder, String apiKey, String organization, ITextTokenizer textGenerationTokenizer, ITextTokenizer textEmbeddingTokenizer, ILoggerFactory loggerFactory, Boolean onlyForRetrieval, HttpClient httpClient)
at Program.d__6.MoveNext() in C:\Code\Work\SemanticKernel\SemanticKernelSamples\SK_AllinOne\Program.cs:line 74
at Program.
d__5.MoveNext() in C:\Code\Work\SemanticKernel\SemanticKernelSamples\SK_AllinOne\Program.cs:line 59
What happened?
Exception when creating kernel memory using 1.18.0-rc
Importance
I cannot use Kernel Memory
Platform, Language, Versions
.Net 8, C#, 1.18.0-rc
Relevant log output
System.TypeLoadException
HResult=0x80131522
Message=Could not load type 'Azure.AI.OpenAI.OpenAIClient' from assembly 'Azure.AI.OpenAI, Version=2.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'.
Source=Microsoft.KernelMemory.AI.OpenAI
StackTrace:
at Microsoft.KernelMemory.AI.OpenAI.OpenAITextEmbeddingGenerator..ctor(OpenAIConfig config, ITextTokenizer textTokenizer, ILoggerFactory loggerFactory, HttpClient httpClient)
at Microsoft.KernelMemory.KernelMemoryBuilderExtensions.WithOpenAIDefaults(IKernelMemoryBuilder builder, String apiKey, String organization, ITextTokenizer textGenerationTokenizer, ITextTokenizer textEmbeddingTokenizer, ILoggerFactory loggerFactory, Boolean onlyForRetrieval, HttpClient httpClient)
at Program.d__6.MoveNext() in C:\Code\Work\SemanticKernel\SemanticKernelSamples\SK_AllinOne\Program.cs:line 74
at Program.
d__5.MoveNext() in C:\Code\Work\SemanticKernel\SemanticKernelSamples\SK_AllinOne\Program.cs:line 59
@shyam-menon if you're working with unreleased/experimental code, such as RC versions, you might get luckier linking SK sources directly. I don't think this classifies as a bug, does it?
Context / Scenario
I am trying to create a Kernel Memory that would be used within the Kernel of an Agent. var memory = new KernelMemoryBuilder() .WithOpenAIDefaults(apiKey) .Build();
As I understand from the Semantic Kernel team, this is happening because Kernel Memory assembly is not updated with the latest changes from SK v1.18.0-rc, which uses Azure/OpenAI v2 SDK
I get the following exception when using the 1.18.0-rc version of Microsoft.SemanticKernel.Connectors.OpenAI but do not get the exception when using the 1.17.1 version.
System.TypeLoadException HResult=0x80131522 Message=Could not load type 'Azure.AI.OpenAI.OpenAIClient' from assembly 'Azure.AI.OpenAI, Version=2.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. Source=Microsoft.KernelMemory.AI.OpenAI StackTrace: at Microsoft.KernelMemory.AI.OpenAI.OpenAITextEmbeddingGenerator..ctor(OpenAIConfig config, ITextTokenizer textTokenizer, ILoggerFactory loggerFactory, HttpClient httpClient) at Microsoft.KernelMemory.KernelMemoryBuilderExtensions.WithOpenAIDefaults(IKernelMemoryBuilder builder, String apiKey, String organization, ITextTokenizer textGenerationTokenizer, ITextTokenizer textEmbeddingTokenizer, ILoggerFactory loggerFactory, Boolean onlyForRetrieval, HttpClient httpClient) at Program.d__6.MoveNext() in C:\Code\Work\SemanticKernel\SemanticKernelSamples\SK_AllinOne\Program.cs:line 74 at Program.
d__5.MoveNext() in C:\Code\Work\SemanticKernel\SemanticKernelSamples\SK_AllinOne\Program.cs:line 59
What happened?
Exception when creating kernel memory using 1.18.0-rc
Importance
I cannot use Kernel Memory
Platform, Language, Versions
.Net 8, C#, 1.18.0-rc
Relevant log output