Praison AI
Platform
Use Cases
Bot
Partners
Community
University
Docs
Get Started
Route
Run
from praisonai import Agent, AgentFlow, route def label(ctx): text = ctx.input.lower() if "python" in text or "function" in text: return "technical" return "general" tech = Agent(name="TechExpert", instructions="Answer technical questions in one sentence.") general = Agent(name="GeneralAssistant", instructions="Answer in one sentence.") flow = AgentFlow(steps=[ label, route({"technical": [tech], "default": [general]}), ]) result = flow.start("How does a Python function work?") for step in result["steps"]: print(step["step"]) print(step["output"]) print()
Press Run. The result appears here.