Perception
Extract
nace extract https://example.com/invoice.pdf --schema invoice.schema.json -o result
nace extract job:<parse job id> --schema-id sch_... --schema-version 2| Flag | What it does |
|---|---|
-s, --schema SCHEMA | The fields to extract, as a JSON Schema: a file path, @FILE, inline JSON, or -. |
--schema-id ID | A saved schema (sch_...) instead, at its latest version. |
--schema-version N | With --schema-id, use version N. |
--instructions TEXT | Extra guidance for filling the fields. |
--no-citations | Don't say where each field was read: sends citations.enabled: false, keeping the rest of citations. |
Pass exactly one of -s and --schema-id, or name the schema as schema or schema_id in --options. A flag replaces any schema the options name. Neither, both flags, both schema and schema_id in the options, or --schema-version without --schema-id exits 2. Drex has no route that only checks a schema, so there is no --validate: a schema the document service refuses fails the create with 422, before any job.
{
"type": "object",
"properties": {
"invoice_number": { "type": "string" },
"total": { "type": "number" }
},
"required": ["invoice_number", "total"]
}Point it at a finished parse to avoid parsing, and paying for, the document twice:
nace parse https://example.com/invoice.pdf -o id
# 6f1a2b3c-...
nace extract job:6f1a2b3c-... --schema invoice.schema.jsonSee Extract.