gptea

package
v0.0.0-...-61616b3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearScrollback

func ClearScrollback() tea.Msg

func ErrorCmd

func ErrorCmd(err error) tea.Cmd

func HistoryPrinted

func HistoryPrinted() tea.Msg

func Init

func Init() tea.Msg

func MessageCmd

func MessageCmd[T any](msg T) tea.Cmd

MessageCmd is a helper function that wraps a message in a tea.Cmd

func StartEditorCmd

func StartEditorCmd(msg string) tea.Cmd

func StaticStream

func StaticStream(text string) tea.Cmd

func WindowResized

func WindowResized(msg tea.WindowSizeMsg, ready bool) func() tea.Msg

Types

type BacklogMsg

type BacklogMsg struct {
	Messages []query.Message
	Err      error
}

type BacklogPrintedMsg

type BacklogPrintedMsg struct {
}

type ConfigLoadedMsg

type ConfigLoadedMsg struct {
	Config       store.Config
	ClientConfig query.ClientConfig
	Err          error
}

type ConversationHistoryMsg

type ConversationHistoryMsg struct {
	Val int
	Err error
}

type ConversationSwitchedMsg

type ConversationSwitchedMsg struct {
	Messages []query.Message
	Err      error
}

type EditorRequestMsg

type EditorRequestMsg struct {
	Prompt string
}

type EditorResultMsg

type EditorResultMsg struct {
	Text string
	Err  error
}

type ErrorMsg

type ErrorMsg struct {
	Err error
}

type GistOpenReq

type GistOpenReq struct {
	URL string
}

type GistOpenRes

type GistOpenRes struct {
	URL string
	Err error
}

type GistResultMsg

type GistResultMsg struct {
	URL           string
	Opened        bool
	Err           error
	NoCredentials bool
}

type HistoryMsg

type HistoryMsg struct {
	Messages []query.Message
	Err      error
}

type HistoryPrintedMsg

type HistoryPrintedMsg struct{}

type InitMsg

type InitMsg struct {
}

type ScrollbackClearedMsg

type ScrollbackClearedMsg struct{}

type SetCredentialReq

type SetCredentialReq struct {
	Prompt string
	Key    string
}

type SetCredentialRes

type SetCredentialRes struct {
	Err error
}

type StreamCompletion

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

func NewStreamCompletion

func NewStreamCompletion() StreamCompletion

func (StreamCompletion) Close

func (s StreamCompletion) Close(err error)

Close closes the stream with the error result. This should only ever be called once and should always be called.

func (StreamCompletion) Done

func (s StreamCompletion) Done() bool

func (StreamCompletion) Err

func (s StreamCompletion) Err() error

func (StreamCompletion) Next

func (s StreamCompletion) Next() (res []string)

func (StreamCompletion) Write

func (s StreamCompletion) Write(ctx context.Context, text string) error

type StreamCompletionReq

type StreamCompletionReq struct {
	Text string
}

type StreamCompletionResult

type StreamCompletionResult struct {
	Text string
	Err  error
}

type WindowSizeMsg

type WindowSizeMsg struct {
	tea.WindowSizeMsg
	Ready bool
}

Jump to

Keyboard shortcuts

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