ask_user

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ask_user implements the ask_user tool: the model asks the user a multiple-choice question and blocks on the answer. Plan-mode only — it lets the agent resolve ambiguity before writing a plan instead of guessing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tool

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

Tool wraps an ask.Asker. A nil asker falls back to Static (auto-pick), so the tool is always safe to register.

func New

func New(a ask.Asker) *Tool

New returns an ask_user tool. Pass nil for headless/autonomous runs where no human is present; it auto-resolves to the recommended option.

func (*Tool) Run

func (t *Tool) Run(ctx context.Context, in map[string]any) (tools.Result, error)

Run surfaces the question and blocks until the user answers. Returns the chosen label (or custom text) so the model can continue with the decision.

func (*Tool) Spec

func (t *Tool) Spec() llm.ToolSpec

Spec advertises the tool. Concrete description + one clear use case so small models reach for it instead of silently guessing defaults.

Jump to

Keyboard shortcuts

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