Two steps

Writer, then editor

AgentFlow runs the steps in order. The second step receives what the first one produced.

steps is the list. start sends the first prompt. The editor sees the writer’s draft. The result prints each step, then its answer.

Example

from praisonai import Agent, AgentFlow

writer = Agent(name="Writer", instructions="Write two sentences on the input.")
editor = Agent(name="Editor", instructions="Shorten the draft to one sentence.")
flow = AgentFlow(steps=[writer, editor])
result = flow.start("Write about AI agents")
for step in result["steps"]:
    print(step["step"])
    print(step["output"])
    print()

Try it Yourself

Example explained

  • steps — The agents, in the order they should run.
  • start — The prompt for the first step.

Reference: documentation