Documentation
¶
Index ¶
- type Model
- func (m *Model) Blocks() []block.Block
- func (m *Model) Cancel()
- func (m *Model) Duration() time.Duration
- func (m *Model) Err() error
- func (m *Model) HasAssistantContent() bool
- func (m *Model) ID() domain.MessageID
- func (m *Model) Init() tea.Cmd
- func (m *Model) IsActive() bool
- func (m *Model) LastTurnMessageIDs() []domain.MessageID
- func (m *Model) SetWidth(width int)
- func (m *Model) StartStream(messages []domain.Message, context []domain.ContextEntity) tea.Cmd
- func (m *Model) State() State
- func (m *Model) Update(msg tea.Msg) tea.Cmd
- type State
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 ¶
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) HasAssistantContent ¶ added in v1.14.0
HasAssistantContent returns true if any turn has assistant blocks.
func (*Model) IsActive ¶ added in v1.12.0
IsActive returns true if the round is in-flight (active or awaiting next turn).
func (*Model) LastTurnMessageIDs ¶ added in v1.14.0
LastTurnMessageIDs returns the message IDs that should be deleted on failure. For turn 1: the user message ID. For turn 2+: the tool result message ID (current turn) + the previous turn's assistant message ID.
func (*Model) StartStream ¶
StartStream begins streaming for the first turn.
Directories
¶
| Path | Synopsis |
|---|---|
|
assistant/blocks/tools/action
Package action provides a generic tool UI model for simple tools that accumulate input, execute, and show status — with no custom body.
|
Package action provides a generic tool UI model for simple tools that accumulate input, execute, and show status — with no custom body. |
|
assistant/blocks/tools/show
Package show renders entity cards inside tool chrome.
|
Package show renders entity cards inside tool chrome. |