Share via


IPineconeMemoryStore.GetNearestMatchesFromNamespaceAsync Method

Definition

Gets the nearest matches to an embedding of type Single from the given namespace.

public System.Collections.Generic.IAsyncEnumerable<(Microsoft.SemanticKernel.Memory.MemoryRecord, double)> GetNearestMatchesFromNamespaceAsync (string indexName, string indexNamespace, ReadOnlyMemory<float> embedding, int limit, double minRelevanceScore = 0, bool withEmbeddings = false, System.Threading.CancellationToken cancellationToken = default);
abstract member GetNearestMatchesFromNamespaceAsync : string * string * ReadOnlyMemory<single> * int * double * bool * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<ValueTuple<Microsoft.SemanticKernel.Memory.MemoryRecord, double>>
Public Function GetNearestMatchesFromNamespaceAsync (indexName As String, indexNamespace As String, embedding As ReadOnlyMemory(Of Single), limit As Integer, Optional minRelevanceScore As Double = 0, Optional withEmbeddings As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ValueTuple(Of MemoryRecord, Double))

Parameters

indexName
String

The name associated with a collection of embeddings.

indexNamespace
String

The namespace associated with a collection of embeddings.

embedding
ReadOnlyMemory<Single>

The embedding to compare the collection's embeddings with.

limit
Int32

The maximum number of similarity results to return.

minRelevanceScore
Double

The minimum relevance threshold for returned results.

withEmbeddings
Boolean

If true, the embeddings will be returned in the memory records.

cancellationToken
CancellationToken

Cancellation token.

Returns

A group of tuples where item1 is a MemoryRecord and item2 is its similarity score as a Double.

Applies to