Extract field values from a document
/extract
Extracts one field (question) or multiple fields (fields) from state or
attached documents, returning the exact text from the document along with its
character offsets (start, end). Values are copied directly from the source,
never paraphrased or generated.
Body Parameters
fields: optional array of string
Several fields at once; the response maps each to its value.
question: optional string
One field to extract, e.g. "termination notice period".
state: optional string
The document text. Documents add to it.
Returns
Extract field values from a document
curl https://api.articul8.ai/bivia/extract \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $A8_API_KEY" \
-d '{}'
{
"type": "extract",
"field": "termination notice period",
"value": "60 days",
"start": 47,
"end": 54,
"confidence": 0.94,
"found": true,
"grounded": true,
"input_tokens": 24,
"image_tokens": 0,
"billable_tokens": 1000
}Returns Examples
{
"type": "extract",
"field": "termination notice period",
"value": "60 days",
"start": 47,
"end": 54,
"confidence": 0.94,
"found": true,
"grounded": true,
"input_tokens": 24,
"image_tokens": 0,
"billable_tokens": 1000
}