Share via


PostgresDbClient.ReadBatchAsync Method

Definition

Read multiple entries by their keys.

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

Parameters

tableName
String

The name assigned to a table of entries.

keys
IEnumerable<String>

The keys of the entries to read.

withEmbeddings
Boolean

If true, the embeddings will be returned in the entries.

cancellationToken
CancellationToken

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

Returns

An asynchronous stream of PostgresMemoryEntry objects that match the given keys.

Implements

Applies to