tui

package
v1.209.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultViewportWidth is the default width for the chat viewport before window sizing.
	DefaultViewportWidth = 80
	// DefaultViewportHeight is the default height for the chat viewport before window sizing.
	DefaultViewportHeight = 20
)

Variables

This section is empty.

Functions

func RunChat

func RunChat(opts ChatOptions) error

RunChat starts the chat TUI with the provided options.

Types

type ChatMessage

type ChatMessage struct {
	Role     string // "user" or "assistant"
	Content  string
	Time     time.Time
	Provider string // The AI provider that generated this message (for assistant messages)
}

ChatMessage represents a single message in the chat.

type ChatModel

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

ChatModel represents the state of the chat TUI.

func NewChatModel

func NewChatModel(p ChatModelParams) (*ChatModel, error)

NewChatModel creates a new chat model with the provided parameters.

func (*ChatModel) Init

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

Init initializes the chat model.

func (*ChatModel) Update

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

Update handles messages and updates the model state.

func (*ChatModel) View

func (m *ChatModel) View() string

View renders the chat interface.

type ChatModelParams

type ChatModelParams struct {
	Client      ai.Client
	AtmosConfig *schema.AtmosConfiguration
	Manager     *session.Manager
	Session     *session.Session
	Executor    *tools.Executor
	MemoryMgr   *instructions.Manager
}

ChatModelParams holds the parameters for creating a new ChatModel.

type ChatOptions

type ChatOptions struct {
	Client      ai.Client
	AtmosConfig *schema.AtmosConfiguration
	Manager     *session.Manager
	Session     *session.Session
	Executor    *tools.Executor
	MemoryMgr   *instructions.Manager
}

ChatOptions holds all parameters needed to start a chat session.

type ProviderWithModel

type ProviderWithModel struct {
	Name        string
	DisplayName string
	Model       string
}

ProviderWithModel represents a provider with its configured model.

Jump to

Keyboard shortcuts

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