Skip to main content
Control what your agent prints during a run — silent for APIs, status for CLI, stream for chat UIs.
The user runs the agent; output presets control whether responses stay silent, stream, or show status lines.

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
Precedence ladder — choose the level you need:

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.
Precedence within a single Agent when multiple mode flags are set:
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

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.
output="editor" shows human-friendly numbered steps with emoji icons. It is the default when running praisonai "prompt" from the command line.
Set output="stream" when building conversational UIs — tokens appear in real time for a responsive feel.
Set output=OutputConfig(output_file="result.md") to automatically save the agent’s response. Useful for reports, summaries, and generated documents.
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.

Async Agents

Run agents asynchronously for better performance

Callbacks

Hook into agent lifecycle events