addGatherQuestion
Add a question to this step’s gather_info configuration.
setGatherInfo()
must be called before this method.
Gather mode limits function access. While the model is asking gather questions, the platform deactivates all of the step’s other functions. During a gather question, the model can call:
gather_submit(the native answer-submission tool)- Whatever names you list in this question’s
functionsoption - The platform’s built-in tools, such as
get_visual_inputwhen vision is enabled
next_step is removed until the gather completes, but change_context
isn’t. If the step sets valid contexts with
setValidContexts(), the model can switch contexts
before every question is answered. To keep the model in the step until the
gather completes, don’t set valid contexts on a gather step.
If a question needs to call out to a tool (e.g. validate an email, geocode
a ZIP), list that tool name in this question’s functions. Functions
listed here are active only for this question. Listing a function only
makes it callable: the platform doesn’t run it for you, and it can’t block
gather_submit. A validation tool works only when the model calls it and
acts on what it returns.
Parameters
opts
Question configuration object with the following fields:
opts.key
Key name for storing the answer in global_data. Must be unique within
this step’s gather questions.
opts.question
The question text to present to the caller.
opts.type
JSON schema type for the answer parameter.
"string"— text value"integer"— whole number value"number"— numeric value including decimals"boolean"— true or false value
opts.confirm
When true, the AI must confirm the answer with the caller before accepting it.
opts.prompt
Extra instruction text appended for this specific question.
opts.functions
Additional function names to make visible while asking this question.
Returns
Step — Self for method chaining. Throws an error if setGatherInfo()
has not been called first.