Partager via


RedisMemoryStore.GetAsync(String, String, Boolean, CancellationToken) Method

Definition

Gets a memory record from the data store. Does not guarantee that the collection exists.

public System.Threading.Tasks.Task<Microsoft.SemanticKernel.Memory.MemoryRecord?> GetAsync (string collectionName, string key, bool withEmbedding = false, System.Threading.CancellationToken cancellationToken = default);
abstract member GetAsync : string * string * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.Memory.MemoryRecord>
override this.GetAsync : string * string * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.Memory.MemoryRecord>
Public Function GetAsync (collectionName As String, key As String, Optional withEmbedding As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task(Of MemoryRecord)

Parameters

collectionName
String

The name associated with a collection of embeddings.

key
String

The unique id associated with the memory record to get.

withEmbedding
Boolean

If true, the embedding will be returned in the memory record.

cancellationToken
CancellationToken

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

Returns

The memory record if found, otherwise null.

Implements

Applies to