Display Module
Formatted rendering of message analytics data with Rich, plain text, and HTML output.
Quick Example
from mamba_agents import Agent
agent = Agent("gpt-4o")
agent.run_sync("Hello!")
# Via the query interface (easiest)
agent.messages.print_stats()
agent.messages.print_timeline()
agent.messages.print_tools()
# Standalone functions
from mamba_agents.agent.display import print_stats, print_timeline, print_tools
stats = agent.messages.stats()
print_stats(stats, preset="compact", format="rich")
Classes
| Class |
Description |
Reference |
MessageRenderer |
ABC for format-specific renderers |
Renderers |
RichRenderer |
Rich Console output (tables, panels) |
Renderers |
PlainTextRenderer |
ASCII text output (aligned columns) |
Renderers |
HtmlRenderer |
HTML output (Jupyter notebooks) |
Renderers |
DisplayPreset |
Controls display detail level |
Presets & Functions |
Functions
Named Presets
| Preset |
Description |
COMPACT |
Minimal output: counts only, short truncation |
DETAILED |
Balanced output: full tables, moderate truncation (default) |
VERBOSE |
Maximum output: expanded content, full tool details |
Imports
# Top-level convenience imports
from mamba_agents import (
DisplayPreset, MessageRenderer,
RichRenderer, PlainTextRenderer, HtmlRenderer,
print_stats, print_timeline, print_tools,
)
# Direct module imports
from mamba_agents.agent.display import (
DisplayPreset, MessageRenderer,
RichRenderer, PlainTextRenderer, HtmlRenderer,
get_preset, COMPACT, DETAILED, VERBOSE,
print_stats, print_timeline, print_tools,
)