AgentWorkflowBuilder.CreateHandoffBuilderWith(AIAgent) Method

Definition

Creates a new HandoffWorkflowBuilder using initialAgent as the starting agent in the workflow.

public static Microsoft.Agents.AI.Workflows.HandoffWorkflowBuilder CreateHandoffBuilderWith(Microsoft.Agents.AI.AIAgent initialAgent);
static member CreateHandoffBuilderWith : Microsoft.Agents.AI.AIAgent -> Microsoft.Agents.AI.Workflows.HandoffWorkflowBuilder
Public Shared Function CreateHandoffBuilderWith (initialAgent As AIAgent) As HandoffWorkflowBuilder

Parameters

initialAgent
AIAgent

The agent that will receive inputs provided to the workflow.

Returns

The builder for creating a workflow based on handoffs.

Remarks

Handoffs between agents are achieved by the current agent invoking an AITool provided to an agent via ChatClientAgentOptions's ChatOptions.Tools. The AIAgent must be capable of understanding those AgentRunOptions provided. If the agent ignores the tools or is otherwise unable to advertize them to the underlying provider, handoffs will not occur.

Applies to