Partager via


IPineconeClient.GetMostRelevantAsync Method

Definition

Find the nearest vectors in a collection using vector similarity search.

public System.Collections.Generic.IAsyncEnumerable<(Microsoft.SemanticKernel.Connectors.Pinecone.PineconeDocument, double)> GetMostRelevantAsync (string indexName, ReadOnlyMemory<float> vector, double threshold, int topK, bool includeValues, bool includeMetadata, string indexNamespace = "", System.Collections.Generic.Dictionary<string,object>? filter = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetMostRelevantAsync : string * ReadOnlyMemory<single> * double * int * bool * bool * string * System.Collections.Generic.Dictionary<string, obj> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<ValueTuple<Microsoft.SemanticKernel.Connectors.Pinecone.PineconeDocument, double>>
Public Function GetMostRelevantAsync (indexName As String, vector As ReadOnlyMemory(Of Single), threshold As Double, topK As Integer, includeValues As Boolean, includeMetadata As Boolean, Optional indexNamespace As String = "", Optional filter As Dictionary(Of String, Object) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ValueTuple(Of PineconeDocument, Double))

Parameters

indexName
String

the name of the index

vector
ReadOnlyMemory<Single>

The vector to compare the collection's vectors with.

threshold
Double

The minimum relevance threshold for returned results.

topK
Int32

The maximum number of similarity results to return.

includeValues
Boolean

Whether to include the vector values

includeMetadata
Boolean

Whether to include the metadata

indexNamespace
String

The name assigned to a collection of vectors.

filter
Dictionary<String,Object>

A filter to apply to the results

cancellationToken
CancellationToken

Cancellation token.

Returns

Applies to