You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/tools/builtin/user_prompt.go
+36-11Lines changed: 36 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,18 @@ var (
23
23
_ tools.Instructable= (*UserPromptTool)(nil)
24
24
)
25
25
26
+
// UserPromptOption represents a single selectable choice presented to the user.
27
+
typeUserPromptOptionstruct {
28
+
Labelstring`json:"label" jsonschema:"Short display text for this option (1-5 words)"`
29
+
Descriptionstring`json:"description" jsonschema:"Brief explanation of what this option means"`
30
+
}
31
+
26
32
typeUserPromptArgsstruct {
27
-
Messagestring`json:"message" jsonschema:"The message/question to display to the user"`
28
-
Titlestring`json:"title,omitempty" jsonschema:"Optional title for the dialog window (defaults to 'Question')"`
29
-
Schemamap[string]any`json:"schema,omitempty" jsonschema:"JSON Schema defining the expected response structure. Supports object schemas with properties or primitive type schemas."`
33
+
Messagestring`json:"message" jsonschema:"The message/question to display to the user"`
34
+
Titlestring`json:"title,omitempty" jsonschema:"Optional title for the dialog window (defaults to 'Question')"`
35
+
Schemamap[string]any`json:"schema,omitempty" jsonschema:"JSON Schema defining the expected response structure. Mutually exclusive with options."`
36
+
Options []UserPromptOption`json:"options,omitempty" jsonschema:"List of choices to present to the user. Each has a label and description. The user can pick from these or type a custom answer. Put recommended option first and append '(Recommended)' to its label. Mutually exclusive with schema."`
37
+
Multiplebool`json:"multiple,omitempty" jsonschema:"When true and options are provided, allow the user to select multiple options. Defaults to single selection."`
Description: "Ask the user a question and wait for their response. Use this when you need interactive input, clarification, or confirmation from the user. Optionally provide a JSON schema to define the expected response structure.",
132
+
Description: "Ask the user a question and wait for their response. Use this when you need interactive input, clarification, or confirmation from the user. Provide 'options' to present a list of choices, or a JSON 'schema' for structured input.",
0 commit comments