prompt

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Example

type Example struct {
	Input  []string
	Output string
}

func (Example) Sprint

func (ex Example) Sprint(prefix string) string

type Prompt

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

func New

func New(prompt string) *Prompt

func (*Prompt) Execute

func (prompt *Prompt) Execute(ai ai.AI, input []string, prefix string) (<-chan Result, int, error)

func (*Prompt) Prompts added in v1.0.11

func (prompt *Prompt) Prompts(input []string, prefix string) (prompts []string, err error)

func (*Prompt) SetAITimeout

func (prompt *Prompt) SetAITimeout(d time.Duration) *Prompt

func (*Prompt) SetExample

func (prompt *Prompt) SetExample(ex Example) *Prompt

func (*Prompt) SetInputN added in v1.0.10

func (prompt *Prompt) SetInputN(n int) *Prompt

func (*Prompt) SetTemplate

func (prompt *Prompt) SetTemplate(t *template.Template) *Prompt

func (*Prompt) SetWorkers

func (prompt *Prompt) SetWorkers(n int) *Prompt

type Result

type Result struct {
	Index  int
	Prompt string
	Result []string
	Error  error
}

Jump to

Keyboard shortcuts

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