chat

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DisabledHighlightStyle = lipgloss.NewStyle().
	Foreground(gray).
	Bold(true)
View Source
var HighlightActiveStyle = lipgloss.NewStyle().
	Background(teal).
	Foreground(black).
	Bold(true).
	Padding(0, 1)
View Source
var HighlightForegroundStyle = lipgloss.NewStyle().
	Foreground(purple).
	Bold(true)
View Source
var HighlightStyle = lipgloss.NewStyle().
	Background(purple).
	Bold(true).
	Padding(0, 1)
View Source
var RoundedBorder = lipgloss.NewStyle().
	BorderStyle(lipgloss.RoundedBorder())

Functions

func CenterString

func CenterString(str string, width int, color lipgloss.Color) string

func DecodeGob

func DecodeGob(r io.Reader, messages *[]ChatMessage) error

func EncodeGob

func EncodeGob(w io.Writer, messages *[]ChatMessage) error

func GenerateChatID

func GenerateChatID() string

func NewChatSettingsForm

func NewChatSettingsForm() (client.Chat, error)

Types

type Chat

type Chat struct {
	Glamour *glamour.TermRenderer

	ChatHistory  []ChatMessage
	ChatSettings client.Chat
	// contains filtered or unexported fields
}

func NewChat

func NewChat(chatSettings client.Chat) *Chat

func (*Chat) ImagePickerView

func (m *Chat) ImagePickerView() string

func (*Chat) Init

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

func (*Chat) Resize

func (chat *Chat) Resize() tea.Cmd

func (*Chat) Update

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

func (*Chat) View

func (chat *Chat) View() string

type ChatMessage

type ChatMessage struct {
	CreatedAt time.Time
	Role      string
	Message   string
	Images    []string
}

type ContentType

type ContentType string

type FinishedStreaming

type FinishedStreaming bool

type StreamChunk

type StreamChunk string

type Type

type Type string

Jump to

Keyboard shortcuts

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