How It Works
Quick Start
1
Simple Usage
Pass
output as a string preset:2
With Configuration
Use
OutputConfig for fine-grained control:Which Style Should I Use?
Pick a preset based on where the output is consumed.How It Works
Configuration Options
OutputConfig SDK Reference
Full parameter reference for OutputConfig
Mutual Exclusion of Console Output Modes
Three modes —editor_output, status_trace, and actions_trace — register callbacks on a process-wide registry, not on the individual Agent. Only one can be active at a time in a given Python process, no matter how many Agents you construct.
First mode wins. If an earlier Agent already enabled a mode, a later Agent asking for a different one silently keeps the earlier mode’s routing. This stops an Agent-B trace construction from clobbering the callbacks Agent-A wired for editor — which would otherwise route Agent-A’s events through Agent-B’s sink with the wrong formatting and redaction.
The check-and-enable runs under a per-process lock, so concurrently-constructed Agents cannot both observe “no mode active” and race each other. The silent path (no output mode requested) stays lock-free — the lock is acquired only when a mode is actually requested.
String Preset Aliases
Common Patterns
Silent (SDK Default)
Status (CLI / Interactive)
Save Response to File
Best Practices
Use silent mode for production APIs
Use silent mode for production APIs
Silent mode (the default) has zero output overhead. Use it when the agent’s return value is consumed by code rather than displayed to users.
Use editor mode for beginner-facing CLIs
Use editor mode for beginner-facing CLIs
output="editor" shows human-friendly numbered steps with emoji icons. It is the default when running praisonai "prompt" from the command line.Use stream mode for chat interfaces
Use stream mode for chat interfaces
Set
output="stream" when building conversational UIs — tokens appear in real time for a responsive feel.Use output_file to persist long-form responses
Use output_file to persist long-form responses
Set
output=OutputConfig(output_file="result.md") to automatically save the agent’s response. Useful for reports, summaries, and generated documents.Set the console mode once at the entry point
Set the console mode once at the entry point
editor, trace, and status share one process-wide callback registry — the first one enabled wins. Configure the mode at the entry point (CLI flag or top-level Agent) and let downstream Agents inherit it, rather than setting different modes on multiple Agents in the same process.Related
Async Agents
Run agents asynchronously for better performance
Callbacks
Hook into agent lifecycle events

