Your first agent
Create and start
Three lines create an agent and give it one task.
instructions sets who the agent is. start sends the task, which is the user prompt.
Example
from praisonai import Agent
agent = Agent(instructions="You are a helpful assistant")
print(agent.start("Hello! What can you help me with?"))Example explained
- instructions — The system prompt.
- start — The user prompt, and the call that runs the agent.
Tighten instructions
Change the task so the reply must be exactly five words. Re-run until the model obeys — this is prompt iteration, not a new API.
Example
from praisonai import Agent
agent = Agent(
name="First",
instructions="Reply in exactly five words. No punctuation at the end.",
)
print(agent.start("Introduce yourself to a new developer."))Example explained
- from praisonai import Agent — Imports Agent needed for tighten instructions.
- Agent(…) — Instantiates the Agent configured for tighten instructions.
- .start(…) — Executes the configured run for tighten instructions and returns the result.
Reference: documentation