userinput

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: GPL-3.0 Imports: 1 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 {
	Answers []string `json:"answers"`
}

Answer contains the user's response(s) to a single question.

type Callback

type Callback func(ctx context.Context, req *Request) (*Response, error)

Callback handles user-input requests and returns answers.

type Question

type Question struct {
	ID       string           `json:"id"`
	Header   string           `json:"header,omitempty"`
	Question string           `json:"question"`
	IsOther  bool             `json:"is_other,omitempty"`
	IsSecret bool             `json:"is_secret,omitempty"`
	Options  []QuestionOption `json:"options,omitempty"`
}

Question represents a single user-input prompt.

type QuestionOption

type QuestionOption struct {
	Label       string `json:"label"`
	Description string `json:"description,omitempty"`
}

QuestionOption represents a selectable choice in a user-input question.

type Request

type Request struct {
	ItemID    string     `json:"item_id,omitempty"`
	ThreadID  string     `json:"thread_id,omitempty"`
	TurnID    string     `json:"turn_id,omitempty"`
	Questions []Question `json:"questions"`
}

Request contains parsed user-input payload data.

type Response

type Response struct {
	Answers map[string]*Answer `json:"answers"`
}

Response contains answers keyed by question ID.

Jump to

Keyboard shortcuts

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