Answer questions about data
A request can change the view, run an allowed action, or return a message. A data question needs data evidence: column names alone cannot tell the model your sales total.
Use this guide after choosing read actions. Check data disclosure before sending results to a model.
Questions, choices and result evidence
Section titled “Questions, choices and result evidence”An interpreter receives an AiViewRequest and AbortSignal, and returns one complete result. Supported results are a filter/sort command, a registered typed action, an answer, a clarification, or unsupported feedback. No partial streamed result executes.
return { kind: 'clarification', message: 'Which region should I show?', choices: [ { label: 'Europe', prompt: 'Show only Europe' }, { label: 'Asia', prompt: 'Show only Asia' }, ],};Choices use the existing suggestion controls; labels and submitted prompts can differ. At most five choices are accepted, with labels up to 100 characters and prompts up to 500. Legacy suggestions: string[] also works. An answer is simply { kind: 'answer', message: '…' }; it does not apply a view or add a step.
Metadata can answer “Which columns can I sort?”. Answering “What is the total amount?” requires a permitted data operation and evidence. Opt into a single follow-up for aggregates. This example reuses interpret from the API-client setup:
grid.aiAssistant = { interpret, // Your API-client adapter from the quick start. gridActions: { readRows: true }, answerFromAction: { select(action, result) { return action.name === 'grid.aggregate' ? result.data : undefined; }, maxBytes: 8192, },};The second request has answerOnly: true, evidence: { action, data } and no available actions. The interpreter may return only terminal answer/clarification/unsupported feedback; it cannot execute another operation. Evidence must be strict JSON, bounded to 8 KiB by default and 16 KiB maximum. Prepared writes never trigger this extra call. Stop and stale-state checks still apply; failed summarization retains the original action result. Evidence is discarded after the turn, although opt-in conversation may retain the visible answer.
Your backend must separately allow the evidence action. The reference service permits grid.aggregate only. Each follow-up is another HTTP/model request and consumes another quota reservation. This is a bounded two-call workflow, with no autonomous action loop or automatic retries.
For your own model adapter, createAiViewResponseSchema(fields, descriptors) supplies structured-output JSON Schema. Runtime validation also checks allowed fields/operators, scalar types, complexity, action inputs and response shape. Application business terms such as “overdue” belong in your interpreter context.