HandoffWorkflowBuilderCore<TBuilder>.WithHandoff Method

Definition

Adds a handoff relationship from a source agent to a target agent with a custom handoff reason.

public TBuilder WithHandoff(Microsoft.Agents.AI.AIAgent from, Microsoft.Agents.AI.AIAgent to, string? handoffReason = default);
member this.WithHandoff : Microsoft.Agents.AI.AIAgent * Microsoft.Agents.AI.AIAgent * string -> 'Builder
Public Function WithHandoff (from As AIAgent, to As AIAgent, Optional handoffReason As String = Nothing) As TBuilder

Parameters

from
AIAgent

The source agent.

to
AIAgent

The target agent.

handoffReason
String

The reason the from should hand off to the to. If null, the reason is derived from to's description or name.

Returns

TBuilder

The updated HandoffsWorkflowBuilder instance.

Applies to