tui

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UI-specific constants that don't belong in client config
	ChatInputCharLimit   = 500
	SystemInputCharLimit = 1000

	// UI refresh intervals
	LogCheckInterval = 100 * time.Millisecond
)
View Source
const (
	ChatInputPlaceholder     = "Type your message and press Enter..."
	SystemInputPlaceholder   = "Enter system prompt..."
	NoModelsPlaceholder      = "No models loaded - load a model first"
	SelectModelPlaceholder   = "Select a model first (press Enter on loaded model)"
	ChatWithModelPlaceholder = "Chat with %s (Enter to send, arrows to scroll)"
	GeneratingPlaceholder    = "Generating response..."
	WelcomeMessage           = "" /* 153-byte string literal not displayed */
)

UI Strings

Variables

View Source
var (
	MaxLogLines             = client.DefaultMaxLogLines
	StreamChannelBufferSize = client.DefaultStreamChannelSize
	EstimateTickInterval    = client.DefaultEstimateInterval
	AnimationTickInterval   = client.DefaultAnimationInterval
)

Use client configuration constants for shared values

Functions

This section is empty.

Types

type Model

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

Model represents the main TUI model

func NewModel

func NewModel(lmsClient *client.Client, logChannel chan string) Model

func (*Model) Cleanup

func (m *Model) Cleanup() error

Cleanup performs cleanup of TUI resources

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) IsClosed

func (m *Model) IsClosed() bool

IsClosed returns whether the model has been cleaned up

func (Model) Update

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

func (Model) View

func (m Model) View() string

type ResponseBuffer

type ResponseBuffer struct {
	Segments []rendering.ContentSegment
}

ResponseBuffer tracks segments during streaming

func (*ResponseBuffer) AddSegment

func (rb *ResponseBuffer) AddSegment(text string, contentType string)

func (*ResponseBuffer) Reset

func (rb *ResponseBuffer) Reset()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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