chat

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	Error      *errbook.AiError
	Output     string
	GlamOutput string
	// contains filtered or unexported fields
}

func NewChat

func NewChat(cfg *options.Config, opts ...Option) *Chat

func (*Chat) Init

func (c *Chat) Init() tea.Cmd

func (*Chat) Run added in v0.12.0

func (c *Chat) Run() error

Run starts the chat.

func (*Chat) Update

func (c *Chat) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Chat) View

func (c *Chat) View() string

type Option added in v0.12.0

type Option func(*Options)

func WithContent added in v0.12.0

func WithContent(content string) Option

func WithContext added in v0.12.0

func WithContext(ctx context.Context) Option

func WithEngine added in v0.12.0

func WithEngine(engine *ai.Engine) Option

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

func WithRenderer added in v0.12.0

func WithRenderer(renderer *lipgloss.Renderer) Option

func WithRunMode added in v0.12.0

func WithRunMode(runMode ui.RunMode) Option

func WithWordWrap added in v0.12.0

func WithWordWrap(wordWrap int) Option

type Options added in v0.12.0

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

func NewOptions added in v0.12.0

func NewOptions(opts ...Option) *Options

Jump to

Keyboard shortcuts

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