Serve the file

Note: Use the agents.yaml you validated in the YAML course. Stop server.py first so port 8000 is free.

Warm up with start

serve agents reads YAML on your machine. First confirm the agent instruction style in Try it Yourself.

Example

from praisonai import Agent

agent = Agent(
    name="writer",
    instructions="Write in two lines about rain.",
)
print(agent.start("Write two lines about rain."))

Try it Yourself

No Python needed

praisonai serve agents loads agents.yaml and starts the same kind of server you built with launch.

Change the file, stop the server with Ctrl+C, and start it again to pick up the change.

Example

praisonai serve agents --file agents.yaml --port 8000

Call every agent, or one

POST to /agents runs the agents in the file. Add a name to the path to reach one agent.

Example

curl -X POST http://127.0.0.1:8000/agents \
  -H "Content-Type: application/json" \
  -d '{"query": "Write two lines about rain"}'

Example explained

  • /agents — Runs the agents defined in agents.yaml.
  • /agents/writer — Runs only the agent named writer.

Reference: documentation