Documentation
¶
Overview ¶
Package chat implements the terminal-based chat interface for AI interactions. It handles the UI rendering, state management, and communication with the AI engine.
Index ¶
- type Chat
- type Option
- func WithContent(content string) Option
- func WithContext(ctx context.Context) Option
- func WithCopyToClipboard(copy bool) Option
- func WithEngine(engine *ai.Engine) Option
- func WithMessages(messages []llms.ChatMessage) Option
- func WithPromptMode(promptMode ui.PromptMode) Option
- func WithRenderer(renderer *lipgloss.Renderer) Option
- func WithRunMode(runMode ui.RunMode) Option
- func WithWordWrap(wordWrap int) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chat ¶
type Chat struct { Error *errbook.AiError // Error encountered during chat TokenUsage llms.Usage // Token usage statistics from the AI // contains filtered or unexported fields }
Chat represents the main chat application structure
func NewChat ¶
NewChat creates and initializes a new Chat instance cfg: Application configuration opts: Optional parameters for customizing chat behavior
func (*Chat) GetGlamOutput ¶ added in v0.13.5
GetGlamOutput returns the formatted markdown output Returns the rendered markdown output string
func (*Chat) GetOutput ¶ added in v0.13.5
GetOutput returns the unescaped chat output Returns the processed chat output string
func (*Chat) Init ¶
Init initializes the chat application and returns the initial command to execute This is part of the Bubble Tea framework's initialization process
func (*Chat) Run ¶ added in v0.12.0
Run starts the chat application and handles the main execution loop Returns error if the program fails to start or encounters an error during execution
type Option ¶ added in v0.12.0
type Option func(*Options)
func WithContent ¶ added in v0.12.0
func WithContext ¶ added in v0.12.0
func WithCopyToClipboard ¶ added in v0.13.5
func WithEngine ¶ added in v0.12.0
func WithMessages ¶ added in v0.12.0
func WithMessages(messages []llms.ChatMessage) Option
func WithPromptMode ¶ added in v0.12.0
func WithPromptMode(promptMode ui.PromptMode) Option