Skip to content

Commit 8d1e463

Browse files
committed
feat: add status output mode for clean inline progress
- Add new 'status' preset showing [HH:MM:SS] ▸ tool → result ✓ - Create output/status.py with StatusSink class - Add status_trace field to OutputConfig - Update presets.py with full preset hierarchy - Consolidate presets: text, status, verbose, debug, stream, json - Add backward compatible aliases (plain→silent, minimal→silent, etc.) Fixes confusing verbose output by providing clean alternative
1 parent e11d62d commit 8d1e463

File tree

4 files changed

+384
-32
lines changed

4 files changed

+384
-32
lines changed

src/praisonai-agents/praisonaiagents/agent/agent.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,26 @@ def __init__(
469469
output_style = getattr(_output_config, 'style', None)
470470
actions_trace = getattr(_output_config, 'actions_trace', False) # Default False (silent)
471471
json_output = getattr(_output_config, 'json_output', False)
472+
status_trace = getattr(_output_config, 'status_trace', False) # New: clean inline status
472473
else:
473474
# Fallback defaults match silent mode (zero overhead)
474475
verbose, markdown, stream, metrics, reasoning_steps = False, False, False, False, False
475476
actions_trace = False # No callbacks by default
476477
json_output = False
478+
status_trace = False
477479

478-
# Enable actions output mode if configured
480+
# Enable status output mode if configured (takes priority over actions)
481+
# This provides clean inline status without boxes
482+
if status_trace:
483+
try:
484+
from ..output.status import enable_status_mode, is_status_mode_enabled
485+
if not is_status_mode_enabled():
486+
enable_status_mode(use_color=True, show_timestamps=True)
487+
except ImportError:
488+
pass # Status module not available
489+
# Enable actions output mode if configured (and status not enabled)
479490
# This registers callbacks to capture tool calls and final output
480-
if actions_trace:
491+
elif actions_trace:
481492
try:
482493
from ..output.actions import enable_actions_mode, is_actions_mode_enabled
483494
if not is_actions_mode_enabled():

src/praisonai-agents/praisonaiagents/config/feature_configs.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,16 @@ class OutputConfig:
528528
# JSON output mode - emit JSONL events for piping
529529
json_output: bool = False
530530

531+
# Simple output mode - just print response without panels
532+
simple_output: bool = False
533+
534+
# Show LLM parameters (for debug mode)
535+
show_parameters: bool = False
536+
537+
# Status trace mode - clean inline status updates
538+
# Shows: [timestamp] Calling LLM..., Executing tool..., Response: ...
539+
status_trace: bool = False
540+
531541
def to_dict(self) -> Dict[str, Any]:
532542
"""Convert to dictionary."""
533543
return {
@@ -538,6 +548,9 @@ def to_dict(self) -> Dict[str, Any]:
538548
"reasoning_steps": self.reasoning_steps,
539549
"actions_trace": self.actions_trace,
540550
"json_output": self.json_output,
551+
"simple_output": self.simple_output,
552+
"show_parameters": self.show_parameters,
553+
"status_trace": self.status_trace,
541554
}
542555

543556

src/praisonai-agents/praisonaiagents/config/presets.py

Lines changed: 73 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@
3939
# =============================================================================
4040
# Output Presets
4141
# =============================================================================
42+
#
43+
# Preset Hierarchy (from least to most output):
44+
# silent → Nothing (default for SDK, max performance)
45+
# text → Response only, simple format
46+
# verbose → Task + Tools inline + Response panel
47+
# debug → verbose + metrics footer (tokens, cost, model)
48+
# stream → Real-time token streaming
49+
# json → Machine-readable JSONL events
50+
#
51+
# =============================================================================
4252

4353
OUTPUT_PRESETS: Dict[str, Dict[str, Any]] = {
4454
# Silent preset - DEFAULT for SDK
@@ -52,77 +62,110 @@
5262
"reasoning_steps": False,
5363
"actions_trace": False,
5464
},
55-
# Actions preset - opt-in observability
56-
# Shows action trace (tool calls, agent lifecycle) + final output
57-
# Registers callbacks, outputs to stderr
58-
"actions": {
65+
# Text preset - Shows final response only
66+
# Simple one-line format without panels
67+
"text": {
5968
"verbose": False,
6069
"markdown": False,
6170
"stream": False,
6271
"metrics": False,
6372
"reasoning_steps": False,
64-
"actions_trace": True, # Special flag for action trace mode
73+
"actions_trace": True, # Triggers final output display
74+
"simple_output": True, # New flag for simple text format
6575
},
66-
# Plain preset - final output only, no action trace
67-
"plain": {
76+
# Verbose preset - Full interactive output
77+
# Shows: Task prompt, Tool calls (inline), Response panel
78+
"verbose": {
79+
"verbose": True,
80+
"markdown": True,
81+
"stream": False,
82+
"metrics": False, # No metrics footer
83+
"reasoning_steps": False,
84+
},
85+
# Debug preset - verbose + metrics footer
86+
# Shows everything verbose shows + token counts, cost, model info
87+
"debug": {
88+
"verbose": True,
89+
"markdown": True,
90+
"stream": False,
91+
"metrics": True, # Shows metrics footer
92+
"reasoning_steps": True,
93+
"show_parameters": True, # New: show LLM parameters
94+
},
95+
# Streaming preset - enables streaming by default
96+
"stream": {
97+
"verbose": True,
98+
"markdown": True,
99+
"stream": True,
100+
"metrics": False,
101+
"reasoning_steps": False,
102+
},
103+
# Status preset - Clean inline status updates without boxes
104+
# Shows: [timestamp] Calling LLM..., Executing tool..., Response: ...
105+
# Ideal for external apps that want to track progress
106+
"status": {
68107
"verbose": False,
69108
"markdown": False,
70109
"stream": False,
71110
"metrics": False,
72111
"reasoning_steps": False,
73-
"actions_trace": False,
112+
"actions_trace": True,
113+
"status_trace": True, # New: enable simple status output
74114
},
75-
"minimal": {
115+
# JSON preset - JSONL output for piping/scripting
116+
"json": {
76117
"verbose": False,
77118
"markdown": False,
78119
"stream": False,
79120
"metrics": False,
80121
"reasoning_steps": False,
122+
"actions_trace": True,
123+
"json_output": True, # Output as JSONL
81124
},
82-
"normal": {
83-
"verbose": True,
84-
"markdown": True,
125+
126+
# ==========================================================================
127+
# ALIASES (for backward compatibility)
128+
# ==========================================================================
129+
# plain → silent (identical behavior)
130+
"plain": {
131+
"verbose": False,
132+
"markdown": False,
85133
"stream": False,
86134
"metrics": False,
87135
"reasoning_steps": False,
136+
"actions_trace": False,
88137
},
89-
"verbose": {
90-
"verbose": True,
91-
"markdown": True,
138+
# minimal → silent (identical behavior)
139+
"minimal": {
140+
"verbose": False,
141+
"markdown": False,
92142
"stream": False,
93-
"metrics": True,
94-
"reasoning_steps": True,
143+
"metrics": False,
144+
"reasoning_steps": False,
95145
},
96-
"debug": {
146+
# normal → verbose (consolidated)
147+
"normal": {
97148
"verbose": True,
98149
"markdown": True,
99150
"stream": False,
100-
"metrics": True,
101-
"reasoning_steps": True,
102-
},
103-
# Streaming preset - enables streaming by default
104-
"stream": {
105-
"verbose": True,
106-
"markdown": True,
107-
"stream": True,
108151
"metrics": False,
109152
"reasoning_steps": False,
110153
},
111-
# JSON preset - JSONL output for piping
112-
"json": {
154+
# actions → text (renamed for clarity)
155+
"actions": {
113156
"verbose": False,
114157
"markdown": False,
115158
"stream": False,
116159
"metrics": False,
117160
"reasoning_steps": False,
118161
"actions_trace": True,
119-
"json_output": True, # Output as JSONL
120162
},
121163
}
122164

123165
# Default output mode - can be overridden by PRAISONAI_OUTPUT env var
124166
# "silent" = zero overhead, fastest performance (DEFAULT)
125-
# "actions" = tool call trace + final output (opt-in observability)
167+
# "verbose" = full interactive display
168+
# "debug" = verbose + metrics
126169
DEFAULT_OUTPUT_MODE = "silent"
127170

128171

0 commit comments

Comments
 (0)