Agent Output
Control how agents display responses – from silent to verbose with streaming
Output configuration controls how agents display their responses – silent for programmatic use, verbose for interactive sessions, or streaming for real-time feedback.
Quick Start
- Default (Silent)
python from praisonaiagents import Agent # Default is silent - no output overhead agent = Agent( name="API Agent", instructions="You process data" ) result = agent.chat("Analyze this data") # Returns result, no display - Verbose Mode
python agent = Agent( name="Interactive Agent", instructions="You help users", output="verbose" # Rich panels and formatting ) agent.start("Help me with Python") # Shows formatted output
Output Presets
| Preset | Display | Use Case |
|---|---|---|
silent | None | Programmatic use, fastest |
actions | Tool calls + final output | Debugging |
verbose | Rich panels | Interactive sessions |
json | JSONL events | Piping to other tools |
# Preset examples
agent = Agent(instructions="...", output="silent") # Default
agent = Agent(instructions="...", output="actions") # Debug
agent = Agent(instructions="...", output="verbose") # Interactive
agent = Agent(instructions="...", output="json") # PipingConfiguration Options
from praisonaiagents import OutputConfig
config = OutputConfig(
verbose=True, # Enable verbose output
markdown=True, # Format as markdown
stream=True, # Enable streaming
metrics=True, # Show token metrics
reasoning_steps=True, # Show reasoning
actions_trace=False, # Tool call trace
json_output=False, # JSONL output
simple_output=False, # Plain text only
show_parameters=False, # Show LLM parameters (debug)
status_trace=False, # Clean inline status updates
)| Option | Type | Default | Description |
|---|---|---|---|
verbose | bool | False | Enable verbose output |
markdown | bool | False | Format as markdown |
stream | bool | False | Enable streaming |
metrics | bool | False | Show token metrics |
reasoning_steps | bool | False | Show reasoning process |
actions_trace | bool | False | Show tool calls |
json_output | bool | False | Output JSONL events |
simple_output | bool | False | Plain text without panels |
show_parameters | bool | False | Show LLM parameters (debug) |
status_trace | bool | False | Clean inline status updates |
Streaming
Real-time output as the agent generates:
agent = Agent(
instructions="You write stories",
output=OutputConfig(stream=True)
)
# Streams response in real-time
agent.start("Write a short story about AI")Verbose vs Silent
Silent (Default)
# Fastest - no display overhead
agent = Agent(instructions="...")
result = agent.chat("Query") # Just returns resultVerbose
# Rich formatted output
agent = Agent(instructions="...", output="verbose")
agent.start("Query") # Shows panels, formattingJSON Output
For piping to other tools:
agent = Agent(
instructions="You analyze data",
output=OutputConfig(json_output=True)
)
# Outputs JSONL events to stderr
# {"event": "llm_start", "model": "gpt-4o", ...}
# {"event": "llm_end", "tokens": 150, ...}
# {"event": "response", "content": "...", ...}Metrics Display
Show token usage and timing:
agent = Agent(
instructions="You help with tasks",
output=OutputConfig(
verbose=True,
metrics=True, # Show token counts
)
)
# Output includes:
# Tokens: 150 input, 200 output
# Time: 1.2sMethod-Specific Output
Different methods have different default behaviors:
| Method | Default Output | Override |
|---|---|---|
agent.chat() | Silent | Use output= param |
agent.start() | Verbose + Stream | Use output= param |
agent.run() | Silent | Use output= param |
# chat() is silent by default
result = agent.chat("Query")
# start() is verbose by default
agent.start("Query")
# Override defaults
agent.chat("Query", stream=True) # Force streamingBest Practices
Use silent for APIs
Default silent mode has zero overhead – ideal for programmatic use.
Use verbose for debugging
See exactly what the agent is doing with verbose mode.
Enable streaming for UX
Users prefer seeing progress – enable streaming for interactive apps.
Use JSON for pipelines
JSONL output integrates well with log aggregators and pipelines.