AgentFlow
A flow is an ordered list of steps. A step can be an agent, a route, a parallel group, or a loop.
You already know Agent. This course connects agents so the result of one step is the input of the next.
Two agents, one scene
The first reply is two words. The second reply is one sentence that paints those same words at dusk. The painter is not told the harbour. It only sees what the spotter wrote.
Example
from praisonai import Agent, AgentFlow
spotter = Agent(name="Spotter", instructions="Name one object in the scene, in two words, nothing else.")
painter = Agent(name="Painter", instructions="Write one sentence that paints that object at dusk.")
flow = AgentFlow(steps=[spotter, painter])
result = flow.start("a quiet harbour")
for step in result["steps"]:
print(step["step"])
print(step["output"])
print()Example explained
- steps — Spotter runs first. Painter receives that reply.
- start — The scene. Only the spotter is given it.