Share via


InMemoryAgentThreadStore.SaveThreadAsync Method

Definition

Saves a serialized agent thread to persistent storage.

public override System.Threading.Tasks.ValueTask SaveThreadAsync(Microsoft.Agents.AI.AIAgent agent, string conversationId, Microsoft.Agents.AI.AgentThread thread, System.Threading.CancellationToken cancellationToken = default);
override this.SaveThreadAsync : Microsoft.Agents.AI.AIAgent * string * Microsoft.Agents.AI.AgentThread * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Overrides Function SaveThreadAsync (agent As AIAgent, conversationId As String, thread As AgentThread, Optional cancellationToken As CancellationToken = Nothing) As ValueTask

Parameters

agent
AIAgent

The agent that owns this thread.

conversationId
String

The unique identifier for the conversation/thread.

thread
AgentThread

The thread to save.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests.

Returns

A task that represents the asynchronous save operation.

Applies to