Pathways.agent()
Assign an agent to the current state.
Usage
Pathways.agent(agent_name)When a state has an agent, that agent handles all interactions while the pathway is in that state. This enables multi-agent workflows where different states are served by different specialized agents.
Parameters
agent_name: str- Name of the agent to handle this state. Register the agent via register_agent() before running the pathway.
Returns
Pathways- Self for method chaining.
Examples
import talk_box as tb
pathway = (
tb.Pathways(title="Support", desc="Multi-agent support")
.state("triage: classify the issue")
.agent("triage_bot")
.branch_on("technical", id="tech")
.state("tech: resolve technical issues")
.agent("tech_expert")
)