from agentflow import AgentFlowwith AgentFlow.from_profile("prod") as client: agent_id = client.agents.by_name("MainAgent").id response = client.agents.run(agent_id=agent_id, message="What meetings do I have this week?") print(response.text)
The public PyPI package named agentflow is not the private AgentFlow SDK
unless your organization has published it there. Use your onboarding package
source, private package index, or internal wheel.
For local backend development, run agentflow login --method dev --endpoint http://localhost:8001 --profile local after starting the stack with
DEV_AUTH_BYPASS=true.The orchestrator automatically delegates your request to the right sub-agent - in this case, MeetingsAgent - which uses its calendar tools to fetch and return your schedule.
For real-time UIs, stream typed events as they arrive:
import asynciofrom agentflow import AsyncAgentFlowfrom agentflow.events import TextDeltaasync def main(): async with AsyncAgentFlow.from_profile("prod") as client: agent_id = (await client.agents.by_name("MainAgent")).id async for event in client.agents.stream( agent_id=agent_id, message="Draft an email to the Acme team about the Q3 review", ): if isinstance(event, TextDelta): print(event.text, end="", flush=True)asyncio.run(main())
id: 0data: {"type":"start","call_id":"call_1","content":{"name":"MainAgent"},"seq":0}id: 1data: {"type":"delta","call_id":"call_1","content":"Let me research that...","seq":1}id: 12data: {"type":"end","call_id":"call_1","seq":12}