Share via


AIAgent.GetNewThread Method

Definition

Creates a new conversation thread that is compatible with this agent.

public abstract Microsoft.Agents.AI.AgentThread GetNewThread();
abstract member GetNewThread : unit -> Microsoft.Agents.AI.AgentThread
Public MustOverride Function GetNewThread () As AgentThread

Returns

A new AgentThread instance ready for use with this agent.

Remarks

This method creates a fresh conversation thread that can be used to maintain state and context for interactions with this agent. Each thread represents an independent conversation session.

If the agent supports multiple thread types, this method returns the default or configured thread type. For service-backed agents, the actual thread creation may be deferred until first use to optimize performance.

Applies to