Share via


IChromaClient.QueryEmbeddingsAsync Method

Definition

Searches nearest embeddings by distance in specified collection.

public System.Threading.Tasks.Task<Microsoft.SemanticKernel.Connectors.Chroma.ChromaQueryResultModel> QueryEmbeddingsAsync (string collectionId, ReadOnlyMemory<float>[] queryEmbeddings, int nResults, string[]? include = default, System.Threading.CancellationToken cancellationToken = default);
abstract member QueryEmbeddingsAsync : string * ReadOnlyMemory<single>[] * int * string[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.Connectors.Chroma.ChromaQueryResultModel>
Public Function QueryEmbeddingsAsync (collectionId As String, queryEmbeddings As ReadOnlyMemory(Of Single)(), nResults As Integer, Optional include As String() = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChromaQueryResultModel)

Parameters

collectionId
String

Collection identifier generated by Chroma.

queryEmbeddings
ReadOnlyMemory<Single>[]

Embeddings to search for.

nResults
Int32

Number of results to return.

include
String[]

Array of entities to include in response (e.g. "embeddings", "metadatas" "documents"). For more information see: https://github.com/chroma-core/chroma/blob/main/chromadb/api/types.py

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

Instance of ChromaQueryResultModel model.

Applies to