Share via


AgentThreadStore.GetThreadAsync(AIAgent, String, CancellationToken) Method

Definition

Retrieves a serialized agent thread from persistent storage.

public abstract System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.AgentThread> GetThreadAsync(Microsoft.Agents.AI.AIAgent agent, string conversationId, System.Threading.CancellationToken cancellationToken = default);
abstract member GetThreadAsync : Microsoft.Agents.AI.AIAgent * string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.AgentThread>
Public MustOverride Function GetThreadAsync (agent As AIAgent, conversationId As String, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of AgentThread)

Parameters

agent
AIAgent

The agent that owns this thread.

conversationId
String

The unique identifier for the conversation/thread to retrieve.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests.

Returns

A task that represents the asynchronous retrieval operation. The task result contains the serialized thread state, or null if not found.

Applies to