System.TypeLoadException: 'Could not load type 'Microsoft.SemanticKernel.Http.HttpOperationException

71 Views Asked by At

I am getting the following error

System.TypeLoadException: Could not load type 'Microsoft.SemanticKernel.Http.HttpOperationException' from assembly 'Microsoft.SemanticKernel.Abstractions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3

when I call SearchAsync method of Microsoft.SemanticKernel.Memory.ISemanticTextMemory.

The SearchAsync method is called in native plugin code.

The method signature is:

/// <summary>
/// Find some information in memory
/// </summary>
/// <param name="collection">Collection to search</param>
/// <param name="query">What to search for</param>
/// <param name="limit">How many results to return</param>
/// <param name="minRelevanceScore">Minimum relevance score, from 0 to 1, where 1 means exact match.</param>
/// <param name="withEmbeddings">Whether to return the embeddings of the memories found.</param>
/// <param name="kernel">The <see cref="Kernel"/> containing services, plugins, and other state for use throughout the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>Memories found</returns>
public IAsyncEnumerable<MemoryQueryResult> SearchAsync(
    string collection,
    string query,
    int limit = 1,
    double minRelevanceScore = 0.7,
    bool withEmbeddings = false,
    Kernel? kernel = null,
    CancellationToken cancellationToken = default);

Please note that I installed "Microsoft.SemanticKernel.Abstractions" version 1.1.0....

Any suggestions to resolve this issue?

Fix for the error:

System.TypeLoadException: 'Could not load type 'Microsoft.SemanticKernel.Http.HttpOperationException' from assembly 'Microsoft.SemanticKernel.Abstractions, Version=1.1.0.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3'
0

There are 0 best solutions below