Documentation
¶
Overview ¶
Package display provides beautiful CLI output formatting for smolagents
Package display provides beautiful CLI output formatting for smolagents using Charmbracelet libraries
Index ¶
- type CharmDisplay
- func (d *CharmDisplay) Code(title, code string)
- func (d *CharmDisplay) Error(err error)
- func (d *CharmDisplay) FinalAnswer(answer interface{})
- func (d *CharmDisplay) Info(message string)
- func (d *CharmDisplay) Metrics(stepNumber int, duration time.Duration, inputTokens, outputTokens int)
- func (d *CharmDisplay) ModelOutput(content string)
- func (d *CharmDisplay) Observation(content string)
- func (d *CharmDisplay) Planning(plan string)
- func (d *CharmDisplay) Progress(message string)
- func (d *CharmDisplay) Rule(title string)
- func (d *CharmDisplay) Step(stepNumber int, stepType string)
- func (d *CharmDisplay) Success(message string)
- func (d *CharmDisplay) Task(title, subtitle string)
- func (d *CharmDisplay) Thought(content string)
- func (d *CharmDisplay) UpdateWidth()
- type Display
- func (d *Display) Clear()
- func (d *Display) Code(title, code string)
- func (d *Display) Error(err error)
- func (d *Display) FinalAnswer(answer interface{})
- func (d *Display) Info(message string)
- func (d *Display) Metrics(stepNumber int, duration time.Duration, inputTokens, outputTokens int)
- func (d *Display) ModelOutput(content string)
- func (d *Display) Observation(content string)
- func (d *Display) Planning(plan string)
- func (d *Display) Progress(message string)
- func (d *Display) Rule(title string)
- func (d *Display) StartSpinner(message string) *Spinner
- func (d *Display) Step(stepNumber int, stepType string)
- func (d *Display) Success(message string)
- func (d *Display) Table(headers []string, rows [][]string)
- func (d *Display) Task(title, subtitle string)
- func (d *Display) Thought(content string)
- type DisplayStyles
- type Spinner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CharmDisplay ¶
type CharmDisplay struct {
// contains filtered or unexported fields
}
CharmDisplay handles all CLI output formatting with Charmbracelet libraries
func NewCharmDisplay ¶
func NewCharmDisplay(verbose bool) *CharmDisplay
NewCharmDisplay creates a new display instance with Charmbracelet styling
func (*CharmDisplay) Code ¶
func (d *CharmDisplay) Code(title, code string)
Code prints a code block with syntax highlighting
func (*CharmDisplay) FinalAnswer ¶
func (d *CharmDisplay) FinalAnswer(answer interface{})
FinalAnswer prints the final answer
func (*CharmDisplay) Metrics ¶
func (d *CharmDisplay) Metrics(stepNumber int, duration time.Duration, inputTokens, outputTokens int)
Metrics prints token usage and timing information
func (*CharmDisplay) ModelOutput ¶
func (d *CharmDisplay) ModelOutput(content string)
ModelOutput prints the raw model output (for debugging)
func (*CharmDisplay) Observation ¶
func (d *CharmDisplay) Observation(content string)
Observation prints execution results
func (*CharmDisplay) Planning ¶
func (d *CharmDisplay) Planning(plan string)
Planning prints a planning step
func (*CharmDisplay) Progress ¶
func (d *CharmDisplay) Progress(message string)
Progress prints a progress indicator
func (*CharmDisplay) Rule ¶
func (d *CharmDisplay) Rule(title string)
Rule prints a horizontal rule with optional title
func (*CharmDisplay) Step ¶
func (d *CharmDisplay) Step(stepNumber int, stepType string)
Step prints a step header
func (*CharmDisplay) Success ¶
func (d *CharmDisplay) Success(message string)
Success prints a success message
func (*CharmDisplay) Task ¶
func (d *CharmDisplay) Task(title, subtitle string)
Task prints a task header with title and subtitle
func (*CharmDisplay) Thought ¶
func (d *CharmDisplay) Thought(content string)
Thought prints the agent's thinking process
func (*CharmDisplay) UpdateWidth ¶
func (d *CharmDisplay) UpdateWidth()
UpdateWidth updates the terminal width
type Display ¶
type Display struct {
// contains filtered or unexported fields
}
Display handles all CLI output formatting
func (*Display) FinalAnswer ¶
func (d *Display) FinalAnswer(answer interface{})
FinalAnswer prints the final answer
func (*Display) ModelOutput ¶
ModelOutput prints the raw model output (for debugging)
func (*Display) Observation ¶
Observation prints execution results
func (*Display) StartSpinner ¶
StartSpinner starts a loading spinner
type DisplayStyles ¶
type DisplayStyles struct {
Rule lipgloss.Style
Task lipgloss.Style
TaskSubtitle lipgloss.Style
Step lipgloss.Style
Thought lipgloss.Style
Code lipgloss.Style
CodeBox lipgloss.Style
Observation lipgloss.Style
Error lipgloss.Style
ErrorTip lipgloss.Style
Success lipgloss.Style
Info lipgloss.Style
Progress lipgloss.Style
FinalAnswer lipgloss.Style
Planning lipgloss.Style
Timestamp lipgloss.Style
}
DisplayStyles holds all the lipgloss styles