Documentation
¶
Overview ¶
Package askusertool implements the AskUserQuestion tool.
The model calls this tool to ask the user a multiple-choice or free-form question. The TUI blocks the agent loop until the user responds. Port of src/tools/AskUserQuestionTool/.
Index ¶
- type AskUserQuestion
- func (t *AskUserQuestion) Description() string
- func (t *AskUserQuestion) Execute(ctx context.Context, raw json.RawMessage) (tool.Result, error)
- func (t *AskUserQuestion) InputSchema() json.RawMessage
- func (t *AskUserQuestion) IsConcurrencySafe(_ json.RawMessage) bool
- func (t *AskUserQuestion) IsReadOnly(_ json.RawMessage) bool
- func (t *AskUserQuestion) Name() string
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AskUserQuestion ¶
type AskUserQuestion struct {
// Ask is called with the question and options. It blocks until the user
// responds and returns the selected answer(s). If the user provides a
// free-form answer, it is returned as a single element. Returns nil to
// indicate no answer / cancellation.
Ask func(ctx context.Context, question string, options []Option, multiSelect bool) []string
}
AskUserQuestion presents a question to the user and returns their answer. The Ask callback is installed by the TUI; without it the tool auto-declines.
func (*AskUserQuestion) Description ¶
func (t *AskUserQuestion) Description() string
func (*AskUserQuestion) Execute ¶
func (t *AskUserQuestion) Execute(ctx context.Context, raw json.RawMessage) (tool.Result, error)
func (*AskUserQuestion) InputSchema ¶
func (t *AskUserQuestion) InputSchema() json.RawMessage
func (*AskUserQuestion) IsConcurrencySafe ¶
func (t *AskUserQuestion) IsConcurrencySafe(_ json.RawMessage) bool
func (*AskUserQuestion) IsReadOnly ¶
func (t *AskUserQuestion) IsReadOnly(_ json.RawMessage) bool
func (*AskUserQuestion) Name ¶
func (t *AskUserQuestion) Name() string
Click to show internal directories.
Click to hide internal directories.