microsoft / semantic-kernel

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

.Net: Where is IVectorSearch? #9280

Open lilhoser opened 1 day ago

lilhoser commented 1 day ago

This page states:

The VectorizedSearchAsync method allows searching using data that has already been vectorized.

This method takes a vector and an optional VectorSearchOptions class as input. This method is available on the following interfaces:

IVectorizedSearch<TRecord>
IVectorStoreRecordCollection<TKey, TRecord>
Note that IVectorStoreRecordCollection<TKey, TRecord> inherits from IVectorizedSearch<TRecord>.

And this unit test confirms that by grabbing IVectorSearch off the collection interface:

var collection = kernel.Services.GetRequiredService<IVectorStoreRecordCollection<ulong, TestRecord>>();
Assert.NotNull(collection);
Assert.IsType<QdrantVectorStoreRecordCollection<TestRecord>>(collection);
var vectorizedSearch = kernel.Services.GetRequiredService<IVectorizedSearch<TestRecord>>();

However, I'm using Microsoft.SemanticKernel.Connectors.Qdrant version 1.22.0-alpha and the reference is not resolved:

Image

And the source does not show IVectorStoreRecordCollection inheriting from IVectorizedSearch:

[Experimental("SKEXP0001")]
#pragma warning disable CA1711 // Identifiers should not have incorrect suffix
public interface IVectorStoreRecordCollection<TKey, TRecord>
#pragma warning restore CA1711 // Identifiers should not have incorrect suffix
    where TKey : notnull
    where TRecord : class
{
lilhoser commented 1 day ago

Dupe of https://github.com/microsoft/semantic-kernel/issues/9141

Not sure why docs are released before the code is ready.