Skip to content

ToolCalled

autogen.beta.network.transitions.ToolCalled dataclass #

ToolCalled(tool_name)

Fires when the just-accepted envelope's routing tool matches.

For EV_PACKET envelopes (the standard packet-model path), reads event_data["routing"]["tool"]. The packet's routing field is populated by the framework from the agent's local-stream ToolCallEvent whose name matches a registered routing tool.

tool_name instance-attribute #

tool_name

name class-attribute #

name = 'tool_called'

evaluate #

evaluate(state, envelope)
Source code in autogen/beta/network/transitions.py
def evaluate(self, state: "WorkflowState", envelope: Envelope) -> bool:
    if envelope.event_type != EV_PACKET:
        return False
    routing = envelope.event_data.get("routing", {}) or {}
    return routing.get("tool") == self.tool_name