addGatherQuestion
Add a question to this step’s gather_info configuration.
setGatherInfo()
must be called before this method.
Gather mode locks function access. While the model is asking gather questions, the runtime forcibly deactivates all of the step’s other functions. The only callable tools during a gather question are:
gather_submit(the native answer-submission tool)- Whatever names you list in this question’s
functionsoption
next_step and change_context are also filtered out — the model
cannot navigate away until the gather completes. 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.
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.