Define a custom extraction schema
mainA schema is an array of objects that defines the structure of the data you want to extract. Each object must include:
name: The field name to extract.type: The data type (e.g.,"string","number","array","object","boolean", or"enum").description: A description of the field to guide the AI.children(optional): An array of nested field objects, used for"array"or"object"types.
const schema = [
{
name: "accountNumber",
type: "string",
description: "The account number of the bank statement."
},
{
name: "transactions",
type: "array",
description: "List of transactions in the account.",
children: [
{
name: "date",
type: "string",
description: "Transaction date."
}
]
}
];