search.qa asks one question about a workspace as one turn of a conversation.
It returns a Job whose result is an AutomaticAgentResult. Every turn runs
the automatic search agent on its own: it finds what the turn needs itself, read
in the light of the conversation, through a navigator over the workspace’s files,
sections and pages (or, for a workspace in a bring-your-own bucket or customer
storage, by searching it), then reads documents, queries tables, and selects
documents from the metadata catalog until it can answer. Files must already be
ingested.
A conversation
Clarifying questions
On a genuinely ambiguous question the agent may ask back instead of answering:answer.clarification_questions lists the questions and answer.answer is
None. Reply in the same conversation:
allow_clarification=False to have every turn answer under the agent’s
best reading, stated in the answer.
Structured answers
Passoutput_schema (a JSON Schema dict or a Pydantic model class, under the
same rules as automatic search’s)
to get a turn’s answer as JSON. On success answer.answer is the JSON text and
answer.structured_answer the parsed value, None if the answer still missed
the schema after the run’s corrections. A field the source does not state comes back None, whatever type the schema gives
it, so declare such fields optional in a Pydantic model you validate into.
The schema applies to the turn that sends it, not to the conversation. To
keep structured answers across a conversation, send it on every turn,
including the one that carries clarification_answers. A turn that asks
clarifying questions returns them with structured_answer set to None.
Method signature
Parameters
Returns
AJob. On success, job.result is an AutomaticAgentResult
(result_type="automatic_agent"): answer, a DeepSearchV2Result with the
answer, evidences (its citations), sql_receipts, session_id and any
clarification_questions; and catalog, a FilteredSearchResult present when the agent answered from the
metadata catalog. A catalog table’s next_cursor pages through
client.search.filtered_page.
A QA answer comes back without Ground jobs: answer.grounding_job_ids is
None. To locate its quotes, run client.documents.ground yourself on
answer.evidences, one job per file, as in
Quote locations.