Skip to content

Handoff

autogen.beta.network.handoff.Handoff dataclass #

Handoff(target, reason='')

Routing intent returned by a tool that picks its target dynamically.

Example::

from autogen.beta.network import Handoff


@coord_agent.tool
def smart_route(query: str) -> Handoff:
    target = pick_best_specialist(query)
    return Handoff(target=target, reason="routed by load")

The framework reads this from ToolResultEvent.result after Agent.ask returns and uses target (resolved as a Passport.name) plus reason as the active packet's routing field.

target instance-attribute #

target

reason class-attribute instance-attribute #

reason = ''