One question agent
Ask once
Three lines: create an Agent with instructions, send one question, print the reply.
Press Try it Yourself to run a small example in the browser sandbox. On your machine, set OPENAI_API_KEY first.
Example
from praisonai import Agent
agent = Agent(instructions="You are a helpful assistant.")
print(agent.start("In one sentence, what is a token?"))Example explained
- instructions — Tells the model how to behave.
- start — Your question for this run.
Name it and tighten the shape
Production agents get a name and stricter output rules. Run this sample, then change the question to something you care about.
If the reply breaks the format, strengthen instructions before changing the model.
Example
from praisonai import Agent
agent = Agent(
name="BasicsCoach",
instructions="Teach in exactly two sentences. No bullet points.",
)
print(agent.start("What should I learn right after this track?"))Example explained
- name — Helps logs and multi-agent flows later.
- instructions — Format rules reduce vague or over-long replies.
Reference: documentation