Skip to content

.Net: Bug: Microsoft.SemanticKernel.Connectors.SqlServer Method not found: 'Void Microsoft.Extensions.VectorData.ProviderServices.PropertyModel.SetValue(System.Object, !!0)'. #12451

Closed
@idlemind

Description

@idlemind

Describe the bug
Exception Method not found: 'Void Microsoft.Extensions.VectorData.ProviderServices.PropertyModel.SetValue(System.Object, !!0)'. when executing await foreach (TextSearchResult result in textResults.Results)

Message:
Method not found: 'Void Microsoft.Extensions.VectorData.ProviderServices.PropertyModel.SetValue(System.Object, !!0)'.

Source:
Microsoft.SemanticKernel.Connectors.SqlServer

Stak Trace:
at Microsoft.SemanticKernel.Connectors.SqlServer.SqlServerMapper1.<MapFromStorageToDataModel>g__PopulateValue|2_0(SqlDataReader reader, PropertyModel property, Object record) at Microsoft.SemanticKernel.Connectors.SqlServer.SqlServerMapper1.MapFromStorageToDataModel(SqlDataReader reader, Boolean includeVectors)
at Microsoft.SemanticKernel.Connectors.SqlServer.SqlServerCollection2.<ReadVectorSearchResultsAsync>d__23.MoveNext() at Microsoft.SemanticKernel.Connectors.SqlServer.SqlServerCollection2.d__23.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
at Microsoft.SemanticKernel.Connectors.SqlServer.SqlServerCollection2.<SearchAsync>d__211.MoveNext()
at Microsoft.SemanticKernel.Connectors.SqlServer.SqlServerCollection2.<SearchAsync>d__211.MoveNext()
at Microsoft.SemanticKernel.Connectors.SqlServer.SqlServerCollection2.<SearchAsync>d__211.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
at Microsoft.SemanticKernel.Data.VectorStoreTextSearch1.<ExecuteVectorSearchAsync>d__16.MoveNext() at Microsoft.SemanticKernel.Data.VectorStoreTextSearch1.d__16.MoveNext()
at Microsoft.SemanticKernel.Data.VectorStoreTextSearch1.<ExecuteVectorSearchAsync>d__16.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token) at Microsoft.SemanticKernel.Data.VectorStoreTextSearch1.d__18.MoveNext()
at Microsoft.SemanticKernel.Data.VectorStoreTextSearch1.<GetResultsAsTextSearchResultAsync>d__18.MoveNext() at Microsoft.SemanticKernel.Data.VectorStoreTextSearch1.d__18.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)

To Reproduce
Steps to reproduce the behavior:

  1. Builder kernel with IEmbeddingGenerator AsIEmbeddingGenerator()
  2. Add AddSqlServerCollection
  3. Build the collection
  4. Search the collection using new VectorStoreTextSearch(vectorStoreCollection);
  5. KernelSearchResults textResults = await textSearch.GetTextSearchResultsAsync(query, new() { Top = 5, Skip = 0 });
  6. Exception caught here:

try
{
await foreach (TextSearchResult result in textResults.Results)
{
memoryBuilder.AppendLine(result.Value);
}
}
catch (Exception ex)
{
throw;
}

Expected behavior
TextSearchResult returns search results for the created collection

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

Platform

  • Language: C#
  • Source: Microsoft.Extensions.VectorData.Abstractions 9.5.0, Microsoft.SemanticKernel 1.56.0, Microsoft.SemanticKernel.Connectors.SqlServer 1.56.0-preview
  • AI model: text-embedding-ada-002
  • IDE: Visual Studio
  • OS: Windows

Additional context
I have created a console app here (https://github.com/idlemind/RAGTest).

The solution uses AzureOpenAIEmbeddings text-embedding-ada-002

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codebugSomething isn't working

Type

Projects

Status

Sprint: Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions