eval

package
v0.0.0-...-475ba6e Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

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

type History

type History struct {
	io.Writer
	Last *Entry
	// contains filtered or unexported fields
}

func NewHistory

func NewHistory(file *os.File) (*History, error)

func (*History) CopyLastAnswer

func (h *History) CopyLastAnswer() error

func (*History) WriteEntry

func (h *History) WriteEntry(entry *Entry) error

type REPL

type REPL struct {
	*bufio.ReadWriter
	*History
	// contains filtered or unexported fields
}

func NewREPL

func NewREPL(history *History, gpt4 *llm.GPT4) (*REPL, error)

func (*REPL) EvalAndPrint

func (repl *REPL) EvalAndPrint(question string) error

func (*REPL) Loop

func (repl *REPL) Loop() error

func (*REPL) Print

func (repl *REPL) Print(answer *openai.ChatCompletionStream) (string, error)

func (*REPL) Read

func (repl *REPL) Read() (question string, err error)

Jump to

Keyboard shortcuts

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