Partager via


RedisMemoryStore.UpsertAsync(String, MemoryRecord, CancellationToken) Method

Definition

Upserts a memory record into the data store. Does not guarantee that the collection exists. If the record already exists, it will be updated. If the record does not exist, it will be created.

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

Parameters

collectionName
String

The name associated with a collection of embeddings.

record
MemoryRecord

The memory record to upsert.

cancellationToken
CancellationToken

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

Returns

The unique identifier for the memory record.

Implements

Applies to