Help us shape the future of Go! Take the 2026 Go Developer Survey

elicit

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionAccept  = "accept"
	ActionCancel  = "cancel"
	ActionDecline = "decline"
)

Variables

View Source
var ErrInvalid = errors.New("invalid form input")

Functions

func Coerce

func Coerce(schema *jsonschema.Schema, values map[string]string) (map[string]any, error)

func Form

func Form[T any](ctx dbos.DBOSContext, p Prompter, key, message string, defaults T, timeout time.Duration) (T, string, error)

func IsInvalid

func IsInvalid(err error) bool

func SchemaFor

func SchemaFor[T any](defaults T) (*jsonschema.Schema, error)

Types

type Prompt

type Prompt struct {
	ElicitationID   string             `json:"elicitationId"`
	Message         string             `json:"message"`
	Order           []string           `json:"order"`
	RequestedSchema *jsonschema.Schema `json:"requestedSchema"`
	Topic           string             `json:"topic"`
	WorkflowID      string             `json:"workflowId"`
}

type Prompter

type Prompter interface {
	Prompt(p Prompt) error
}

type Reply

type Reply struct {
	Action  string
	Content string
}

Jump to

Keyboard shortcuts

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