microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.96k stars 3.27k forks source link

.Net: With RC1 WithAzureOpenAIEmbeddingGeneration errors at runtime #3970

Closed johnnyreilly closed 11 months ago

johnnyreilly commented 11 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Using code like this:

            .WithAzureOpenAIEmbeddingGeneration(new AzureOpenAIConfig
            {
                APIType = AzureOpenAIConfig.APITypes.EmbeddingGeneration,
                Auth = AzureOpenAIConfig.AuthTypes.AzureIdentity,
                Endpoint = _appSettings.OpenAiServiceUrl ?? string.Empty,
                Deployment = _appSettings.DeploymentNameEmbedding ?? string.Empty
            })

Worked with beta8. With RC1, it compiles, but at runtime an error like this is thrown:

      Error processing document
      System.MissingMethodException: Method not found: 'Void Microsoft.SemanticKernel.Connectors.AI.OpenAI.TextEmbedding.AzureOpenAITextEmbeddingGeneration..ctor(System.String, System.String, Azure.Core.TokenCredential, System.String, System.Net.Http.HttpClient, Microsoft.Extensions.Logging.ILoggerFactory)'.
         at Microsoft.KernelMemory.KernelMemoryBuilderExtensions.WithAzureOpenAIEmbeddingGeneration(IKernelMemoryBuilder builder, AzureOpenAIConfig config, Boolean onlyForRetrieval)

Expected behavior Compiling code runs as it did with beta8

Screenshots n/a

Platform

    <PackageReference Include="Microsoft.KernelMemory.Core" Version="0.15.231204.1-preview" />
    <PackageReference Include="Microsoft.SemanticKernel" Version="1.0.0-rc1" />
    <PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.AzureCognitiveSearch" Version="1.0.0-rc1" />
    <PackageReference Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.0.0-rc1" />
    <PackageReference Include="Azure.AI.OpenAI" Version="1.0.0-beta.9" />

Additional context Possibly similar to https://github.com/microsoft/semantic-kernel/issues/3962

stephentoub commented 11 months ago

There were breaking changes between bet8 and rc1. It looks like you're referencing a library from the kernel memory project that was built against beta8. That will need to rebuild against rc1 and then you'll need to update to use that version. It's expecting an API signature that's not exactly the same as it was in beta8, hence the missing member exception.

@dluc, @markwallace-microsoft

johnnyreilly commented 11 months ago

I've got the latest version from NuGet: https://www.nuget.org/packages/Microsoft.KernelMemory.Core/0.15.231204.1-preview

Is there likely to be a release of Microsoft.KernelMemory.Core that covers this?

johnnyreilly commented 11 months ago

Closing this as resolved thanks to a new version. There's different / similar errors with RC2 / RC3 but I'll raise them separately - see https://github.com/microsoft/semantic-kernel/issues/4071