Output Styles

Control how agents display responses — from silent SDK mode to verbose interactive output

Control what your agent prints during a run — silent for APIs, status for CLI, stream for chat UIs.

python
from praisonaiagents import Agent

agent = Agent(
    name="Assistant",
    instructions="You are helpful.",
    output="status",
)
result = agent.start("What is the capital of France?")

The user runs the agent; output presets control whether responses stay silent, stream, or show status lines.

Diagram

Output Styles

🔇 silent\n(default)

📊 status

📋 verbose

🌊 stream

📄 json

🤖 Agent

How It Works

Diagram
OutputStylesAgentUserOutputStylesAgentUserRequestProcessResultResponse

Quick Start

  1. Simple Usage

    Pass output as a string preset:

    python
    from praisonaiagents import Agent
    
    agent = Agent(
        name="Assistant",
        instructions="You are a helpful assistant.",
        output="status"
    )
    
    result = agent.start("What is the weather in Tokyo?")
  2. With Configuration

    Use OutputConfig for fine-grained control:

    python
    from praisonaiagents import Agent, OutputConfig
    
    agent = Agent(
        name="Assistant",
        instructions="You are a helpful assistant.",
        output=OutputConfig(
            verbose=True,
            markdown=True,
            stream=True,
            metrics=True,
        )
    )
    
    result = agent.start("Explain machine learning in simple terms")

Which Style Should I Use?

Pick a preset based on where the output is consumed.

Diagram

API / programmatic

CLI progress

User-facing terminal

Chat UI

Pipe to other tools

Where does output go?

How is it consumed?

silent
default, zero overhead

status
timestamped status lines

verbose
Rich panels + color

stream
real-time tokens

json
JSONL events


How It Works

Diagram
Output StylesAgentUserOutput StylesAgentUserRequestProcess requestResultResponse
Diagram

Which preset should I use?

Yes

No

Yes

No, just response

Yes

No

Yes

Building an\napp or API?

Want to see\ntool calls?

Need timestamps\nor metrics?

Streaming\nchat UI?

🔇 silent\n(return value only)

📊 status\n(inline tool trace)

🕐 trace\n(timestamped trace)

🌊 stream\n(real-time tokens)

📋 verbose\n(full panels)

PresetDescriptionBest For
silentNo output, returns value only (default)SDK / programmatic use
editorStep 1: 📄 Creating file → ✓ DoneCLI default, beginners
status▸ AI → thinking + inline tool callsSimple CLI output
traceStatus with [HH:MM:SS] timestampsProgress monitoring
debugTrace + metrics, no boxesDeveloper debugging
verboseTask + Tools + Response panelsInteractive sessions
streamReal-time token streamingChat interfaces
jsonJSONL events on stdoutScripting / piping

Concurrent execution (PR #5219)


Configuration Options

OutputConfig SDK Reference

Full parameter reference for OutputConfig

Precedence ladder — choose the level you need:

python
# Level 1: String preset
agent = Agent(output="verbose")   # "silent" | "minimal" | "normal" | "verbose" | "debug"

# Level 2: OutputConfig (full control)
agent = Agent(output=OutputConfig(verbose=True, stream=True, output_file="results.md"))
python
from praisonaiagents import Agent, OutputConfig

agent = Agent(
    instructions="...",
    output=OutputConfig(
        verbose=False,
        markdown=False,
        stream=False,
        metrics=False,
        reasoning_steps=False,
        actions_trace=False,
        json_output=False,
        simple_output=False,
        status_trace=False,
        editor_output=False,
        show_parameters=False,
        output_file=None,
        template=None,
        tool_output_limit=16000,
    )
)
OptionTypeDefaultDescription
verboseboolFalseShow Rich panels for tasks and responses
markdownboolFalseRender markdown formatting
streamboolFalseStream tokens in real time
metricsboolFalseDisplay token usage and cost after each response
reasoning_stepsboolFalseShow internal reasoning steps
actions_traceboolFalseShow tool calls and lifecycle events on stderr
json_outputboolFalseEmit JSONL events for piping
simple_outputboolFalsePrint response without Rich panels
status_traceboolFalseClean inline status updates
editor_outputboolFalseNumbered steps with emoji icons (CLI default)
show_parametersboolFalseShow LLM parameters (debug preset)
styleAnyNoneCustom output styling object
output_filestrNoneFile path to automatically save the agent response
templatestrNoneFormat template for the response
tool_output_limitint16000Maximum characters for tool output

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.

python
from praisonaiagents import Agent

a = Agent(name="A", instructions="You are helpful.", output="editor")   # editor mode wins
b = Agent(name="B", instructions="You are helpful.", output="trace")    # keeps editor mode
c = Agent(name="C", instructions="You are helpful.", output="status")   # keeps editor mode

Precedence within a single Agent when multiple mode flags are set:

editor_output > status_trace > actions_trace
Diagram

first mode wins

skipped

skipped

🤖 Agent A
output=’editor’

📋 Process registry

🤖 Agent B
output=’trace’

🤖 Agent C
output=’status’

📤 Editor formatting for A, B, C

String Preset Aliases

AliasMaps To
plain, minimalsilent
normalverbose
text, actionsstatus

Common Patterns

Silent (SDK Default)

python
from praisonaiagents import Agent

agent = Agent(
    instructions="You are a helpful assistant.",
)

result = agent.start("Summarize this article: ...")
print(result)

Status (CLI / Interactive)

python
from praisonaiagents import Agent

agent = Agent(
    instructions="You are a helpful assistant.",
    output="status"
)

result = agent.start("What is the capital of France?")

Save Response to File

python
from praisonaiagents import Agent, OutputConfig

agent = Agent(
    instructions="Write a detailed report",
    output=OutputConfig(
        output_file="report.md",
        markdown=True,
    )
)

agent.start("Write a report on renewable energy trends")

Best Practices

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

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

Set output="stream" when building conversational UIs — tokens appear in real time for a responsive feel.

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

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