Partager via


SqlServerMemoryStore.GetBatchAsync Method

Definition

Gets a batch of memory records from the data store. Does not guarantee that the collection exists.

public System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.Memory.MemoryRecord> GetBatchAsync (string collectionName, System.Collections.Generic.IEnumerable<string> keys, bool withEmbeddings = false, System.Threading.CancellationToken cancellationToken = default);
abstract member GetBatchAsync : string * seq<string> * bool * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.Memory.MemoryRecord>
override this.GetBatchAsync : string * seq<string> * bool * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.Memory.MemoryRecord>
Public Function GetBatchAsync (collectionName As String, keys As IEnumerable(Of String), Optional withEmbeddings As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of MemoryRecord)

Parameters

collectionName
String

The name associated with a collection of embedding.

keys
IEnumerable<String>

The unique ids associated with the memory record to get.

withEmbeddings
Boolean

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

cancellationToken
CancellationToken

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

Returns

The memory records associated with the unique keys provided.

Implements

Applies to