IPineconeMemoryStore.GetNearestMatchFromNamespaceAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the nearest match to an embedding of type Single from the given namespace.
public System.Threading.Tasks.Task<(Microsoft.SemanticKernel.Memory.MemoryRecord, double)?> GetNearestMatchFromNamespaceAsync (string indexName, string indexNamespace, ReadOnlyMemory<float> embedding, double minRelevanceScore = 0, bool withEmbedding = false, System.Threading.CancellationToken cancellationToken = default);
abstract member GetNearestMatchFromNamespaceAsync : string * string * ReadOnlyMemory<single> * double * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Nullable<ValueTuple<Microsoft.SemanticKernel.Memory.MemoryRecord, double>>>
Public Function GetNearestMatchFromNamespaceAsync (indexName As String, indexNamespace As String, embedding As ReadOnlyMemory(Of Single), Optional minRelevanceScore As Double = 0, Optional withEmbedding As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Nullable(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.
- minRelevanceScore
- Double
The minimum relevance threshold for returned results.
- withEmbedding
- Boolean
If true, the embedding will be returned in the memory record.
- cancellationToken
- CancellationToken
Cancellation token
Returns
A tuple consisting of the MemoryRecord and the similarity score as a Double. Null if no nearest match found.