Skip to main content
An analyst fills one template from 300 sustainability reports. The worst thing a tool can do is put a plausible number in a cell that the report never stated. fill_schema fills a field only where the source states the value, returns the words the value came from, and tells an empty field apart from a part of the source that was not read.
A model does this work, and the response says so. What the model can return is bound to the source: each value comes with its words and its place.

Send your fields

Describe the fields as a JSON Schema whose root is an object. Send it with the id of a record, which is the copy of a source that getclean stores after a fetch or an upload. This request sends a template of 6 fields for a company’s quarterly report.
Replace CONTENTS_ID with the id of a record.

Read each value with its words

The response has the values in the shape of your schema, and beside them one status for each field. This response is cut to those 2 parts.
200 OK
Of the 6 fields, 3 are filled, and text has the words of the source that each was taken from. A status also says where those words are: the section and the block, on a document the page, and inside a table the row and the column. A reviewer can open each cell of your template at its place in the source. The other 3 fields are not in schema_values at all, and each says why. The report shows the operating margin without a value. It says nothing about a dividend. And the auditor could be named in a part of the document that was not read. No plausible value was put into any of them.

Know why a field is empty

A status says which of 5 things happened. The difference between absent and unread decides what a report can say. “The company does not disclose its scope 3 emissions” is a finding, and it rests on absent. With unread it would be a guess, because the pages where the figure could be were not read.
A field that is absent on a web page can still be on the page, outside its main content. If the record’s left_out is not empty, fill the schema again with scope set to whole_page.

Fill the fields while you fetch

fetch_contents and upload_contents take the same json_schema, so one call can fetch a source and fill your fields. A search takes it for the results that it fetches, in contents.json_schema, so one search can return a filled row for each of its first results.

Check what a fill costs

A fill costs one model step. The key needs the scope contents:model. A request that sends deterministic_only as true cannot ask for a fill, because a fill is the work of a model.