Partager via


AzureAISearchVectorStoreRecordCollection<TRecord>.GetBatchAsync Method

Definition

Gets a batch of records from the vector store. Does not guarantee that the collection exists. Gets will be made in a single request or in a single parallel batch depending on the available store functionality. Only found records will be returned, so the resultset may be smaller than the requested keys. Throws for any issues other than records not being found.

public System.Collections.Generic.IAsyncEnumerable<TRecord> GetBatchAsync (System.Collections.Generic.IEnumerable<string> keys, Microsoft.SemanticKernel.Data.GetRecordOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetBatchAsync : seq<string> * Microsoft.SemanticKernel.Data.GetRecordOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Record (requires 'Record : null)>
override this.GetBatchAsync : seq<string> * Microsoft.SemanticKernel.Data.GetRecordOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Record (requires 'Record : null)>
Public Function GetBatchAsync (keys As IEnumerable(Of String), Optional options As GetRecordOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TRecord)

Parameters

keys
IEnumerable<String>

The unique ids associated with the record to get.

options
GetRecordOptions

Optional options for retrieving the records.

cancellationToken
CancellationToken

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

Returns

IAsyncEnumerable<TRecord>

The records associated with the unique keys provided.

Implements

Applies to