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
Concurrent execution (PR #5219)
status and trace route through a shared per-process singleton whose _output_lock is now actually acquired (PR #5219, fixes #5162). Reaching for output="status" / output="trace" under asyncio.gather is now safe for the aggregate timing and token/cost metrics β with the caveat that _tool_start_times / _agent_start_times are still keyed by name only. Give each agent a distinct name=. Full detail in Thread Safety β Output singleton lock.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

