HandoffWorkflowBuilderCore<TBuilder> Class

Definition

Provides a builder for specifying the handoff relationships between agents and building the resulting workflow.

public class HandoffWorkflowBuilderCore<TBuilder> : Microsoft.Agents.AI.Workflows.OrchestrationBuilderBase<TBuilder> where TBuilder : HandoffWorkflowBuilderCore<TBuilder>
type HandoffWorkflowBuilderCore<'Builder (requires 'Builder :> HandoffWorkflowBuilderCore<'Builder>)> = class
    inherit OrchestrationBuilderBase<'Builder (requires 'Builder :> HandoffWorkflowBuilderCore<'Builder>)>
Public Class HandoffWorkflowBuilderCore(Of TBuilder)
Inherits OrchestrationBuilderBase(Of TBuilder)

Type Parameters

TBuilder
Inheritance
HandoffWorkflowBuilderCore<TBuilder>
Derived

Fields

Name Description
FunctionPrefix

The prefix for function calls that trigger handoffs to other agents; the full name is then {FunctionPrefix}&lt;agent_id&gt;, where &lt;agent_id&gt; is the ID of the target agent to hand off to.

Properties

Name Description
Description

Optional workflow description; applied to the inner WorkflowBuilder at Build().

(Inherited from OrchestrationBuilderBase<TBuilder>)
HandoffInstructions

Gets or sets additional instructions to provide to an agent that has handoffs about how and when to perform them.

Name

Optional workflow name; applied to the inner WorkflowBuilder at Build().

(Inherited from OrchestrationBuilderBase<TBuilder>)
OutputDesignations

Memoized output designations. null means the user has not made any explicit designation, and the orchestration-specific defaults will be applied at Build() time. A non-null (possibly empty) map means the user took control and only these designations will be replayed onto the inner WorkflowBuilder. An entry's value is the set of tags requested for the agent — an empty set encodes a terminal-only designation.

(Inherited from OrchestrationBuilderBase<TBuilder>)

Methods

Name Description
AddParticipants(IEnumerable<AIAgent>)

Adds the specified agents as participants in the handoff workflow without defining handoff relationships for them.

ApplyMetadata(WorkflowBuilder)

Applies the optional Name and Description to builder. Subclasses should call this from their Build() implementation.

(Inherited from OrchestrationBuilderBase<TBuilder>)
ApplyOutputDesignations(WorkflowBuilder, IReadOnlyDictionary<AIAgent,ExecutorBinding>, String, Action)

Applies the user's memoized output designations to builder, or invokes applyDefaults if the user made no explicit designation.

(Inherited from OrchestrationBuilderBase<TBuilder>)
Build()

Builds a Workflow composed of agents that operate via handoffs, with the next agent to process messages selected by the current agent.

EmitAgentResponseEvents(Boolean)

Sets a value indicating whether aggregated agent response events should be emitted during execution.

EmitAgentResponseUpdateEvents(Boolean)

Sets a value indicating whether agent streaming update events should be emitted during execution. If null, the value will be taken from the TurnToken

EnableReturnToPrevious()

Configures the workflow so that subsequent user turns route directly back to the specialist agent that handled the previous turn, rather than always routing through the initial (coordinator) agent.

WithAutonomousMode(Nullable<Int32>, String, IEnumerable<AIAgent>, IReadOnlyDictionary<AIAgent,Int32>, IReadOnlyDictionary<AIAgent,String>)

Enables autonomous mode for the handoff workflow.

WithDescription(String)

Sets the description for the workflow.

(Inherited from OrchestrationBuilderBase<TBuilder>)
WithHandoff(AIAgent, AIAgent, String)

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

WithHandoffInstructions(String)

Sets instructions to provide to each agent that has handoffs about how and when to perform them.

WithHandoffs(AIAgent, IEnumerable<AIAgent>)

Adds handoff relationships from a source agent to one or more target agents.

WithHandoffs(IEnumerable<AIAgent>, AIAgent, String)

Adds handoff relationships from one or more sources agent to a target agent.

WithIntermediateOutputFrom(IEnumerable<AIAgent>)

Designates the given agents as sources of intermediate workflow output. See WithOutputFrom(IEnumerable<AIAgent>) for the defaults-suppression semantics.

(Inherited from OrchestrationBuilderBase<TBuilder>)
WithName(String)

Sets the human-readable name for the workflow.

(Inherited from OrchestrationBuilderBase<TBuilder>)
WithOutputFrom(IEnumerable<AIAgent>)

Designates the given agents as sources of terminal workflow output. Calling any output-designation method (this or WithIntermediateOutputFrom(IEnumerable<AIAgent>)) suppresses the orchestration-specific defaults: only the user-specified designations reach the inner WorkflowBuilder.

(Inherited from OrchestrationBuilderBase<TBuilder>)
WithTerminationCondition(Func<IReadOnlyList<ChatMessage>,Boolean>)

Sets a synchronous termination condition for the handoff workflow.

WithTerminationCondition(Func<IReadOnlyList<ChatMessage>,ValueTask<Boolean>>)

Sets an asynchronous termination condition for the handoff workflow.

WithToolCallFilteringBehavior(HandoffToolCallFilteringBehavior)

Sets the behavior for filtering FunctionCallContent and Tool contents from ChatMessages flowing through the handoff workflow. Defaults to HandoffOnly.

Applies to