round

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model represents a complete user→assistant exchange, potentially with multiple turns if tools are involved. A round starts with explicit user input and ends when the assistant stops (no more tool calls). It is a fixed-height component - height is determined by content.

func New

func New(
	theme styles.Theme,
	conversationID domain.ConversationID,
	accountID domain.AccountID,
	userMessageID domain.MessageID,
	input msgs.UserSubmittedInput,
	width int,
	db sqlite.DB,
	chatClient chatclient.Client,
	toolRegistry *chattools.Registry,
	scope log.Scope,
) *Model

New creates a new round from explicit user input.

func (*Model) Blocks

func (m *Model) Blocks() []block.Block

Blocks returns all visual blocks from all turns in this round. The thinking animation is appended at the end while the round is active.

func (*Model) Cancel

func (m *Model) Cancel()

Cancel stops all in-flight turns and marks the round cancelled.

func (*Model) Duration

func (m *Model) Duration() time.Duration

Duration returns the elapsed time for this round.

func (*Model) ID

func (m *Model) ID() domain.MessageID

ID returns the round's ID (first user message ID).

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init starts the thinking animation.

func (*Model) SetWidth

func (m *Model) SetWidth(width int)

SetWidth sets the width for all turns.

func (*Model) StartStream

func (m *Model) StartStream(messages []domain.Message, context []domain.ContextEntity) tea.Cmd

StartStream begins streaming for the first turn.

func (*Model) State

func (m *Model) State() State

State returns the round's current state.

func (*Model) Update

func (m *Model) Update(msg tea.Msg) tea.Cmd

Update handles messages.

type State

type State int

State represents the current state of a round.

const (
	StateActive State = iota
	StateComplete
	StateCancelled
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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