display

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package display provides beautiful CLI output formatting for smolagents

Package display provides beautiful CLI output formatting for smolagents using Charmbracelet libraries

Index

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) Error

func (d *CharmDisplay) Error(err error)

Error prints an error message

func (*CharmDisplay) FinalAnswer

func (d *CharmDisplay) FinalAnswer(answer interface{})

FinalAnswer prints the final answer

func (*CharmDisplay) Info

func (d *CharmDisplay) Info(message string)

Info prints an info message

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 New

func New(verbose bool) *Display

New creates a new Display instance (deprecated - use NewCharmDisplay)

func (*Display) Clear

func (d *Display) Clear()

Clear clears the screen (optional)

func (*Display) Code

func (d *Display) Code(title, code string)

Code prints a code block with syntax highlighting

func (*Display) Error

func (d *Display) Error(err error)

Error prints an error message

func (*Display) FinalAnswer

func (d *Display) FinalAnswer(answer interface{})

FinalAnswer prints the final answer

func (*Display) Info

func (d *Display) Info(message string)

Info prints an info message

func (*Display) Metrics

func (d *Display) Metrics(stepNumber int, duration time.Duration, inputTokens, outputTokens int)

Metrics prints token usage and timing information

func (*Display) ModelOutput

func (d *Display) ModelOutput(content string)

ModelOutput prints the raw model output (for debugging)

func (*Display) Observation

func (d *Display) Observation(content string)

Observation prints execution results

func (*Display) Planning

func (d *Display) Planning(plan string)

Planning prints a planning step

func (*Display) Progress

func (d *Display) Progress(message string)

Progress prints a progress indicator

func (*Display) Rule

func (d *Display) Rule(title string)

Rule prints a horizontal rule with optional title

func (*Display) StartSpinner

func (d *Display) StartSpinner(message string) *Spinner

StartSpinner starts a loading spinner

func (*Display) Step

func (d *Display) Step(stepNumber int, stepType string)

Step prints a step header

func (*Display) Success

func (d *Display) Success(message string)

Success prints a success message

func (*Display) Table

func (d *Display) Table(headers []string, rows [][]string)

Table creates a simple table

func (*Display) Task

func (d *Display) Task(title, subtitle string)

Task prints a task header with title and subtitle

func (*Display) Thought

func (d *Display) Thought(content string)

Thought prints the agent's thinking process

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

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

Spinner represents a loading spinner

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop stops the spinner

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL