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

.Net: Bug: Could not load file or assembly Microsoft.Extensions.VectorData.Abstractions Exception raised.

Open aeras3637 opened this issue 2 years ago • 3 comments

Describe the bug Bing_FunctionCallingWithTextSearch.FunctionCallingWithBingTextSearchIncludingCitationsAsync in a local environment, an exception occurs.

Could not load file or assembly 'Microsoft.Extensions.VectorData.Abstractions, Version=1.24.0.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3'. 指定されたファイルが見つかりません。 場所 Microsoft.SemanticKernel.Plugins.Web.Bing.BingTextSearch.BuildQuery(String query, TextSearchOptions searchOptions) 場所 Microsoft.SemanticKernel.Plugins.Web.Bing.BingTextSearch.d__16.MoveNext() 場所 Microsoft.SemanticKernel.Plugins.Web.Bing.BingTextSearch.d__15.MoveNext() 場所 Microsoft.SemanticKernel.Plugins.Web.Bing.BingTextSearch.d__2.MoveNext() 場所 Microsoft.SemanticKernel.Data.TextSearchExtensions.<>c__DisplayClass4_0.<g__GetTextSearchResultAsync|0>d.MoveNext() 場所 Microsoft.SemanticKernel.KernelFunctionFromMethod.<>c__DisplayClass17_0.<b__11>d.MoveNext() 場所 System.Threading.Tasks.ValueTask`1.get_Result() 場所 Microsoft.SemanticKernel.KernelFunction.<>c__DisplayClass21_0.<b__0>d.MoveNext() 場所 Microsoft.SemanticKernel.Kernel.d__34.MoveNext() 場所 Microsoft.SemanticKernel.Kernel.d__33.MoveNext() 場所 Microsoft.SemanticKernel.KernelFunction.d__21.MoveNext() 場所 Microsoft.SemanticKernel.Connectors.FunctionCalling.FunctionCallsProcessor.<>c__DisplayClass6_1.<b__1>d.MoveNext() 場所 Microsoft.SemanticKernel.Connectors.FunctionCalling.FunctionCallsProcessor.d__9.MoveNext() 場所 AOAI.AutoFunctionExceptionHandlingFilter.d__1.MoveNext() (D:\sandbox\AOAI\Program.cs):行 72

To Reproduce Steps to reproduce the behavior:

    internal class Program
    {
        static async Task Main(string[] args)
        {
            IKernelBuilder builder = Kernel.CreateBuilder()
                .AddAzureOpenAIChatCompletion(
                );
            builder.Services.AddSingleton<IAutoFunctionInvocationFilter, AutoFunctionExceptionHandlingFilter>();
            var kernel = builder.Build();

            // Create a search service with Bing search
            var textSearch = new BingTextSearch(new("key"));
            // Build a text search plugin with Bing search and add to the kernel
            var searchPlugin = textSearch.CreateWithGetTextSearchResults("SearchPlugin");
            kernel.Plugins.Add(searchPlugin);

            // Invoke prompt and use text search plugin to provide grounding information
            OpenAIPromptExecutionSettings settings = new() { ToolCallBehavior = ToolCallBehavior.AutoInvokeKernelFunctions };
            KernelArguments arguments = new(settings);
            Console.WriteLine(await kernel.InvokePromptAsync("What is the Semantic Kernel? Include citations to the relevant information where it is referenced in the response.", arguments));
        }
    }
    internal sealed class AutoFunctionExceptionHandlingFilter() : IAutoFunctionInvocationFilter
    {
        public async Task OnAutoFunctionInvocationAsync(AutoFunctionInvocationContext context, Func<AutoFunctionInvocationContext, Task> next)
        {
            try
            {
                await next(context);
            }
            catch (Exception exception)
            {
                Console.Write(exception.Message);
                throw;
            }
        }
    }

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Platform

  • OS:Windows
  • IDE: Visual Studio
  • Language: C#
  • Source: NuGet package version 1.24.0

Additional context Adding Microsoft.Extensions.VectorData.Abstractions -Version 9.0.0-preview.1.24515.1 still causes an exception.

aeras3637 avatar Oct 18 '24 06:10 aeras3637

Any updates on this, get the same issue now :(

dflyingliu avatar Oct 18 '24 07:10 dflyingliu

@dflyingliu @aeras3637 We are working on it and will create another release soon.

dmytrostruk avatar Oct 18 '24 14:10 dmytrostruk

@dflyingliu @aeras3637 please switch https://www.nuget.org/packages/Microsoft.SemanticKernel/1.24.1

markwallace-microsoft avatar Oct 18 '24 16:10 markwallace-microsoft