chat

package
v0.0.0-...-f1896f7 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Question string `json:"question"`
	Answer   string `json:"answer"`
}

type Chat

type Chat struct {
	Response *LLMResponse
	// contains filtered or unexported fields
}

func New

func New(co *common.Common) *Chat

func (*Chat) Focus

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

func (*Chat) Init

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

func (*Chat) SetSize

func (c *Chat) SetSize(width, height int)

func (*Chat) Update

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

func (*Chat) View

func (c *Chat) View() string

type LLMResponse

type LLMResponse struct {
	Context   string   `json:"context"`
	Goal      string   `json:"goal"`
	Questions []string `json:"questions"`
	Commands  []string `json:"commands"`
}

func ParseResponse

func ParseResponse(jsonStr string) (*LLMResponse, error)

type Output

type Output struct {
	Command string         `json:"command"`
	Output  sandbox.Result `json:"output"`
}

type Request

type Request struct {
	Prompt   string   `json:"prompt"`
	Feedback string   `json:"feedback"`
	Answers  []Answer `json:"answers"`
	Outputs  []Output `json:"outputs"`
	Previous []string `json:"previous"`
}

type State

type State int

Jump to

Keyboard shortcuts

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