The CreatorCon Call for Content is officially open! Get started here.

Document extraction in JSON format

DhathriC
Giga Contributor

I have given instruction to extract data from Invoice PDF. I'm not getting any output. Any guidance is appreciated.

  [

      'system',

      `You read invoice documents and return the information as a structured JSON. Use as many item lines as necessary. Output your answer as JSON that

    matches the given schema: \n{schema}\n.`,

    ],


const schema = `

  {

    invNum: string - 'The Invoice Number',

    invDate: string - 'The Date the Invoice Was Created',

    tax: number - 'Total Tax on the invoice can be 0',

    invTotal: number - 'Total Value of the invoice',

    freight: number - 'Freight or Shipping Charges on Invoice',

    supplier: {

      name: string - 'The Name of the Invoice Supplier',

      addr1: string - 'The Street of the Invoice Supplier',

      city: string - 'The City of the Invoice Supplier',

      state: string - 'The State of the Invoice Supplier',

      zip: string - 'The Zip Code of the Invoice Supplier',

      phone: string - 'The Phone of the Invoice Supplier',

      email: string - 'The Email of the Invoice Supplier',

      acctNum: string - 'The Account Number of the Receiver',

      contactName: string - 'The Contact Name of the Supplier',

    },

    lineItems: [

      {

        supPartNum: string - 'Supplier Part Number',

        itemDescr: string - 'Description of the Item on the Invoice',

        uom: string - 'The Unit of Measurement per quantity, default to EA (each)',

        qty: number - 'The Quantity Ordered',

        unitPrice: number - 'The Price Per Unit',

        extPrice: number - 'The Total of the Item',

      }

    ],

  }`;

0 REPLIES 0