documents.ground finds supplied text in a document and returns source
locations. Use it to connect a value or quote back to evidence.
Basic usage
Method signature
Parameters
Returns
AJob. After success, job.result is a GroundResult:
Define targets
Every target needs an ID and the text to locate:id, not
by quoted text.
Disambiguate repeated text
Add nearby context withhint:
Match by meaning (deprecated)
semantic is deprecated for now. Don’t rely on it: a target with
semantic: true can come back with status failed and error
semantic_mode_deprecated. Quote the text exactly as it appears in the source.
Select a worksheet
Usesheet to narrow a workbook target to one tab:
sheet is ignored for non-spreadsheet sources.
Configure matching
minimum_semantic_score does not affect exact or normalized matches.
require_visual_region exists in the model but is not supported by the
current runtime; do not enable it.
Response structure
Each target has an independent outcome:not_found is a successful answer about the document; the job itself remains
succeeded. failed means that target encountered an error.
Matches are sorted best-first:
Location types
The location model follows the source:Ground response format
Review target status, ranking, match methods, locator fields, and related artifacts.
Preview visual matches
jobs.groundCrop to fetch the bytes through the SDK:
Reuse a parse
Complete example
Error handling
not_found and failed statuses.
Common request errors include an empty target list, more than 30 targets, an
unsupported option, or a source the current grounding path cannot read.
Best practices
Use exact source text
Quote the text as written. Semantic matching is deprecated for now.
Add nearby context
Use
hint to rank the intended occurrence when a quote repeats.Join on target ID
Treat the caller-defined ID as the stable key between request and response.
Handle not_found
A missing quote is a successful document-level answer, not an exception.