{"file_name": "images/Insurance_2.png", "id": 0, "metadata": "{\"format\": \"INSURANCE\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"Insurance_2.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"insurance_company_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the insurance company or carrier that issued the insurance document.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - header, body, footer, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: Insurance company name typically appears prominently in the header/logo area at the top of the document.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the header area with the company logo.; Within the first 10-20% of page height, centered or left-aligned.; May appear in larger, bold font near the document title.; Often appears with the insurance company logo or branding.; May also appear in footer, letterhead, or contact sections.\\n\\nFORMAT: Return the insurance company name as it appears on the document. Common formats: 'State Farm', 'Allstate', 'Progressive', 'Geico', 'Blue Cross Blue Shield', 'UnitedHealthcare'. Preserve capitalization and abbreviations. Prefer the brand/company name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'State Farm Mutual Automobile Insurance Company' and 'State Farm'), prefer the shorter brand name if clear.\\n - Insurance company names may include designations like 'Insurance Company', 'Insurance Group', etc. - preserve as shown or extract the core brand name.\\n - If the company name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n - Search ALL pages and ALL sections - company name may appear in header, footer, contact info, or policy details sections.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'STATE FARM' in large header text -> extract 'STATE FARM' or 'State Farm'\\n \\u2713 Document shows 'Allstate Insurance Company' in header -> extract 'Allstate' or 'Allstate Insurance Company'\\n \\u2713 Document shows 'Blue Cross Blue Shield' -> extract 'Blue Cross Blue Shield'\\n\\nAVOID:\\n \\u2717 Do NOT extract policyholder names as the insurance company name\\n \\u2717 Do NOT extract agent names or agency names as the insurance company name\\n \\u2717 Do NOT extract policy numbers or other identifiers as the company name\"}, \"policy_type\": {\"type\": \"string\", \"datapoint_prompt\": \"The type of insurance policy (e.g., 'Auto', 'Home', 'Life', 'Health', 'Renters', 'Commercial').\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, headers, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Policy Type', 'Type', 'Coverage Type', 'Insurance Type', 'Product', 'Policy:', 'Coverage'\\n\\nLOCATION: Typically in the policy information section, often near the policy number.; May appear in the header area or in a dedicated policy details section.; May appear in summary boxes or policy declarations.; Look for policy type designations in ALL sections of the document.\\n\\nFORMAT: Return the policy type exactly as it appears on the document. Common values:\\n - 'Auto', 'Automobile', 'Vehicle'\\n - 'Home', 'Homeowners', 'Homeowner'\\n - 'Life', 'Life Insurance'\\n - 'Health', 'Health Insurance', 'Medical'\\n - 'Renters', 'Renters Insurance'\\n - 'Commercial', 'Business'\\n - 'Umbrella', 'General Liability'\\nPreserve the exact format and capitalization as shown.\\n\\nEDGE CASES:\\n - Policy types may be abbreviated or spelled out - preserve as shown.\\n - Some documents show policy types as part of policy numbers or descriptions - extract the type designation.\\n - Multiple policy types may be combined (e.g., 'Auto and Home') - extract as shown.\\n - Search ALL sections - policy type may appear in headers, policy declarations, coverage summaries, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Policy Type: Auto' -> extract 'Auto'\\n \\u2713 Text shows 'Coverage: Homeowners Insurance' -> extract 'Homeowners Insurance' or 'Homeowners'\\n \\u2713 Text shows 'Policy: Life' -> extract 'Life'\\n\\nAVOID:\\n \\u2717 Do NOT extract policy numbers or policy IDs as policy types\\n \\u2717 Do NOT extract coverage limits or amounts as policy types\"}, \"policy_number\": {\"type\": \"string\", \"datapoint_prompt\": \"The insurance policy number, quote number, or policy identifier.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, headers, body, footer, all pages. Extract this field if it appears ANYWHERE on the document. Policy/quote numbers are key identifiers and may appear multiple times.\\n\\nCOMMON LABELS: 'Policy Number', 'Policy No.', 'Policy #', 'Policy ID', 'Policy', 'Quote Number', 'Quote No.', 'Quote #', 'Policy Number:', 'Policy #:', 'Quote Number:'\\n\\nLOCATION: Typically in the policy information section, often near the policy type and policyholder information.; May appear in the header area or in a dedicated policy details section.; Usually prominently displayed as it's a key identifier.; Look for policy/quote numbers in the policy information area, headers, footers, and ALL sections of the document.; May appear on every page.\\n\\nFORMAT: Return the policy/quote number exactly as it appears on the document. Policy/quote numbers may be numeric, alphanumeric, or include dashes/spaces. Preserve any formatting, dashes, spaces, or special characters as shown. If the policy/quote number appears in multiple places, use the one in the main policy information section.\\n\\nEDGE CASES:\\n - Policy/quote numbers vary by insurance company - preserve the exact format.\\n - Policy/quote numbers may include dashes, spaces, or other separators (e.g., 'POL-123456', '123 456 789', '46023655-04') - preserve as shown.\\n - For quote documents, extract the quote number as the policy number.\\n - Policy/quote numbers may appear in multiple places - extract from the main policy information section if available, otherwise use the first clear instance found.\\n - Do not confuse with claim numbers, certificate numbers, or other identifiers.\\n - Search ALL pages and ALL sections - policy/quote numbers are often repeated for reference.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Policy Number: 123456789' -> extract '123456789'\\n \\u2713 Text shows 'Policy #: POL-123-456' -> extract 'POL-123-456'\\n \\u2713 Text shows 'Quote Number: 46023655-04' -> extract '46023655-04'\\n \\u2713 Text shows 'Policy: 123 456 789' -> extract '123 456 789'\\n\\nAVOID:\\n \\u2717 Do NOT extract claim numbers as policy numbers\\n \\u2717 Do NOT extract certificate numbers as policy numbers\\n \\u2717 Do NOT extract group numbers or member IDs as policy numbers\\n \\u2717 Do NOT extract account numbers as policy numbers\"}, \"policyholder_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the policyholder (the person or entity covered by the insurance policy).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, headers, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Policyholder', 'Insured', 'Named Insured', 'Policyholder Name', 'Insured Name', 'Name', 'Policyholder:', 'Insured:'\\n\\nLOCATION: Typically in the policyholder information section, often near the policy number.; May appear in the header area or in a dedicated policy details section.; Usually in the upper portion of the document.; Look for policyholder names in the policy information area, declarations page, and ALL sections of the document.\\n\\nFORMAT: Return the policyholder name exactly as it appears on the document. Common formats:\\n - Full name: 'John Doe'\\n - With middle name/initial: 'John Michael Doe' or 'John M. Doe'\\n - Last name first: 'Doe, John'\\n - Business/entity names: 'ABC Corporation', 'XYZ LLC'\\nPreserve capitalization, punctuation, and formatting (including middle names/initials, suffixes, entity designations, etc.).\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Some documents show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Names may be in all uppercase on insurance documents - preserve the capitalization.\\n - Business/entity names may include legal designations (LLC, Inc., Corp.) - preserve as shown.\\n - If name appears in multiple places, prefer the one in the main policyholder information section, but extract from ANY location if the main section doesn't have it.\\n - Search ALL pages - policyholder name may appear in headers, declarations, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Policyholder: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Insured: DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Named Insured: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n \\u2713 Text shows 'Policyholder: ABC Corporation, Inc.' -> extract 'ABC Corporation, Inc.'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract agent names or insurance company names as policyholder names\\n \\u2717 Do NOT extract beneficiary names as policyholder names\"}, \"policy_effective_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the insurance policy becomes effective (starts) in YYYY-MM-DD format.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, declarations, headers, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Effective Date', 'Policy Effective Date', 'Effective', 'Inception Date', 'Start Date', 'Policy Start Date', 'Effective Date:', 'Inception'\\n\\nLOCATION: Typically in the policy information section, often near the policy number and expiration date.; May appear in a policy details box or summary section.; May appear in declarations page or policy declarations section.; Look for effective date or inception date in the policy information area, declarations, and ALL sections of the document.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/01/2024' -> '2024-01-01')\\n - M/D/YYYY (e.g., '1/1/2024' -> '2024-01-01')\\n - MM-DD-YYYY (e.g., '01-01-2024' -> '2024-01-01')\\n - Month DD, YYYY (e.g., 'January 1, 2024' -> '2024-01-01')\\n - Mon DD, YYYY (e.g., 'Jan 1, 2024' -> '2024-01-01')\\nIf year is two digits, expand appropriately. If effective date is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Effective date should be before or equal to the expiration date.\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Search ALL pages - effective date may appear in declarations, policy summary, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Effective Date: 01/01/2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'Policy Effective: January 1, 2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'Inception: 1/1/24' -> extract '2024-01-01'\\n\\nAVOID:\\n \\u2717 Do NOT extract expiration dates as effective dates\\n \\u2717 Do NOT extract renewal dates or other dates as effective dates\"}, \"policy_expiration_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the insurance policy expires (ends) in YYYY-MM-DD format.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, declarations, headers, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Expiration Date', 'Policy Expiration Date', 'Expires', 'Expiration', 'End Date', 'Policy End Date', 'Expiration Date:', 'Expires:'\\n\\nLOCATION: Typically in the policy information section, often near the policy number and effective date.; May appear in a policy details box or summary section.; May appear in declarations page or policy declarations section.; Look for expiration date or end date in the policy information area, declarations, and ALL sections of the document.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If expiration date is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Expiration date should be after or equal to the effective date.\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Search ALL pages - expiration date may appear in declarations, policy summary, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Expiration Date: 12/31/2024' -> extract '2024-12-31'\\n \\u2713 Text shows 'Expires: December 31, 2024' -> extract '2024-12-31'\\n \\u2713 Text shows 'Policy End Date: 12/31/24' -> extract '2024-12-31'\\n\\nAVOID:\\n \\u2717 Do NOT extract effective dates as expiration dates\\n \\u2717 Do NOT extract renewal dates or other dates as expiration dates\"}, \"premium_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The premium amount (cost of the insurance policy) for the coverage period.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - billing sections, policy summaries, declarations, payment information, all pages. Extract this field if it appears ANYWHERE on the document. Look for premium amounts in billing sections, policy declarations, summary boxes, and payment areas.\\n\\nCOMMON LABELS: 'Premium', 'Premium Amount', 'Total Premium', 'Annual Premium', 'Premium Due', 'Amount', 'Premium:', 'Total Premium:'\\n\\nLOCATION: Typically in a billing or premium section, often near payment information.; May appear in a policy summary or billing details section.; May appear in declarations page, policy declarations, or premium summary sections.; Look for premium amounts in billing or payment areas, policy summaries, and ALL sections of the document.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$1,200.00' -> 1200.00, '$500.00' -> 500.00). If premium amount is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Premium amounts may be annual, semi-annual, quarterly, or monthly - extract as shown (the amount, not the period).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n - If multiple premium amounts appear (e.g., annual and monthly), prefer the total/annual premium.\\n - Search ALL pages and ALL sections - premium may appear in billing section, declarations, payment info, or summary boxes.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Premium: $1,200.00' -> extract 1200.00\\n \\u2713 Text shows 'Annual Premium: $500.00' -> extract 500.00\\n \\u2713 Text shows 'Total Premium: $2,400.00' -> extract 2400.00\\n\\nAVOID:\\n \\u2717 Do NOT extract deductible amounts as premium amounts\\n \\u2717 Do NOT extract coverage limits as premium amounts\\n \\u2717 Do NOT extract claim amounts as premium amounts\"}, \"coverage_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The primary coverage amount or policy limit (maximum amount the policy will pay). Extract the PRIMARY or TOTAL coverage amount when multiple coverage types exist.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - coverage sections, policy declarations, coverage summaries, all pages. Extract this field if it appears ANYWHERE on the document. Look for coverage amounts in coverage sections, declarations, policy summaries, and coverage detail sections.\\n\\nEXTRACTION PRIORITY (when multiple coverage amounts exist):\\n1. If a single 'Total Coverage' or aggregate amount is shown, extract that value.\\n2. If multiple coverage types exist (e.g., Liability, Medical Payments, Uninsured Motorists for auto; Dwelling, Personal Property, Liability for homeowners), extract the PRIMARY coverage amount:\\n - For AUTO insurance: Extract the LIABILITY coverage amount (the main coverage limit, typically the largest)\\n - For HOMEOWNERS insurance: Extract the DWELLING coverage amount (Coverage A - the primary property coverage)\\n - For LIFE insurance: Extract the death benefit amount\\n3. If only one coverage amount is shown, extract that value.\\n4. If no clear primary/total coverage amount can be determined, return null.\\n\\nCOMMON LABELS: 'Coverage Amount', 'Policy Limit', 'Coverage Limit', 'Limit', 'Total Coverage', 'Coverage', 'Liability Limit', 'Death Benefit' (for life insurance), 'Coverage A' (for homeowners), 'Dwelling'\\n\\nLOCATION: Typically in a coverage or policy details section.; May appear in a policy summary or coverage summary section.; May appear in declarations page or policy declarations.; Look for coverage amounts or policy limits in the coverage information area, declarations, summaries, and ALL sections of the document.\\n\\nFORMAT: Return a numeric value with appropriate precision. Handle units appropriately (e.g., if shown as '$500K' or '500 thousand', convert to numeric: 500000.00).\\n\\nEDGE CASES:\\n - Coverage amounts may be shown in thousands, millions, or actual currency - convert appropriately.\\n - For auto insurance with multiple coverage types: Extract the Liability coverage amount (e.g., '$100,000 each accident')\\n - For homeowners insurance: Extract the Dwelling coverage amount (Coverage A, e.g., '$202,871')\\n - If multiple coverage amounts exist but no clear primary/total is shown, extract the largest or most prominent coverage amount.\\n - Search ALL pages - coverage amounts may appear in declarations, coverage summaries, or policy details sections.\\n\\nEXAMPLES:\\n \\u2713 Auto insurance shows 'A. Liability: $100,000 each accident' -> extract 100000.00 (Liability is primary)\\n \\u2713 Homeowners shows 'Coverage A: Dwelling: $202,871' -> extract 202871.00 (Dwelling is primary)\\n \\u2713 Text shows 'Total Coverage: $1,000,000' -> extract 1000000.00\\n \\u2713 Text shows 'Coverage Amount: $500,000' -> extract 500000.00\\n\\nAVOID:\\n \\u2717 Do NOT extract premium amounts as coverage amounts\\n \\u2717 Do NOT extract deductible amounts as coverage amounts\\n \\u2717 Do NOT extract claim amounts as coverage amounts\"}, \"deductible_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The primary deductible amount (amount the policyholder must pay before insurance coverage begins). Extract the PRIMARY deductible when multiple deductibles exist.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - coverage sections, policy declarations, coverage summaries, deductible information sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nEXTRACTION PRIORITY (when multiple deductibles exist):\\n1. If a single 'Deductible' or 'Annual Deductible' amount is shown, extract that value.\\n2. If multiple deductibles exist for different coverage types:\\n - For AUTO insurance: Extract the COLLISION or PRIMARY property damage deductible (typically the most common/main deductible, e.g., '$100' for Collision)\\n - For HOMEOWNERS insurance: Extract the 'All Other Perils' or primary deductible (e.g., '$2,500' for All Other Perils)\\n - If deductibles are the same across coverages, extract that common amount.\\n3. Prefer annual/per-occurrence deductibles over per-incident deductibles when both exist.\\n4. If no deductible is shown, return null.\\n\\nCOMMON LABELS: 'Deductible', 'Deductible Amount', 'Deductible:', 'Annual Deductible', 'Per Occurrence Deductible', 'All Other Perils' (for homeowners), 'Collision Deductible' (for auto)\\n\\nLOCATION: Typically in a coverage or policy details section.; May appear in a policy summary or coverage summary section.; May appear in declarations page or policy declarations.; Look for deductible amounts in the coverage information area, declarations, summaries, and ALL sections of the document.\\n\\nFORMAT: Return a numeric value with two decimal places, no currency symbol and no thousands separators. If deductible amount is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Deductibles may be per occurrence, per claim, or annual - extract the amount shown.\\n - For auto insurance with Collision and Other Than Collision deductibles (often the same, e.g., both $100), extract that common amount.\\n - For homeowners with 'All Other Perils' deductible, extract that value (e.g., '$2,500').\\n - If multiple deductibles exist with different values, extract the PRIMARY one (Collision for auto, All Other Perils for homeowners).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n - Search ALL pages - deductible may appear in declarations, coverage summaries, or policy details sections.\\n\\nEXAMPLES:\\n \\u2713 Auto insurance shows 'Collision Loss: ACV minus $100 Deductible' -> extract 100.00 (primary collision deductible)\\n \\u2713 Homeowners shows 'All Other Perils: $2,500' -> extract 2500.00 (primary deductible)\\n \\u2713 Text shows 'Annual Deductible: $1,000.00' -> extract 1000.00\\n \\u2713 Text shows 'Deductible: $500.00' -> extract 500.00\\n\\nAVOID:\\n \\u2717 Do NOT extract premium amounts as deductible amounts\\n \\u2717 Do NOT extract coverage amounts as deductible amounts\\n \\u2717 Do NOT extract out-of-pocket maximums as deductible amounts\"}, \"agent_name\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The name of the insurance agent or agent/broker who sold or manages the policy (if shown).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - agent information sections, headers, footers, contact sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Agent', 'Agent Name', 'Producer', 'Broker', 'Agent:', 'Producer Name', 'Representative'\\n\\nLOCATION: Typically in an agent information section, often near contact information.; May appear in the header, footer, or contact section.; May appear in policy declarations or agent information boxes.; Look for agent names in agent/contact information areas, headers, footers, and ALL sections of the document.\\n\\nFORMAT: Return the agent name exactly as it appears. May be a person's name or an agency name. Preserve capitalization and formatting. If agent name is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Agent names may be individual names or agency/brokerage names - extract as shown.\\n - Some documents show agent contact information without names - return null if name is not shown.\\n - Search ALL pages - agent name may appear in headers, footers, contact sections, or policy declarations.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Agent: John Smith' -> extract 'John Smith'\\n \\u2713 Text shows 'Producer: ABC Insurance Agency' -> extract 'ABC Insurance Agency'\\n \\u2713 Text shows no agent name -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract policyholder names as agent names\\n \\u2717 Do NOT extract insurance company names as agent names\"}, \"policyholder_address\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The address of the policyholder (if shown on the insurance document).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policyholder information sections, policy declarations, contact sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Address', 'Mailing Address', 'Policyholder Address', 'Insured Address', 'Billing Address', 'Residence Address'\\n\\nLOCATION: Typically in the policyholder information section, often near the policyholder name.; May appear in a policy details or contact section.; May appear in declarations page or policy declarations.; Look for addresses in the policyholder information area, declarations, contact sections, and ALL sections of the document.\\n\\nFORMAT: Return the complete address as it appears on the document. Common formats: '123 Main St, City, State ZIP' or multi-line addresses. Preserve the format as shown, or join multi-line addresses with commas. If policyholder address is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Some documents show only city and state - extract as shown.\\n - Addresses may include country - include if shown.\\n - Search ALL pages - address may appear in declarations, policyholder info sections, or contact areas.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Address: 123 Main St, Anytown, CA 12345' -> extract '123 Main St, Anytown, CA 12345'\\n \\u2713 Text shows 'Mailing Address:\\\\n123 Main Street\\\\nAnytown, CA 12345' -> extract '123 Main Street, Anytown, CA 12345'\\n\\nAVOID:\\n \\u2717 Do NOT extract agent addresses as policyholder addresses\\n \\u2717 Do NOT extract insurance company addresses as policyholder addresses\"}, \"issue_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the insurance document was issued (for quotes, binders, or policy documents) in YYYY-MM-DD format.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - headers, policy information sections, declarations, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Issue Date', 'Date Issued', 'Issued Date', 'Date', 'Quote Date' (for quotes), 'Binder Date' (for binders), 'Issue Date:', 'Date Issued:'\\n\\nLOCATION: Typically in the header area or policy information section, often near the effective date or policy number.; May appear in a policy details box or summary section.; May appear in declarations page or document header.; Look for issue dates in headers, policy information areas, declarations, and ALL sections of the document.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '12/14/2020' -> '2020-12-14')\\n - M/D/YYYY (e.g., '12/14/2020' -> '2020-12-14')\\n - MM-DD-YYYY (e.g., '12-14-2020' -> '2020-12-14')\\n - Month DD, YYYY (e.g., 'December 14, 2020' -> '2020-12-14')\\n - Mon DD, YYYY (e.g., 'Dec 14, 2020' -> '2020-12-14')\\nIf year is two digits, expand appropriately. If issue date is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Issue date is typically the date the document was created/issued, which may be different from the effective date.\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Search ALL pages - issue date may appear in headers, declarations, policy summary, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Issue Date: 12/14/2020' -> extract '2020-12-14'\\n \\u2713 Text shows 'Date Issued: December 14, 2020' -> extract '2020-12-14'\\n \\u2713 Text shows 'Quote Date: 12/14/20' -> extract '2020-12-14'\\n\\nAVOID:\\n \\u2717 Do NOT extract effective dates as issue dates\\n \\u2717 Do NOT extract expiration dates as issue dates\\n \\u2717 Do NOT extract renewal dates as issue dates\"}, \"sub_broker_name\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The name of the sub-broker or sub-agent (if shown on the insurance document). This is typically a secondary broker or agent involved in the policy transaction.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - broker information sections, headers, footers, contact sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Sub-Broker', 'Sub-Broker Name', 'Sub Broker', 'Sub-Agent', 'Sub Agent', 'Sub-Broker:', 'Sub Broker:'\\n\\nLOCATION: Typically in a broker or agent information section, often near the main broker/agent name.; May appear in the header, footer, or contact section.; May appear in policy declarations or broker information boxes.; Look for sub-broker names in broker/agent information areas, headers, footers, and ALL sections of the document.\\n\\nFORMAT: Return the sub-broker name exactly as it appears. May be a person's name or an agency name. Preserve capitalization and formatting. If sub-broker name is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Sub-broker names may be individual names or agency/brokerage names - extract as shown.\\n - Some documents show sub-broker contact information without names - return null if name is not shown.\\n - Search ALL pages - sub-broker name may appear in headers, footers, contact sections, or policy declarations.\\n - Not all documents will have a sub-broker - return null if not present.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Sub-Broker: American Ins. Brokers' -> extract 'American Ins. Brokers'\\n \\u2713 Text shows 'Sub Broker: ABC Insurance Agency' -> extract 'ABC Insurance Agency'\\n \\u2713 Text shows no sub-broker name -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract main broker/agent names as sub-broker names\\n \\u2717 Do NOT extract policyholder names as sub-broker names\\n \\u2717 Do NOT extract insurance company names as sub-broker names\"}, \"coverage_breakdown\": {\"type\": [\"array\", \"null\"], \"description\": \"Detailed breakdown of all coverage types and their amounts. Extract ALL coverage types shown on the document (e.g., Dwelling, Personal Property, Liability, Medical Payments, etc.).\", \"items\": {\"type\": \"object\", \"properties\": {\"coverage_type\": {\"type\": \"string\", \"description\": \"The type or name of the coverage (e.g., 'Dwelling', 'Personal Property', 'Personal Liability', 'Medical Payments to Others', 'Other Structures', 'Loss Of Use', 'Loss Assessment Coverage'). Extract the exact coverage type name as it appears on the document, including coverage letters if shown (e.g., 'Coverage A: Dwelling' -> 'Coverage A: Dwelling' or 'Dwelling').\"}, \"amount\": {\"type\": \"number\", \"description\": \"The coverage amount or limit for this coverage type. Return as a numeric value with no currency symbol and no thousands separators (e.g., '$202,871' -> 202871.0, '$3,700' -> 3700.0).\"}}, \"required\": [\"coverage_type\", \"amount\"]}, \"datapoint_prompt\": \"A detailed breakdown of ALL coverage types and their amounts shown on the insurance document. Extract EVERY coverage type listed in the coverage section (e.g., Coverage A: Dwelling, Coverage B: Other Structures, Coverage C: Personal Property, Coverage D: Loss Of Use, Coverage E: Personal Liability, Coverage F: Medical Payments to Others, Loss Assessment Coverage, etc.).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - coverage sections, policy declarations, coverage summaries, all pages. Extract ALL coverage types if they appear ANYWHERE on the document.\\n\\nCOMMON LABELS: Coverage sections are typically labeled as 'Coverage Part', 'Coverage', 'Coverages', 'Policy Coverage', 'Coverage Breakdown', or individual coverage types like 'Coverage A: Dwelling', 'Coverage B: Other Structures', etc.\\n\\nLOCATION: Typically in a coverage or policy details section.; May appear in a policy summary or coverage summary section.; May appear in declarations page or policy declarations.; Look for coverage breakdowns in the coverage information area, declarations, summaries, and ALL sections of the document.\\n\\nFORMAT: Extract each coverage type as an object with 'coverage_type' (the name/type) and 'amount' (the numeric coverage limit). Return the coverage type name exactly as shown (e.g., 'Coverage A: Dwelling', 'Personal Property', 'Personal Liability'). Amount should be numeric with no currency symbol (e.g., 202871.0 for '$202,871').\\n\\nEDGE CASES:\\n - Some coverage types may show $0 - include them in the breakdown.\\n - Coverage types may be labeled with letters (Coverage A, B, C, etc.) - preserve these in the coverage_type name.\\n - Extract ALL coverage types shown, not just the primary one.\\n - Coverage amounts may be shown in thousands or actual currency - convert appropriately.\\n - Search ALL pages - coverage breakdown may appear in declarations, coverage summaries, or policy details sections.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'Coverage A: Dwelling - $202,871' -> {\\\"coverage_type\\\": \\\"Coverage A: Dwelling\\\", \\\"amount\\\": 202871.0}\\n \\u2713 Document shows 'Coverage B: Other Structures - $3,700' -> {\\\"coverage_type\\\": \\\"Coverage B: Other Structures\\\", \\\"amount\\\": 3700.0}\\n \\u2713 Document shows 'Personal Liability - $100,000' -> {\\\"coverage_type\\\": \\\"Personal Liability\\\", \\\"amount\\\": 100000.0}\\n \\u2713 Document shows 'Medical Payments to Others - $2,000' -> {\\\"coverage_type\\\": \\\"Medical Payments to Others\\\", \\\"amount\\\": 2000.0}\\n\\nAVOID:\\n \\u2717 Do NOT extract only the primary coverage - extract ALL coverage types\\n \\u2717 Do NOT extract premium amounts as coverage amounts\\n \\u2717 Do NOT extract deductible amounts as coverage amounts\"}}, \"required\": [\"insurance_company_name\", \"policy_type\", \"policy_number\", \"policyholder_name\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"policy_effective_date\", \"end_field\": \"policy_expiration_date\", \"max_days\": 366, \"message\": \"Policy expiration date should be within 366 days (approximately 1 year) after effective date\"}, {\"type\": \"date_comparison\", \"field1\": \"policy_effective_date\", \"field2\": \"policy_expiration_date\", \"comparison\": \"before_or_equal\", \"message\": \"Policy effective date should be before or equal to expiration date\"}]}}", "true_json_output": "{\"insurance_company_name\": \"Lexington Insurance Company\", \"policy_type\": \"HO3\", \"policy_number\": \"46023655-04\", \"policyholder_name\": \"Carrero, Joie Gonzalez, Maria\", \"policy_effective_date\": \"2021-01-30\", \"policy_expiration_date\": null, \"premium_amount\": 3492.0, \"coverage_amount\": 202871.0, \"deductible_amount\": 2500.0, \"agent_name\": \"CRC Insurance Services, Inc\", \"policyholder_address\": \"7855 SW 26th Street, Miami, FL 33155\", \"issue_date\": \"2020-12-14\", \"sub_broker_name\": \"American Ins. Brokers\", \"coverage_breakdown\": [{\"coverage_type\": \"Coverage A: Dwelling\", \"amount\": 202871.0}, {\"coverage_type\": \"Coverage B: Other Structures\", \"amount\": 3700.0}, {\"coverage_type\": \"Coverage C: Personal Property\", \"amount\": 46250.0}, {\"coverage_type\": \"Coverage D: Loss Of Use\", \"amount\": 18500.0}, {\"coverage_type\": \"Loss Assessment Coverage\", \"amount\": 1000.0}, {\"coverage_type\": \"Coverage E: Personal Liability\", \"amount\": 100000.0}, {\"coverage_type\": \"Coverage F: Medical Payments to Others\", \"amount\": 2000.0}], \"source_filename\": \"Insurance_2.pdf\"}", "true_markdown_output": "**Insurance Company Name:** Lexington Insurance Company\n**Policy Type:** HO3\n**Policy Number:** 46023655-04\n**Policyholder Name:** Carrero, Joie Gonzalez, Maria\n**Policy Effective Date:** 2021-01-30\n**Policy Expiration Date:** N/A\n**Premium Amount:** 3492.0\n**Coverage Amount:** 202871.0\n**Deductible Amount:** 2500.0\n**Agent Name:** CRC Insurance Services, Inc\n**Policyholder Address:** 7855 SW 26th Street, Miami, FL 33155\n**Issue Date:** 2020-12-14\n**Sub Broker Name:** American Ins. Brokers\n**Coverage Breakdown:**\n **Coverage Type:** Coverage A: Dwelling\n **Amount:** 202871.0\n **Coverage Type:** Coverage B: Other Structures\n **Amount:** 3700.0\n **Coverage Type:** Coverage C: Personal Property\n **Amount:** 46250.0\n **Coverage Type:** Coverage D: Loss Of Use\n **Amount:** 18500.0\n **Coverage Type:** Loss Assessment Coverage\n **Amount:** 1000.0\n **Coverage Type:** Coverage E: Personal Liability\n **Amount:** 100000.0\n **Coverage Type:** Coverage F: Medical Payments to Others\n **Amount:** 2000.0"} {"file_name": "images/Payslip_2.png", "id": 1, "metadata": "{\"format\": \"PAYSLIP\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"Payslip_2.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"employer_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the employer or company that issued the payslip.\\n\\nCOMMON LABELS: Employer name typically appears in the header/logo area at the top of the payslip.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the header area with the company logo.; Within the first 10-20% of page height, centered or left-aligned.; May appear in larger, bold font near the payslip title.; Often appears with the company name or business name.\\n\\nFORMAT: Return the employer name as it appears on the document. Common formats: 'ABC Corporation', 'Smith Manufacturing', 'City Public Schools', 'Healthcare System Inc.'. Preserve capitalization and abbreviations. Prefer the brand/company name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'ABC Corporation, Inc.' and 'ABC Corporation'), prefer the shorter brand name if clear.\\n - Employer names may include business designations, corporate structures, or department names - preserve as shown but prefer the main company name.\\n - If the employer name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'ABC CORPORATION' in large header text -> extract 'ABC CORPORATION' or 'ABC Corporation'\\n \\u2713 Document shows 'Smith Manufacturing, LLC' in header -> extract 'Smith Manufacturing' or 'Smith Manufacturing, LLC'\\n \\u2713 Document shows 'CITY PUBLIC SCHOOLS' -> extract 'CITY PUBLIC SCHOOLS' or 'City Public Schools'\\n\\nAVOID:\\n \\u2717 Do NOT extract mailing addresses or branch locations as the employer name\\n \\u2717 Do NOT extract department names (e.g., 'Human Resources Department') as the employer name unless that's the only identifier\\n \\u2717 Do NOT extract payroll service provider names as the employer name\"}, \"employee_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the employee who received the pay.\\n\\nCOMMON LABELS: 'Employee Name', 'Employee', 'Name', 'Employee:', 'Name:', 'Pay To', 'Payee'\\n\\nLOCATION: Top section of the first page, typically in the employee information section.; Often appears near the employee ID and other employee details.; May be in the upper-left or upper-center area.; Look for a labeled field with the employee's name.\\n\\nFORMAT: Return the employee name exactly as it appears on the document. Common formats:\\n - Full name: 'John Doe'\\n - With middle name/initial: 'John Michael Doe' or 'John M. Doe'\\n - Last name first: 'Doe, John'\\nPreserve capitalization, punctuation, and formatting (including middle names/initials, suffixes like Jr., Sr., etc.).\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Some payslips show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Names may be in all uppercase on payslips - preserve the capitalization.\\n - If name appears in multiple places, prefer the one in the main employee information section.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Employee Name: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Employee: DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Name: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n \\u2713 Text shows 'Employee Name: John M. Doe' -> extract 'John M. Doe'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract employer names as employee names\\n \\u2717 Do NOT extract department names or job titles as employee names\"}, \"employee_id\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The employee ID number or employee number assigned by the employer.\\n\\nCOMMON LABELS: 'Employee ID', 'Employee Number', 'Emp ID', 'Emp No.', 'Employee #', 'ID', 'Employee ID:', 'ID Number'\\n\\nLOCATION: Top section of the first page, typically in the employee information section.; Often appears near the employee name and other employee details.; May be in the upper-left or upper-center area.; Look for a labeled field with an employee identifier.\\n\\nFORMAT: Return the employee ID exactly as it appears on the document. Employee IDs may be numeric, alphanumeric, or include dashes. Preserve any formatting, dashes, or spacing as shown. If no employee ID is shown, return null.\\n\\nEDGE CASES:\\n - Employee IDs vary by employer - preserve the exact format.\\n - Employee IDs may include dashes or spaces (e.g., '12345', 'EMP-12345', '123 456') - preserve as shown.\\n - Some payslips may not show employee IDs - return null if not present.\\n - Do not confuse with Social Security numbers (SSN) or other identifiers.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Employee ID: 12345' -> extract '12345'\\n \\u2713 Text shows 'Emp ID: EMP-12345' -> extract 'EMP-12345'\\n \\u2713 Text shows 'Employee #: 123 456' -> extract '123 456'\\n \\u2713 Text shows no employee ID -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract Social Security numbers as employee IDs\\n \\u2717 Do NOT extract payroll numbers or check numbers as employee IDs\\n \\u2717 Do NOT extract account numbers or other identifiers as employee IDs\"}, \"pay_period_start\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The start date of the pay period in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Pay Period', 'Period', 'From', 'From Date', 'Pay Period From', 'Period Start', 'Pay Period Start', 'Start Date'\\n\\nLOCATION: Typically in the pay period information section, often near the pay date.; May appear in the upper portion of the payslip.; Often appears as a date range (e.g., 'Pay Period: 01/01/2024 - 01/15/2024').; Look for labels like 'Pay Period', 'From', or date ranges.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/01/2024' -> '2024-01-01')\\n - M/D/YYYY (e.g., '1/1/2024' -> '2024-01-01')\\n - MM-DD-YYYY (e.g., '01-01-2024' -> '2024-01-01')\\n - Month DD, YYYY (e.g., 'January 1, 2024' -> '2024-01-01')\\n - Mon DD, YYYY (e.g., 'Jan 1, 2024' -> '2024-01-01')\\n - Month YYYY or Mon YYYY (e.g., 'November 2015' or 'Nov 2015' -> '2015-11-01' - use first day of month)\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits (e.g., '24'), assume 20YY (e.g., '01/01/24' -> '2024-01-01').\\n\\nEDGE CASES:\\n - Pay period may be shown as a range: '01/01/2024 - 01/15/2024'. Extract the FIRST date (start date).\\n - If only month and year are shown (e.g., 'November 2015', 'Nov 2015'), use the FIRST day of that month (e.g., '2015-11-01').\\n - If only a single date is shown labeled 'Pay Period', this may be the end date - look for context or date ranges to determine.\\n - Two-digit years: Expand '24' to '2024', '99' to '1999', etc. (treat < 50 as 20XX, >= 50 as 19XX).\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Pay Period: 01/01/2024 - 01/15/2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'From: January 1, 2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'Period: November 2015' -> extract '2015-11-01' (first day of month)\\n \\u2713 Text shows 'Period: Nov 2015' -> extract '2015-11-01' (first day of month)\\n \\u2713 Text shows 'Period: 1/1/24 to 1/15/24' -> extract '2024-01-01'\\n\\nAVOID:\\n \\u2717 Do NOT extract the end date of the pay period as the start date\\n \\u2717 Do NOT extract the pay date as the pay period start date\\n \\u2717 Do NOT extract dates from earnings/deductions sections as the pay period start date\"}, \"pay_period_end\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The end date of the pay period in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Pay Period', 'Period', 'To', 'To Date', 'Pay Period To', 'Period End', 'Pay Period End', 'End Date'\\n\\nLOCATION: Typically in the pay period information section, often near the pay date.; May appear in the upper portion of the payslip.; Often appears as a date range (e.g., 'Pay Period: 01/01/2024 - 01/15/2024').; Look for labels like 'Pay Period', 'To', or date ranges.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2024' -> '2024-01-15')\\n - M/D/YYYY (e.g., '1/15/2024' -> '2024-01-15')\\n - MM-DD-YYYY (e.g., '01-15-2024' -> '2024-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2024' -> '2024-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2024' -> '2024-01-15')\\n - Month YYYY or Mon YYYY (e.g., 'November 2015' or 'Nov 2015' -> '2015-11-30' - use last day of month)\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits (e.g., '24'), assume 20YY (e.g., '01/15/24' -> '2024-01-15').\\n\\nEDGE CASES:\\n - Pay period may be shown as a range: '01/01/2024 - 01/15/2024'. Extract the SECOND date (end date).\\n - If only month and year are shown (e.g., 'November 2015', 'Nov 2015'), use the LAST day of that month (e.g., '2015-11-30').\\n - If only a single date is shown labeled 'Pay Period', this may be the end date.\\n - The end date should be AFTER the start date (pay_period_start).\\n - Two-digit years: Expand '24' to '2024', '99' to '1999', etc. (treat < 50 as 20XX, >= 50 as 19XX).\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Pay Period: 01/01/2024 - 01/15/2024' -> extract '2024-01-15'\\n \\u2713 Text shows 'To: January 15, 2024' -> extract '2024-01-15'\\n \\u2713 Text shows 'Period: November 2015' -> extract '2015-11-30' (last day of month)\\n \\u2713 Text shows 'Period: Nov 2015' -> extract '2015-11-30' (last day of month)\\n \\u2713 Text shows 'End Date: 1/15/24' -> extract '2024-01-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract the start date of the pay period as the end date\\n \\u2717 Do NOT extract the pay date as the pay period end date\\n \\u2717 Do NOT extract dates from earnings/deductions sections as the pay period end date\"}, \"pay_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date when the employee was paid (paycheck date) in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Pay Date', 'Date Paid', 'Check Date', 'Paycheck Date', 'Payment Date', 'Date', 'Pay Date:', 'Date Paid:'\\n\\nLOCATION: Typically in the pay period information section, often near the pay period dates.; May appear in the upper portion of the payslip.; Usually appears prominently as it's the date the payment was issued.; Look for dates labeled as pay date or check date.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/20/2024' -> '2024-01-20')\\n - M/D/YYYY (e.g., '1/20/2024' -> '2024-01-20')\\n - MM-DD-YYYY (e.g., '01-20-2024' -> '2024-01-20')\\n - Month DD, YYYY (e.g., 'January 20, 2024' -> '2024-01-20')\\n - Mon DD, YYYY (e.g., 'Jan 20, 2024' -> '2024-01-20')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits (e.g., '24'), assume 20YY (e.g., '01/20/24' -> '2024-01-20').\\n\\nEDGE CASES:\\n - Pay date should be on or after the pay period end date (typically a few days after).\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Pay Date: 01/20/2024' -> extract '2024-01-20'\\n \\u2713 Text shows 'Date Paid: January 20, 2024' -> extract '2024-01-20'\\n \\u2713 Text shows 'Check Date: 1/20/24' -> extract '2024-01-20'\\n\\nAVOID:\\n \\u2717 Do NOT extract pay period dates as the pay date\\n \\u2717 Do NOT extract dates from earnings/deductions sections as the pay date\"}, \"gross_pay\": {\"type\": \"number\", \"datapoint_prompt\": \"The total gross pay (earnings before deductions) for this pay period.\\n\\nCOMMON LABELS: 'Gross Pay', 'Gross', 'Total Gross', 'Gross Earnings', 'Gross Wages', 'Total Earnings', 'Earnings'\\n\\nLOCATION: Typically in an earnings or summary section, often near the top or middle of the payslip.; Usually appears prominently as it's a key amount.; May be in a 'Current' or 'This Period' column.; Look for the total gross pay amount before deductions.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$2,500.00' -> 2500.00, '$500.00' -> 500.00). If OCR produces '2500' normalize to two decimals '2500.00'. If the extracted value is missing or illegible, return null.\\n\\nEDGE CASES:\\n - Gross pay should be a positive number.\\n - Gross pay should equal the sum of all earnings line items (within rounding tolerance).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n - If multiple amounts appear, prefer the one labeled 'Gross Pay' or 'Total Gross' over individual earnings line items.\\n\\nEXAMPLES:\\n \\u2713 'Gross Pay: $2,500.00' -> 2500.00\\n \\u2713 'Total Gross: $1,500.00' -> 1500.00\\n \\u2713 'Gross Earnings: $500.00' -> 500.00\\n\\nAVOID:\\n \\u2717 Do NOT extract net pay as gross pay\\n \\u2717 Do NOT extract individual earnings line item amounts as gross pay\\n \\u2717 Do NOT extract year-to-date gross pay as the current period gross pay\"}, \"total_deductions\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total of all deductions for this pay period (if shown separately on the payslip).\\n\\nCOMMON LABELS: 'Total Deductions', 'Deductions', 'Total Ded', 'Deductions Total', 'Total Withholdings'\\n\\nLOCATION: Typically in a deductions or summary section, often in the middle of the payslip.; Usually appears after gross pay and before net pay.; May be in a 'Current' or 'This Period' column.; Look for the total deductions amount.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If total deductions are not shown separately (only individual deduction line items are shown), return null. If no deductions exist, return 0.00.\\n\\nEDGE CASES:\\n - Total deductions should equal the sum of all deduction line items (within rounding tolerance).\\n - Some payslips don't show this separately - only show individual deduction line items - return null in that case.\\n - If no deductions exist, return 0.00 (not null).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Total Deductions: $500.00' -> extract 500.00\\n \\u2713 Text shows 'Deductions: $250.00' -> extract 250.00\\n \\u2713 Text shows 'Total Deductions: $0.00' -> extract 0.00\\n \\u2713 Text shows no total deductions field (only line items) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract net pay as total deductions\\n \\u2717 Do NOT extract individual deduction line item amounts as total deductions\\n \\u2717 Do NOT extract year-to-date deductions as the current period total deductions\"}, \"net_pay\": {\"type\": \"number\", \"datapoint_prompt\": \"The net pay (take-home pay after all deductions) for this pay period.\\n\\nCOMMON LABELS: 'Net Pay', 'Net', 'Take Home', 'Net Pay Amount', 'Pay This Period', 'Net Amount', 'Final Pay'\\n\\nLOCATION: Typically prominently displayed, often at the bottom of the earnings/deductions section or in a summary box.; Usually appears in larger or bold text as it's the final amount.; May be in a 'Current' or 'This Period' column.; Look for the net pay or take-home amount.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$2,000.00' -> 2000.00, '$500.00' -> 500.00). If OCR produces '2000' normalize to two decimals '2000.00'. If the extracted value is missing or illegible, return null.\\n\\nEDGE CASES:\\n - Net pay should be less than or equal to gross pay (net = gross - deductions).\\n - Net pay should equal gross pay minus total deductions (within rounding tolerance).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n - If multiple amounts appear, prefer the one labeled 'Net Pay' or 'Take Home' over calculated values.\\n\\nEXAMPLES:\\n \\u2713 'Net Pay: $2,000.00' -> 2000.00\\n \\u2713 'Take Home: $1,500.00' -> 1500.00\\n \\u2713 'Net: $500.00' -> 500.00\\n\\nAVOID:\\n \\u2717 Do NOT extract gross pay as net pay\\n \\u2717 Do NOT extract individual earnings or deduction amounts as net pay\\n \\u2717 Do NOT extract year-to-date net pay as the current period net pay\"}, \"earnings\": {\"type\": \"array\", \"datapoint_prompt\": \"All earnings/income line items for this pay period. Extract ALL earnings in the order they appear.\\n\\nLOCATION STRATEGY:\\n- PRIMARY: Earnings section, typically labeled 'Earnings', 'Current Earnings', 'This Period'\\n- Usually appears: Upper to middle portion of the payslip\\n- Format: Table or list with descriptions and amounts\\n\\nEXTRACTION RULES:\\n- Extract ALL earnings - do not skip any earnings items\\n- Preserve order (as they appear on the payslip)\\n- Include ALL earnings types: regular pay, overtime, bonuses, commissions, etc.\\n- For each earnings item, extract: description, hours (if shown), rate (if shown), amount\\n\\nCOMMON EARNINGS TYPES:\\n- Regular Pay: Regular hours, salary\\n- Overtime: Overtime hours, OT pay\\n- Holiday Pay: Holiday hours, holiday pay\\n- Bonuses: Performance bonuses, signing bonuses\\n- Commissions: Sales commissions\\n- Other: Shift differential, on-call pay, etc.\\n\\nFORMAT: Return an array of earnings objects in the order they appear. Each item should include:\\n- description: Earnings type/description as it appears\\n- hours: Optional hours worked if shown\\n- rate: Optional hourly rate if shown\\n- amount: Numeric earnings amount\\n\\nEDGE CASES:\\n- Multiple earnings types: Include all of them, preserve order\\n- Hours and rates may not be shown for salaried employees - include if available\\n- Descriptions may be abbreviated - extract as shown\\n- Some payslips show year-to-date earnings separately - extract only current period earnings\\n\\nEXAMPLES:\\n \\u2713 {description: 'Regular Pay', hours: 80.0, rate: 25.00, amount: 2000.00}\\n \\u2713 {description: 'Overtime', hours: 10.0, rate: 37.50, amount: 375.00}\\n \\u2713 {description: 'Bonus', amount: 500.00}\\n\\nAVOID:\\n \\u2717 Do NOT skip earnings items even if they seem minor\\n \\u2717 Do NOT extract year-to-date earnings as current period earnings\\n \\u2717 Do NOT extract gross pay total as an earnings line item\\n \\u2717 Do NOT reorder items - preserve the order as shown on the payslip\", \"items\": {\"type\": \"object\", \"properties\": {\"description\": {\"type\": \"string\", \"datapoint_prompt\": \"Earnings type/description EXACTLY as it appears on the payslip. Include all details: 'Regular Pay', 'Overtime', 'Bonus', etc. Preserve the exact text as shown.\"}, \"hours\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Hours worked for this earnings type if shown. Format: numeric decimal (e.g., 80.0, 10.5). Return null if hours are not shown for this earnings type.\"}, \"rate\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Hourly rate or pay rate for this earnings type if shown. Format: numeric decimal with two decimal places (e.g., 25.00, 37.50). Return null if rate is not shown for this earnings type.\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Earnings amount for this line item as a numeric value. Format: numeric decimal with two decimal places (e.g., 2000.00, 375.00).\"}}, \"required\": [\"description\", \"amount\"]}}, \"deductions\": {\"type\": \"array\", \"datapoint_prompt\": \"All deductions line items for this pay period. Extract ALL deductions in the order they appear.\\n\\nLOCATION STRATEGY:\\n- PRIMARY: Deductions section, typically labeled 'Deductions', 'Withholdings', 'Current Deductions', 'This Period'\\n- Usually appears: Middle portion of the payslip, after earnings\\n- Format: Table or list with descriptions and amounts\\n\\nEXTRACTION RULES:\\n- Extract ALL deductions - do not skip any deduction items\\n- Preserve order (as they appear on the payslip)\\n- Include ALL deduction types: taxes, insurance, retirement, etc.\\n- For each deduction item, extract: description and amount\\n\\nCOMMON DEDUCTION TYPES:\\n- Federal Tax: Federal income tax, FIT\\n- State Tax: State income tax, SIT\\n- Local Tax: Local income tax, city tax\\n- Social Security: FICA, Social Security tax, SS\\n- Medicare: Medicare tax\\n- Health Insurance: Medical, health, dental, vision insurance\\n- Retirement: 401(k), pension, retirement contributions\\n- Other: Life insurance, disability, union dues, etc.\\n\\nFORMAT: Return an array of deduction objects in the order they appear. Each item should include:\\n- description: Deduction type/description as it appears\\n- amount: Numeric deduction amount (typically a positive number representing the amount withheld)\\n\\nEDGE CASES:\\n- Multiple deduction types: Include all of them, preserve order\\n- Deduction amounts are typically positive numbers (amount withheld)\\n- Descriptions may be abbreviated - extract as shown\\n- Some payslips show year-to-date deductions separately - extract only current period deductions\\n- If no deductions exist, return an empty array\\n\\nEXAMPLES:\\n \\u2713 {description: 'Federal Tax', amount: 300.00}\\n \\u2713 {description: 'State Tax', amount: 100.00}\\n \\u2713 {description: 'Health Insurance', amount: 150.00}\\n \\u2713 {description: '401(k)', amount: 200.00}\\n\\nAVOID:\\n \\u2717 Do NOT skip deduction items even if they seem minor\\n \\u2717 Do NOT extract year-to-date deductions as current period deductions\\n \\u2717 Do NOT extract total deductions as a deduction line item\\n \\u2717 Do NOT reorder items - preserve the order as shown on the payslip\", \"items\": {\"type\": \"object\", \"properties\": {\"description\": {\"type\": \"string\", \"datapoint_prompt\": \"Deduction type/description EXACTLY as it appears on the payslip. Include all details: 'Federal Tax', 'Health Insurance', '401(k)', etc. Preserve the exact text as shown.\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Deduction amount for this line item as a numeric value. Format: numeric decimal with two decimal places (e.g., 300.00, 150.00). This is typically a positive number representing the amount withheld.\"}}, \"required\": [\"description\", \"amount\"]}}, \"year_to_date_gross\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The year-to-date (YTD) gross pay total (if shown on the payslip).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - YTD columns, summary sections, earnings sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nEXTRACTION STRATEGY (in order of preference):\\n1. If an explicitly labeled 'YTD Gross', 'Year to Date Gross', 'YTD Earnings', or 'YTD Gross Pay' field exists, extract that value.\\n2. If no explicit label exists but a YTD column is present with individual earnings YTD values, calculate by summing all positive wage/earnings YTD amounts (items marked as 'Wages' or positive earnings types like Base Pay, Overtime, Holiday Pay, Bonuses, etc.).\\n3. If neither explicit label nor YTD column exists, return null.\\n\\nCOMMON LABELS: 'YTD Gross', 'Year to Date Gross', 'YTD Earnings', 'YTD Gross Pay', 'Year to Date'\\n\\nLOCATION: Typically in a year-to-date (YTD) column, often to the right of current period amounts.; May appear in the earnings or summary section.; Look for YTD totals in a separate column or as a calculated sum of YTD earnings line items.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$23,099.80' -> 23099.80). If YTD gross is not shown or cannot be calculated from the payslip, return null.\\n\\nCALCULATION RULES (when summing YTD column values):\\n- Sum all positive earnings/wages YTD amounts (Base Pay, Regular Pay, Overtime, Holiday Pay, Bonuses, Commissions, etc.).\\n- Do NOT include deduction YTD amounts (taxes, insurance, etc.) in the gross calculation.\\n- Do NOT include negative amounts or amounts marked as deductions/taxes.\\n- Only include amounts clearly marked as earnings/wages in the YTD column.\\n\\nEDGE CASES:\\n - YTD amounts are cumulative totals for the calendar year.\\n - Some payslips show explicit YTD totals - prefer those over calculations.\\n - Some payslips only show YTD column with line items - calculate by summing wage/earnings YTD values.\\n - Some payslips don't show YTD information at all - return null if not present.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'YTD Gross: $30,000.00' -> extract 30000.00\\n \\u2713 Text shows 'Year to Date Gross: $25,000.00' -> extract 25000.00\\n \\u2713 YTD column shows: Base Hourly YTD: $10,912.00, Holiday Pay YTD: $3,945.50, Long Service Leave YTD: $7,392.00, Overtime YTD: $33.00, Sick Pay YTD: $440.00, Holiday Leave Loading YTD: $377.30 -> calculate and extract 23099.80\\n \\u2713 Text shows no YTD information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract current period gross pay as YTD gross pay\\n \\u2717 Do NOT extract net pay as YTD gross pay\\n \\u2717 Do NOT include deduction/tax YTD amounts in the calculation\"}, \"year_to_date_net\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The year-to-date (YTD) net pay total (if shown on the payslip).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - YTD columns, summary sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nEXTRACTION STRATEGY (in order of preference):\\n1. If an explicitly labeled 'YTD Net', 'Year to Date Net', 'YTD Net Pay', or 'YTD Take Home' field exists, extract that value.\\n2. If no explicit label exists but YTD gross and YTD deductions can be determined from the YTD column, calculate as: YTD Net = YTD Gross - YTD Deductions (sum of all tax/withholding/deduction YTD amounts).\\n3. If neither explicit label nor sufficient YTD column data exists, return null.\\n\\nCOMMON LABELS: 'YTD Net', 'Year to Date Net', 'YTD Net Pay', 'YTD Take Home'\\n\\nLOCATION: Typically in a year-to-date (YTD) column, often to the right of current period amounts.; May appear in the summary section.; Look for YTD totals in a separate column or as a calculated value.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$18,239.80' -> 18239.80). If YTD net is not shown or cannot be calculated from the payslip, return null.\\n\\nCALCULATION RULES (when calculating from YTD column):\\n- YTD Net = YTD Gross - YTD Deductions\\n- YTD Deductions = Sum of all tax/withholding/deduction YTD amounts (e.g., PAYG Withholding, Federal Tax, State Tax, Social Security, Medicare, etc.).\\n- Only include amounts clearly marked as deductions/taxes/withholdings in the YTD column.\\n- Use absolute values for deductions (if shown as negative, convert to positive for calculation).\\n\\nEDGE CASES:\\n - YTD amounts are cumulative totals for the calendar year.\\n - Some payslips show explicit YTD net totals - prefer those over calculations.\\n - Some payslips only show YTD column with line items - calculate using YTD Gross minus YTD Deductions.\\n - Some payslips don't show YTD information at all - return null if not present.\\n - YTD net should be less than or equal to YTD gross.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'YTD Net: $24,000.00' -> extract 24000.00\\n \\u2713 Text shows 'Year to Date Net: $20,000.00' -> extract 20000.00\\n \\u2713 YTD Gross: $23,099.80, YTD PAYG Withholding: $4,860.00 -> calculate YTD Net: 23099.80 - 4860.00 = 18239.80\\n \\u2713 Text shows no YTD information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract current period net pay as YTD net pay\\n \\u2717 Do NOT extract gross pay as YTD net pay\\n \\u2717 Do NOT include earnings YTD amounts in the deduction calculation\"}}, \"required\": [\"employer_name\", \"employee_name\", \"pay_period_start\", \"pay_period_end\", \"pay_date\", \"gross_pay\", \"net_pay\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"pay_period_start\", \"end_field\": \"pay_period_end\", \"max_days\": 31, \"message\": \"Pay period should be within 31 days (typically 7, 14, or 30 days)\"}, {\"type\": \"date_comparison\", \"field1\": \"pay_period_end\", \"field2\": \"pay_date\", \"comparison\": \"before_or_equal\", \"message\": \"Pay period end date should be before or equal to pay date (pay is typically issued after the pay period ends)\"}, {\"type\": \"approximate_match\", \"fields\": [\"gross_pay\", \"total_deductions\", \"net_pay\"], \"tolerance\": 0.01, \"message\": \"Net pay should approximately equal: Gross Pay - Total Deductions (within $0.01 rounding tolerance)\"}]}}", "true_json_output": "{\"employer_name\": \"MOGO\", \"employee_name\": \"Rymer, Mark\", \"employee_id\": null, \"pay_period_start\": \"2015-11-12\", \"pay_period_end\": \"2015-11-18\", \"pay_date\": \"2015-11-23\", \"gross_pay\": \"5837.50\", \"total_deductions\": null, \"net_pay\": 3554.5, \"earnings\": [{\"description\": \"Base Hourly\", \"hours\": -152.0, \"rate\": 22.0, \"amount\": -3344.0}, {\"description\": \"Holiday Pay\", \"hours\": 81.34, \"rate\": 22.0, \"amount\": 1789.5}, {\"description\": \"Long Service Leave\", \"hours\": 336.0, \"rate\": 22.0, \"amount\": 7392.0}, {\"description\": \"Overtime (1.5x)\", \"hours\": null, \"rate\": null, \"amount\": 0.0}, {\"description\": \"Sick Pay\", \"hours\": null, \"rate\": null, \"amount\": 0.0}, {\"description\": \"Holiday Leave Loading\", \"hours\": null, \"rate\": null, \"amount\": 0.0}, {\"description\": \"PAYG Withholding\", \"hours\": null, \"rate\": null, \"amount\": -2283.0}, {\"description\": \"Superannuation Factory\", \"hours\": null, \"rate\": null, \"amount\": 554.56}], \"deductions\": [{\"description\": \"Base Hourly\", \"amount\": -3344.0}, {\"description\": \"PAYG Withholding\", \"amount\": -2283.0}], \"year_to_date_gross\": 23099.8, \"year_to_date_net\": 18239.8, \"source_filename\": \"Payslip_2.pdf\"}", "true_markdown_output": "**Employer Name:** MOGO\n**Employee Name:** Rymer, Mark\n**Employee Id:** N/A\n**Pay Period Start:** 2015-11-12\n**Pay Period End:** 2015-11-18\n**Pay Date:** 2015-11-23\n**Gross Pay:** 5837.50\n**Total Deductions:** N/A\n**Net Pay:** 3554.5\n**Earnings:**\n **Description:** Base Hourly\n **Hours:** -152.0\n **Rate:** 22.0\n **Amount:** -3344.0\n **Description:** Holiday Pay\n **Hours:** 81.34\n **Rate:** 22.0\n **Amount:** 1789.5\n **Description:** Long Service Leave\n **Hours:** 336.0\n **Rate:** 22.0\n **Amount:** 7392.0\n **Description:** Overtime (1.5x)\n **Hours:** N/A\n **Rate:** N/A\n **Amount:** 0.0\n **Description:** Sick Pay\n **Hours:** N/A\n **Rate:** N/A\n **Amount:** 0.0\n **Description:** Holiday Leave Loading\n **Hours:** N/A\n **Rate:** N/A\n **Amount:** 0.0\n **Description:** PAYG Withholding\n **Hours:** N/A\n **Rate:** N/A\n **Amount:** -2283.0\n **Description:** Superannuation Factory\n **Hours:** N/A\n **Rate:** N/A\n **Amount:** 554.56\n**Deductions:**\n **Description:** Base Hourly\n **Amount:** -3344.0\n **Description:** PAYG Withholding\n **Amount:** -2283.0\n**Year To Date Gross:** 23099.8\n**Year To Date Net:** 18239.8"} {"file_name": "images/d_l_1.png", "id": 2, "metadata": "{\"format\": \"DRIVERS_LICENSE\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"d_l_1.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"license_number\": {\"type\": \"string\", \"datapoint_prompt\": \"The driver's license number or identification number issued by the state.\\n\\nCOMMON LABELS: 'License No.', 'License Number', 'DLN', 'Driver License Number', 'ID Number', 'License #', 'DL #', 'License'\\n\\nLOCATION: Typically prominently displayed on the license, often near the top or in a dedicated field.; May appear in the upper portion of the license, usually in a clearly labeled field.; Often appears in larger or bold text as it's a primary identifier.; Look for numeric or alphanumeric strings that are clearly labeled as the license number.\\n\\nFORMAT: Return the license number exactly as it appears on the document. Common formats:\\n - All digits (e.g., '123456789')\\n - Alphanumeric (e.g., 'D123-4567-8901-2', 'A12345678')\\n - With dashes or hyphens (e.g., '123-45-6789', 'D123-4567-8901-2')\\n - With spaces (e.g., 'D 123 456 789')\\nPreserve any formatting, dashes, spaces, or special characters as shown on the license.\\n\\nEDGE CASES:\\n - License numbers vary by state - some are numeric only, others include letters.\\n - Some states use formatting with dashes or spaces - preserve the exact format.\\n - License numbers may appear multiple times on the license (e.g., in a barcode area) - extract the one from the main labeled field.\\n - Do not confuse with other numbers like customer ID, record number, or document number.\\n - Some licenses show the number in multiple formats (plain text and encoded) - extract the plain text version.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'License No.: D123-4567-8901-2' -> extract 'D123-4567-8901-2'\\n \\u2713 Text shows 'DLN: 123456789' -> extract '123456789'\\n \\u2713 Text shows 'License # A12345678' -> extract 'A12345678'\\n \\u2713 Text shows 'License Number: 123-45-6789' -> extract '123-45-6789'\\n\\nAVOID:\\n \\u2717 Do NOT extract document numbers, record numbers, or customer IDs as the license number\\n \\u2717 Do NOT extract barcode data or encoded numbers if a clear labeled license number exists\\n \\u2717 Do NOT extract expiration dates or issue dates as the license number\"}, \"full_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The full legal name of the license holder as it appears on the license.\\n\\nCOMMON LABELS: 'Name', 'Full Name', 'Licensee Name', 'Driver Name', 'Holder Name', 'Name of Licensee'\\n\\nLOCATION: Typically in the main information section of the license, often near the top.; Usually appears prominently, often in larger text than other fields.; May be in the center or left portion of the license.; Look for the complete name including first, middle (if present), and last name.\\n\\nFORMAT: Return the full name exactly as it appears on the license. Common formats:\\n - 'First Middle Last' (e.g., 'John Michael Doe')\\n - 'First Last' (e.g., 'John Doe')\\n - 'Last, First Middle' (e.g., 'Doe, John Michael')\\n - 'Last, First' (e.g., 'Doe, John')\\nPreserve capitalization, punctuation (commas, periods), and spacing as shown. Include middle names or initials if present.\\n\\nEDGE CASES:\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Names may include prefixes (Dr., Mr., Mrs., Ms.) - typically exclude these unless they're part of the legal name.\\n - Some licenses show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Middle names may be abbreviated (e.g., 'John M. Doe') - preserve abbreviations.\\n - Names may be in all uppercase on licenses - preserve the capitalization.\\n - If name appears in multiple places, prefer the one in the main name field over headers or signatures.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Name: John Michael Doe' -> extract 'John Michael Doe'\\n \\u2713 Text shows 'DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Name: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n \\u2713 Text shows 'Licensee Name: John M. Doe' -> extract 'John M. Doe'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract organization names or business names as the license holder name\\n \\u2717 Do NOT extract signatures or printed names from signature areas as the full name field\\n \\u2717 Do NOT include titles like 'Dr.' or 'Mr.' unless they appear to be part of the legal name field\"}, \"date_of_birth\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date of birth of the license holder in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'DOB', 'Date of Birth', 'Birth Date', 'Born', 'Birth'\\n\\nLOCATION: Typically in the personal information section of the license.; Often appears near the name or other identifying information.; May be in the upper portion or middle section of the license.; Look for a labeled date field in the main information area.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/1990' -> '1990-01-15')\\n - M/D/YYYY (e.g., '1/15/1990' -> '1990-01-15')\\n - MM-DD-YYYY (e.g., '01-15-1990' -> '1990-01-15')\\n - DD/MM/YYYY (e.g., '15/01/1990' -> '1990-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 1990' -> '1990-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 1990' -> '1990-01-15')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, use context (typical driver's license ages 16-100+) to determine century (e.g., '01/15/90' likely -> '1990-01-15' for current licenses).\\n\\nEDGE CASES:\\n - Date of birth should be in the past (typically 16-100+ years ago from current date).\\n - Two-digit years: Use context to determine century. For dates like '01/15/90', if this appears to be a recent license, it's likely 1990 not 2090.\\n - Some licenses may show only month and year - use the first day of the month if day is missing (e.g., '01/1990' -> '1990-01-01').\\n - Be careful with DD/MM vs MM/DD formats - look for context clues or use the format that makes sense for the age.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'DOB: 01/15/1990' -> extract '1990-01-15'\\n \\u2713 Text shows 'Date of Birth: January 15, 1990' -> extract '1990-01-15'\\n \\u2713 Text shows 'Born: 1-15-90' -> extract '1990-01-15' (assuming recent license)\\n \\u2713 Text shows 'DOB: 15/01/1990' -> extract '1990-01-15' (assuming DD/MM format)\\n\\nAVOID:\\n \\u2717 Do NOT extract issue date or expiration date as date of birth\\n \\u2717 Do NOT extract dates that are clearly in the future (those are likely expiration dates)\\n \\u2717 Do NOT extract dates that are too recent (those are likely issue dates)\"}, \"address\": {\"type\": \"string\", \"datapoint_prompt\": \"The complete address of the license holder including street, city, state, and zip code.\\n\\nCOMMON LABELS: 'Address', 'Residence Address', 'Residential Address', 'Home Address', 'Mailing Address', 'Address of Record'\\n\\nLOCATION: Typically in the address section of the license.; Usually appears in the lower portion or middle section.; May span multiple lines with street address on one line and city/state/zip on the next.; Look for a clearly labeled address field.\\n\\nFORMAT: Return the complete address as it appears on the license. Common formats:\\n - Single line: '123 Main St, City, ST 12345'\\n - Multi-line (join with commas or spaces): '123 Main St\\\\nCity, ST 12345' -> '123 Main St, City, ST 12345'\\n - With apartment/unit: '123 Main St Apt 4B, City, ST 12345'\\nPreserve the format as shown. Include street number, street name, city, state abbreviation, and zip code. Include unit/apartment numbers if present.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators (commas or spaces).\\n - Include apartment numbers, unit numbers, or suite numbers if present (e.g., 'Apt 4B', 'Unit 201', 'Suite 100').\\n - State may be abbreviated (e.g., 'CA', 'NY', 'TX') or spelled out - preserve as shown.\\n - Zip codes may be 5 digits or 9 digits (ZIP+4) - preserve the format.\\n - Some licenses show PO Box addresses - include if that's the address of record.\\n - Street suffixes may be abbreviated (St, Ave, Rd, Dr, Blvd) or spelled out - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Address: 123 Main St, Anytown, CA 12345' -> extract '123 Main St, Anytown, CA 12345'\\n \\u2713 Text shows 'Residence: 456 Oak Avenue\\\\nSpringfield, IL 62701' -> extract '456 Oak Avenue, Springfield, IL 62701'\\n \\u2713 Text shows 'Address: 789 Pine Rd Apt 4B, Portland, OR 97201' -> extract '789 Pine Rd Apt 4B, Portland, OR 97201'\\n\\nAVOID:\\n \\u2717 Do NOT extract only the street address without city/state/zip\\n \\u2717 Do NOT extract only city/state/zip without the street address\\n \\u2717 Do NOT extract mailing addresses if a residence address is clearly labeled and available\\n \\u2717 Do NOT extract addresses from other sections (like issuing authority address)\"}, \"issue_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date when the driver's license was issued in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Issue Date', 'Issued', 'Date Issued', 'Issued On', 'Date', 'Issued Date'\\n\\nLOCATION: Typically in the license information section, often near expiration date.; May appear in the upper portion or middle section of the license.; Usually appears in a clearly labeled field.; Look for a date field labeled as issue date or issued.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2020' -> '2020-01-15')\\n - M/D/YYYY (e.g., '1/15/2020' -> '2020-01-15')\\n - MM-DD-YYYY (e.g., '01-15-2020' -> '2020-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2020' -> '2020-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2020' -> '2020-01-15')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, expand appropriately (e.g., '01/15/20' -> '2020-01-15' for recent licenses).\\n\\nEDGE CASES:\\n - Issue date should be before expiration date.\\n - Issue date should be in the past (not in the future).\\n - Two-digit years: Expand based on context (recent licenses likely 20XX).\\n - Some licenses may show only month and year - use the first day of the month if day is missing (e.g., '01/2020' -> '2020-01-01').\\n - Issue date is typically within the last 10-15 years for current licenses (depending on renewal period).\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Issue Date: 01/15/2020' -> extract '2020-01-15'\\n \\u2713 Text shows 'Issued: January 15, 2020' -> extract '2020-01-15'\\n \\u2713 Text shows 'Date Issued: 1-15-20' -> extract '2020-01-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract expiration date as issue date\\n \\u2717 Do NOT extract date of birth as issue date\\n \\u2717 Do NOT extract dates that are clearly after the expiration date\"}, \"expiration_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date when the driver's license expires in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Expiration Date', 'Expires', 'Expiration', 'Expires On', 'Valid Until', 'Exp. Date', 'EXP'\\n\\nLOCATION: Typically prominently displayed, often near the issue date.; Usually in the upper portion or middle section of the license.; Often appears in a clearly labeled field, sometimes in a different color or highlighted.; Look for a date field labeled as expiration, expires, or similar.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2025' -> '2025-01-15')\\n - M/D/YYYY (e.g., '1/15/2025' -> '2025-01-15')\\n - MM-DD-YYYY (e.g., '01-15-2025' -> '2025-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2025' -> '2025-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2025' -> '2025-01-15')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, expand appropriately (e.g., '01/15/25' -> '2025-01-15').\\n\\nEDGE CASES:\\n - Expiration date should be after issue date.\\n - Expiration date may be in the past (expired license) or future (valid license).\\n - Two-digit years: Expand based on context.\\n - Some licenses may show only month and year - use the last day of the month if day is missing (e.g., '01/2025' -> '2025-01-31').\\n - Driver's licenses typically expire every 4-8 years depending on state.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Be careful with OCR errors that might confuse digits (e.g., '2025' vs '2026' vs '2005').\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Expiration Date: 01/15/2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'Expires: January 15, 2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'EXP: 1-15-25' -> extract '2025-01-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract issue date as expiration date\\n \\u2717 Do NOT extract date of birth as expiration date\\n \\u2717 Do NOT extract dates that are clearly before the issue date\"}, \"license_class\": {\"type\": \"string\", \"datapoint_prompt\": \"The class or type of driver's license (e.g., 'Class D', 'Class C', 'Commercial', 'Non-Commercial').\\n\\nCOMMON LABELS: 'Class', 'License Class', 'Class Type', 'Type', 'License Type', 'Class of License'\\n\\nLOCATION: Typically in the license information section.; May appear near other license details like restrictions or endorsements.; Usually in a clearly labeled field.; Look for classifications like 'Class D', 'Class C', 'Commercial', etc.\\n\\nFORMAT: Return the license class exactly as it appears on the license. Common values:\\n - 'Class D' (standard passenger vehicle)\\n - 'Class C' (commercial)\\n - 'Class M' (motorcycle)\\n - 'Class A', 'Class B' (commercial vehicle classes)\\n - 'Non-Commercial'\\n - 'Commercial'\\n - State-specific classifications\\nPreserve the exact format, capitalization, and any additional text as shown.\\n\\nEDGE CASES:\\n - License classes vary by state - preserve the exact classification as shown.\\n - Some licenses may show multiple classes - include all if they're listed together.\\n - Classes may include additional qualifiers (e.g., 'Class D - Non-Commercial') - preserve as shown.\\n - Some licenses may not explicitly label the class - look for standard class designations.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Class: D' -> extract 'D'\\n \\u2713 Text shows 'License Class: Class D' -> extract 'Class D'\\n \\u2713 Text shows 'Type: Non-Commercial' -> extract 'Non-Commercial'\\n\\nAVOID:\\n \\u2717 Do NOT extract endorsements or restrictions as license class\\n \\u2717 Do NOT extract license number or other identifiers as license class\"}, \"restrictions\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"Any restrictions or limitations on the driver's license (e.g., 'Corrective Lenses', 'Daylight Only', 'Automatic Transmission').\\n\\nCOMMON LABELS: 'Restrictions', 'Restriction', 'Rest', 'REST'\\n\\nLOCATION: Typically in the license information section, often near the class or endorsements.; May appear in a dedicated restrictions field.; Usually clearly labeled.; Look for codes or descriptions of restrictions.\\n\\nFORMAT: Return restrictions exactly as they appear on the license. Common formats:\\n - Codes (e.g., 'B', 'C', '1', '2')\\n - Descriptions (e.g., 'Corrective Lenses', 'Daylight Only')\\n - Combined (e.g., 'B - Corrective Lenses')\\n - Multiple restrictions separated by spaces, commas, or on separate lines\\nIf multiple restrictions exist, include all of them. If no restrictions are listed or the field is empty, return null.\\n\\nEDGE CASES:\\n - Restrictions may be coded (e.g., 'B', 'C') or described in text - extract as shown.\\n - Some licenses show 'None' or leave the field blank for no restrictions - return null in these cases.\\n - Multiple restrictions may be listed - include all of them, preserving the format.\\n - Restrictions codes vary by state - preserve the exact codes or descriptions as shown.\\n - Some restrictions may be abbreviated - preserve abbreviations.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Restrictions: B' -> extract 'B'\\n \\u2713 Text shows 'REST: Corrective Lenses' -> extract 'Corrective Lenses'\\n \\u2713 Text shows 'Restrictions: B - Corrective Lenses, 1 - Daylight Only' -> extract 'B - Corrective Lenses, 1 - Daylight Only'\\n \\u2713 Text shows 'Restrictions: None' -> extract null\\n \\u2713 Text shows 'Restrictions: (blank or empty)' -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract endorsements as restrictions\\n \\u2717 Do NOT extract license class as restrictions\\n \\u2717 Do NOT return empty string if no restrictions - return null instead\"}, \"endorsements\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"Any endorsements or special authorizations on the driver's license (e.g., 'H - Hazardous Materials', 'M - Motorcycle', 'P - Passenger').\\n\\nCOMMON LABELS: 'Endorsements', 'Endorsement', 'End', 'END'\\n\\nLOCATION: Typically in the license information section, often near restrictions or class.; May appear in a dedicated endorsements field.; Usually clearly labeled.; Look for codes or descriptions of endorsements.\\n\\nFORMAT: Return endorsements exactly as they appear on the license. Common formats:\\n - Codes (e.g., 'H', 'M', 'P', 'S')\\n - Descriptions (e.g., 'Hazardous Materials', 'Motorcycle')\\n - Combined (e.g., 'H - Hazardous Materials')\\n - Multiple endorsements separated by spaces, commas, or on separate lines\\nIf multiple endorsements exist, include all of them. If no endorsements are listed or the field is empty, return null.\\n\\nEDGE CASES:\\n - Endorsements may be coded (e.g., 'H', 'M') or described in text - extract as shown.\\n - Some licenses show 'None' or leave the field blank for no endorsements - return null in these cases.\\n - Multiple endorsements may be listed - include all of them, preserving the format.\\n - Endorsement codes vary by state - preserve the exact codes or descriptions as shown.\\n - Some endorsements may be abbreviated - preserve abbreviations.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Endorsements: H' -> extract 'H'\\n \\u2713 Text shows 'END: Motorcycle' -> extract 'Motorcycle'\\n \\u2713 Text shows 'Endorsements: H - Hazardous Materials, M - Motorcycle' -> extract 'H - Hazardous Materials, M - Motorcycle'\\n \\u2713 Text shows 'Endorsements: None' -> extract null\\n \\u2713 Text shows 'Endorsements: (blank or empty)' -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract restrictions as endorsements\\n \\u2717 Do NOT extract license class as endorsements\\n \\u2717 Do NOT return empty string if no endorsements - return null instead\"}, \"height\": {\"type\": \"string\", \"datapoint_prompt\": \"The height of the license holder.\\n\\nCOMMON LABELS: 'Height', 'Ht', 'HT', 'HGT'\\n\\nLOCATION: Typically in the personal information section, often near weight and other physical characteristics.; Usually in a clearly labeled field.; Look for height measurements.\\n\\nFORMAT: Return height exactly as it appears on the license. Common formats:\\n - Feet and inches (e.g., '5-10', '5 10', '5FT 10IN', '5'10\\\"')\\n - Inches only (e.g., '70 IN', '70\\\"')\\n - Metric (e.g., '178 CM', '178cm')\\nPreserve the exact format, units, and spacing as shown on the license.\\n\\nEDGE CASES:\\n - Height formats vary by state - some use feet-inches, others use inches only or metric.\\n - Separators may be dashes, spaces, or quotes - preserve as shown.\\n - Units may be abbreviated (FT, IN, CM) or spelled out - preserve as shown.\\n - Some licenses may show height in a compact format (e.g., '5-10') or expanded (e.g., '5 FT 10 IN').\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Height: 5-10' -> extract '5-10'\\n \\u2713 Text shows 'Ht: 5 FT 10 IN' -> extract '5 FT 10 IN'\\n \\u2713 Text shows 'Height: 70 IN' -> extract '70 IN'\\n \\u2713 Text shows 'HT: 178 CM' -> extract '178 CM'\\n\\nAVOID:\\n \\u2717 Do NOT convert between measurement systems unless the license shows both\\n \\u2717 Do NOT extract weight or other measurements as height\\n \\u2717 Do NOT normalize the format - preserve as shown\"}, \"weight\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The weight of the license holder (if shown on the license).\\n\\nCOMMON LABELS: 'Weight', 'Wt', 'WT', 'WGT'\\n\\nLOCATION: Typically in the personal information section, often near height and other physical characteristics.; Usually in a clearly labeled field if present.; Not all states include weight on driver's licenses.; Look for weight measurements.\\n\\nFORMAT: Return weight exactly as it appears on the license. Common formats:\\n - Pounds (e.g., '150 LBS', '150', '150 LB')\\n - Kilograms (e.g., '68 KG', '68kg')\\nPreserve the exact format, units, and spacing as shown. If weight is not shown on the license, return null.\\n\\nEDGE CASES:\\n - Weight is not included on all state licenses - return null if not present.\\n - Units may be abbreviated (LBS, LB, KG) or spelled out - preserve as shown.\\n - Some licenses may show weight without units - preserve as shown.\\n - Weight may be rounded or shown as a range - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Weight: 150 LBS' -> extract '150 LBS'\\n \\u2713 Text shows 'Wt: 68 KG' -> extract '68 KG'\\n \\u2713 Text shows 'Weight: 150' -> extract '150'\\n \\u2713 Text shows 'Weight: (blank or not present)' -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract height or other measurements as weight\\n \\u2717 Do NOT return empty string if weight is not shown - return null instead\\n \\u2717 Do NOT convert between measurement systems unless the license shows both\"}, \"eye_color\": {\"type\": \"string\", \"datapoint_prompt\": \"The eye color of the license holder.\\n\\nCOMMON LABELS: 'Eye Color', 'Eyes', 'Eye', 'EYE', 'EYES'\\n\\nLOCATION: Typically in the personal information section, often near height, weight, and hair color.; Usually in a clearly labeled field.; Look for eye color designations.\\n\\nFORMAT: Return eye color exactly as it appears on the license. Common values:\\n - 'BLU', 'BLUE'\\n - 'BRN', 'BROWN'\\n - 'GRN', 'GREEN'\\n - 'GRY', 'GRAY', 'GREY'\\n - 'HAZ', 'HAZEL'\\n - 'BLK', 'BLACK'\\n - 'DIC', 'DICHROMATIC' (two different colors)\\nPreserve the exact format and capitalization as shown. Colors may be abbreviated or spelled out.\\n\\nEDGE CASES:\\n - Eye colors may be abbreviated (typically 3-letter codes) or spelled out - preserve as shown.\\n - Some licenses use all uppercase, others use mixed case - preserve capitalization.\\n - Less common colors may appear - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Eye Color: BLU' -> extract 'BLU'\\n \\u2713 Text shows 'Eyes: Brown' -> extract 'Brown'\\n \\u2713 Text shows 'EYE: HAZEL' -> extract 'HAZEL'\\n\\nAVOID:\\n \\u2717 Do NOT extract hair color as eye color\\n \\u2717 Do NOT normalize abbreviations - preserve as shown\\n \\u2717 Do NOT change capitalization\"}, \"hair_color\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The hair color of the license holder (if shown on the license).\\n\\nCOMMON LABELS: 'Hair Color', 'Hair', 'HAIR'\\n\\nLOCATION: Typically in the personal information section, often near height, weight, and eye color.; Usually in a clearly labeled field if present.; Not all states include hair color on driver's licenses (many have removed this field).; Look for hair color designations.\\n\\nFORMAT: Return hair color exactly as it appears on the license. Common values:\\n - 'BLK', 'BLACK'\\n - 'BLN', 'BLOND', 'BLONDE'\\n - 'BRN', 'BROWN'\\n - 'GRY', 'GRAY', 'GREY'\\n - 'RED'\\n - 'SDY', 'SANDY'\\n - 'WHI', 'WHITE'\\n - 'BAL', 'BALD'\\nPreserve the exact format and capitalization as shown. If hair color is not shown on the license, return null.\\n\\nEDGE CASES:\\n - Hair color is not included on all state licenses - return null if not present.\\n - Hair colors may be abbreviated (typically 3-letter codes) or spelled out - preserve as shown.\\n - Some licenses use all uppercase, others use mixed case - preserve capitalization.\\n - 'Bald' may be indicated with 'BAL' or 'BALD' - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Hair Color: BLK' -> extract 'BLK'\\n \\u2713 Text shows 'Hair: Brown' -> extract 'Brown'\\n \\u2713 Text shows 'HAIR: BALD' -> extract 'BALD'\\n \\u2713 Text shows 'Hair Color: (blank or not present)' -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract eye color as hair color\\n \\u2717 Do NOT return empty string if hair color is not shown - return null instead\\n \\u2717 Do NOT normalize abbreviations - preserve as shown\"}, \"sex\": {\"type\": \"string\", \"datapoint_prompt\": \"The sex or gender designation on the license.\\n\\nCOMMON LABELS: 'Sex', 'Gender', 'SEX', 'GENDER'\\n\\nLOCATION: Typically in the personal information section, often near date of birth and other identifying information.; Usually in a clearly labeled field.; Look for sex/gender designations.\\n\\nFORMAT: Return the sex/gender designation exactly as it appears on the license. Common values:\\n - 'M', 'MALE', 'Male'\\n - 'F', 'FEMALE', 'Female'\\n - 'X', 'NON-BINARY', 'Non-Binary' (in some states)\\nPreserve the exact format and capitalization as shown. May be a single letter or full word.\\n\\nEDGE CASES:\\n - Sex/gender may be abbreviated (typically 'M' or 'F') or spelled out - preserve as shown.\\n - Some licenses use all uppercase, others use mixed case - preserve capitalization.\\n - Some states now offer non-binary options (X, NON-BINARY) - preserve as shown if present.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Sex: M' -> extract 'M'\\n \\u2713 Text shows 'Gender: FEMALE' -> extract 'FEMALE'\\n \\u2713 Text shows 'SEX: F' -> extract 'F'\\n\\nAVOID:\\n \\u2717 Do NOT normalize to full words if abbreviated - preserve as shown\\n \\u2717 Do NOT change capitalization\\n \\u2717 Do NOT extract other fields as sex/gender\"}, \"issuing_state\": {\"type\": \"string\", \"datapoint_prompt\": \"The state or jurisdiction that issued the driver's license.\\n\\nCOMMON LABELS: 'Issued By', 'State', 'Issuing State', 'State of Issue', 'Jurisdiction', 'Issuing Authority'\\n\\nLOCATION: Typically in the header or top portion of the license.; Often appears prominently, sometimes as part of the license design or header.; May be in the state name/logo area.; Look for state names or abbreviations.\\n\\nFORMAT: Return the issuing state exactly as it appears on the license. Common formats:\\n - State abbreviation (e.g., 'CA', 'NY', 'TX', 'FL')\\n - Full state name (e.g., 'California', 'New York', 'Texas', 'Florida')\\n - May appear in the license header or design\\nPreserve the exact format and capitalization as shown.\\n\\nEDGE CASES:\\n - State may be shown as abbreviation or full name - preserve as shown.\\n - Some licenses show the state name prominently in the header/design - extract from there.\\n - District of Columbia may appear as 'DC' or 'District of Columbia' - preserve as shown.\\n - US territories (Puerto Rico, Guam, etc.) may be shown - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 License header shows 'CALIFORNIA' -> extract 'CALIFORNIA'\\n \\u2713 Text shows 'State: CA' -> extract 'CA'\\n \\u2713 Text shows 'Issued By: Texas' -> extract 'Texas'\\n\\nAVOID:\\n \\u2717 Do NOT extract addresses (which contain state names) as the issuing state\\n \\u2717 Do NOT extract other location references as the issuing state\"}}, \"required\": [\"license_number\", \"full_name\", \"date_of_birth\", \"address\", \"issue_date\", \"expiration_date\", \"license_class\", \"height\", \"eye_color\", \"sex\", \"issuing_state\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"issue_date\", \"end_field\": \"expiration_date\", \"min_days\": 1, \"max_days\": 3650, \"message\": \"Expiration date should be after issue date and within 10 years\"}, {\"type\": \"date_comparison\", \"field1\": \"date_of_birth\", \"field2\": \"issue_date\", \"comparison\": \"before\", \"message\": \"Date of birth should be before issue date (license holder must be at least 16 years old)\"}]}}", "true_json_output": "{\"license_number\": \"AR02 2021 0000074\", \"full_name\": \"SUBROTO DUTTA\", \"date_of_birth\": \"2002-01-12\", \"address\": \"MARKET LINE, POPS ROHNHIL, DOMINO, PAPUM PARE, 791112\", \"issue_date\": \"2021-06-29\", \"expiration_date\": \"2042-01-11\", \"license_class\": \"LMV, MCWG\", \"restrictions\": null, \"endorsements\": null, \"height\": null, \"weight\": null, \"eye_color\": null, \"hair_color\": null, \"sex\": null, \"issuing_state\": \"AR\", \"source_filename\": \"d_l_1.pdf\"}", "true_markdown_output": "**License Number:** AR02 2021 0000074\n**Full Name:** SUBROTO DUTTA\n**Date Of Birth:** 2002-01-12\n**Address:** MARKET LINE, POPS ROHNHIL, DOMINO, PAPUM PARE, 791112\n**Issue Date:** 2021-06-29\n**Expiration Date:** 2042-01-11\n**License Class:** LMV, MCWG\n**Restrictions:** N/A\n**Endorsements:** N/A\n**Height:** N/A\n**Weight:** N/A\n**Eye Color:** N/A\n**Hair Color:** N/A\n**Sex:** N/A\n**Issuing State:** AR"} {"file_name": "images/d_l_2.png", "id": 3, "metadata": "{\"format\": \"DRIVERS_LICENSE\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"d_l_2.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"license_number\": {\"type\": \"string\", \"datapoint_prompt\": \"The driver's license number or identification number issued by the state.\\n\\nCOMMON LABELS: 'License No.', 'License Number', 'DLN', 'Driver License Number', 'ID Number', 'License #', 'DL #', 'License'\\n\\nLOCATION: Typically prominently displayed on the license, often near the top or in a dedicated field.; May appear in the upper portion of the license, usually in a clearly labeled field.; Often appears in larger or bold text as it's a primary identifier.; Look for numeric or alphanumeric strings that are clearly labeled as the license number.\\n\\nFORMAT: Return the license number exactly as it appears on the document. Common formats:\\n - All digits (e.g., '123456789')\\n - Alphanumeric (e.g., 'D123-4567-8901-2', 'A12345678')\\n - With dashes or hyphens (e.g., '123-45-6789', 'D123-4567-8901-2')\\n - With spaces (e.g., 'D 123 456 789')\\nPreserve any formatting, dashes, spaces, or special characters as shown on the license.\\n\\nEDGE CASES:\\n - License numbers vary by state - some are numeric only, others include letters.\\n - Some states use formatting with dashes or spaces - preserve the exact format.\\n - License numbers may appear multiple times on the license (e.g., in a barcode area) - extract the one from the main labeled field.\\n - Do not confuse with other numbers like customer ID, record number, or document number.\\n - Some licenses show the number in multiple formats (plain text and encoded) - extract the plain text version.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'License No.: D123-4567-8901-2' -> extract 'D123-4567-8901-2'\\n \\u2713 Text shows 'DLN: 123456789' -> extract '123456789'\\n \\u2713 Text shows 'License # A12345678' -> extract 'A12345678'\\n \\u2713 Text shows 'License Number: 123-45-6789' -> extract '123-45-6789'\\n\\nAVOID:\\n \\u2717 Do NOT extract document numbers, record numbers, or customer IDs as the license number\\n \\u2717 Do NOT extract barcode data or encoded numbers if a clear labeled license number exists\\n \\u2717 Do NOT extract expiration dates or issue dates as the license number\"}, \"full_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The full legal name of the license holder as it appears on the license.\\n\\nCOMMON LABELS: 'Name', 'Full Name', 'Licensee Name', 'Driver Name', 'Holder Name', 'Name of Licensee'\\n\\nLOCATION: Typically in the main information section of the license, often near the top.; Usually appears prominently, often in larger text than other fields.; May be in the center or left portion of the license.; Look for the complete name including first, middle (if present), and last name.\\n\\nFORMAT: Return the full name exactly as it appears on the license. Common formats:\\n - 'First Middle Last' (e.g., 'John Michael Doe')\\n - 'First Last' (e.g., 'John Doe')\\n - 'Last, First Middle' (e.g., 'Doe, John Michael')\\n - 'Last, First' (e.g., 'Doe, John')\\nPreserve capitalization, punctuation (commas, periods), and spacing as shown. Include middle names or initials if present.\\n\\nEDGE CASES:\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Names may include prefixes (Dr., Mr., Mrs., Ms.) - typically exclude these unless they're part of the legal name.\\n - Some licenses show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Middle names may be abbreviated (e.g., 'John M. Doe') - preserve abbreviations.\\n - Names may be in all uppercase on licenses - preserve the capitalization.\\n - If name appears in multiple places, prefer the one in the main name field over headers or signatures.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Name: John Michael Doe' -> extract 'John Michael Doe'\\n \\u2713 Text shows 'DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Name: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n \\u2713 Text shows 'Licensee Name: John M. Doe' -> extract 'John M. Doe'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract organization names or business names as the license holder name\\n \\u2717 Do NOT extract signatures or printed names from signature areas as the full name field\\n \\u2717 Do NOT include titles like 'Dr.' or 'Mr.' unless they appear to be part of the legal name field\"}, \"date_of_birth\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date of birth of the license holder in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'DOB', 'Date of Birth', 'Birth Date', 'Born', 'Birth'\\n\\nLOCATION: Typically in the personal information section of the license.; Often appears near the name or other identifying information.; May be in the upper portion or middle section of the license.; Look for a labeled date field in the main information area.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/1990' -> '1990-01-15')\\n - M/D/YYYY (e.g., '1/15/1990' -> '1990-01-15')\\n - MM-DD-YYYY (e.g., '01-15-1990' -> '1990-01-15')\\n - DD/MM/YYYY (e.g., '15/01/1990' -> '1990-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 1990' -> '1990-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 1990' -> '1990-01-15')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, use context (typical driver's license ages 16-100+) to determine century (e.g., '01/15/90' likely -> '1990-01-15' for current licenses).\\n\\nEDGE CASES:\\n - Date of birth should be in the past (typically 16-100+ years ago from current date).\\n - Two-digit years: Use context to determine century. For dates like '01/15/90', if this appears to be a recent license, it's likely 1990 not 2090.\\n - Some licenses may show only month and year - use the first day of the month if day is missing (e.g., '01/1990' -> '1990-01-01').\\n - Be careful with DD/MM vs MM/DD formats - look for context clues or use the format that makes sense for the age.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'DOB: 01/15/1990' -> extract '1990-01-15'\\n \\u2713 Text shows 'Date of Birth: January 15, 1990' -> extract '1990-01-15'\\n \\u2713 Text shows 'Born: 1-15-90' -> extract '1990-01-15' (assuming recent license)\\n \\u2713 Text shows 'DOB: 15/01/1990' -> extract '1990-01-15' (assuming DD/MM format)\\n\\nAVOID:\\n \\u2717 Do NOT extract issue date or expiration date as date of birth\\n \\u2717 Do NOT extract dates that are clearly in the future (those are likely expiration dates)\\n \\u2717 Do NOT extract dates that are too recent (those are likely issue dates)\"}, \"address\": {\"type\": \"string\", \"datapoint_prompt\": \"The complete address of the license holder including street, city, state, and zip code.\\n\\nCOMMON LABELS: 'Address', 'Residence Address', 'Residential Address', 'Home Address', 'Mailing Address', 'Address of Record'\\n\\nLOCATION: Typically in the address section of the license.; Usually appears in the lower portion or middle section.; May span multiple lines with street address on one line and city/state/zip on the next.; Look for a clearly labeled address field.\\n\\nFORMAT: Return the complete address as it appears on the license. Common formats:\\n - Single line: '123 Main St, City, ST 12345'\\n - Multi-line (join with commas or spaces): '123 Main St\\\\nCity, ST 12345' -> '123 Main St, City, ST 12345'\\n - With apartment/unit: '123 Main St Apt 4B, City, ST 12345'\\nPreserve the format as shown. Include street number, street name, city, state abbreviation, and zip code. Include unit/apartment numbers if present.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators (commas or spaces).\\n - Include apartment numbers, unit numbers, or suite numbers if present (e.g., 'Apt 4B', 'Unit 201', 'Suite 100').\\n - State may be abbreviated (e.g., 'CA', 'NY', 'TX') or spelled out - preserve as shown.\\n - Zip codes may be 5 digits or 9 digits (ZIP+4) - preserve the format.\\n - Some licenses show PO Box addresses - include if that's the address of record.\\n - Street suffixes may be abbreviated (St, Ave, Rd, Dr, Blvd) or spelled out - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Address: 123 Main St, Anytown, CA 12345' -> extract '123 Main St, Anytown, CA 12345'\\n \\u2713 Text shows 'Residence: 456 Oak Avenue\\\\nSpringfield, IL 62701' -> extract '456 Oak Avenue, Springfield, IL 62701'\\n \\u2713 Text shows 'Address: 789 Pine Rd Apt 4B, Portland, OR 97201' -> extract '789 Pine Rd Apt 4B, Portland, OR 97201'\\n\\nAVOID:\\n \\u2717 Do NOT extract only the street address without city/state/zip\\n \\u2717 Do NOT extract only city/state/zip without the street address\\n \\u2717 Do NOT extract mailing addresses if a residence address is clearly labeled and available\\n \\u2717 Do NOT extract addresses from other sections (like issuing authority address)\"}, \"issue_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date when the driver's license was issued in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Issue Date', 'Issued', 'Date Issued', 'Issued On', 'Date', 'Issued Date'\\n\\nLOCATION: Typically in the license information section, often near expiration date.; May appear in the upper portion or middle section of the license.; Usually appears in a clearly labeled field.; Look for a date field labeled as issue date or issued.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2020' -> '2020-01-15')\\n - M/D/YYYY (e.g., '1/15/2020' -> '2020-01-15')\\n - MM-DD-YYYY (e.g., '01-15-2020' -> '2020-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2020' -> '2020-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2020' -> '2020-01-15')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, expand appropriately (e.g., '01/15/20' -> '2020-01-15' for recent licenses).\\n\\nEDGE CASES:\\n - Issue date should be before expiration date.\\n - Issue date should be in the past (not in the future).\\n - Two-digit years: Expand based on context (recent licenses likely 20XX).\\n - Some licenses may show only month and year - use the first day of the month if day is missing (e.g., '01/2020' -> '2020-01-01').\\n - Issue date is typically within the last 10-15 years for current licenses (depending on renewal period).\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Issue Date: 01/15/2020' -> extract '2020-01-15'\\n \\u2713 Text shows 'Issued: January 15, 2020' -> extract '2020-01-15'\\n \\u2713 Text shows 'Date Issued: 1-15-20' -> extract '2020-01-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract expiration date as issue date\\n \\u2717 Do NOT extract date of birth as issue date\\n \\u2717 Do NOT extract dates that are clearly after the expiration date\"}, \"expiration_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date when the driver's license expires in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Expiration Date', 'Expires', 'Expiration', 'Expires On', 'Valid Until', 'Exp. Date', 'EXP'\\n\\nLOCATION: Typically prominently displayed, often near the issue date.; Usually in the upper portion or middle section of the license.; Often appears in a clearly labeled field, sometimes in a different color or highlighted.; Look for a date field labeled as expiration, expires, or similar.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2025' -> '2025-01-15')\\n - M/D/YYYY (e.g., '1/15/2025' -> '2025-01-15')\\n - MM-DD-YYYY (e.g., '01-15-2025' -> '2025-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2025' -> '2025-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2025' -> '2025-01-15')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, expand appropriately (e.g., '01/15/25' -> '2025-01-15').\\n\\nEDGE CASES:\\n - Expiration date should be after issue date.\\n - Expiration date may be in the past (expired license) or future (valid license).\\n - Two-digit years: Expand based on context.\\n - Some licenses may show only month and year - use the last day of the month if day is missing (e.g., '01/2025' -> '2025-01-31').\\n - Driver's licenses typically expire every 4-8 years depending on state.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Be careful with OCR errors that might confuse digits (e.g., '2025' vs '2026' vs '2005').\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Expiration Date: 01/15/2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'Expires: January 15, 2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'EXP: 1-15-25' -> extract '2025-01-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract issue date as expiration date\\n \\u2717 Do NOT extract date of birth as expiration date\\n \\u2717 Do NOT extract dates that are clearly before the issue date\"}, \"license_class\": {\"type\": \"string\", \"datapoint_prompt\": \"The class or type of driver's license (e.g., 'Class D', 'Class C', 'Commercial', 'Non-Commercial').\\n\\nCOMMON LABELS: 'Class', 'License Class', 'Class Type', 'Type', 'License Type', 'Class of License'\\n\\nLOCATION: Typically in the license information section.; May appear near other license details like restrictions or endorsements.; Usually in a clearly labeled field.; Look for classifications like 'Class D', 'Class C', 'Commercial', etc.\\n\\nFORMAT: Return the license class exactly as it appears on the license. Common values:\\n - 'Class D' (standard passenger vehicle)\\n - 'Class C' (commercial)\\n - 'Class M' (motorcycle)\\n - 'Class A', 'Class B' (commercial vehicle classes)\\n - 'Non-Commercial'\\n - 'Commercial'\\n - State-specific classifications\\nPreserve the exact format, capitalization, and any additional text as shown.\\n\\nEDGE CASES:\\n - License classes vary by state - preserve the exact classification as shown.\\n - Some licenses may show multiple classes - include all if they're listed together.\\n - Classes may include additional qualifiers (e.g., 'Class D - Non-Commercial') - preserve as shown.\\n - Some licenses may not explicitly label the class - look for standard class designations.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Class: D' -> extract 'D'\\n \\u2713 Text shows 'License Class: Class D' -> extract 'Class D'\\n \\u2713 Text shows 'Type: Non-Commercial' -> extract 'Non-Commercial'\\n\\nAVOID:\\n \\u2717 Do NOT extract endorsements or restrictions as license class\\n \\u2717 Do NOT extract license number or other identifiers as license class\"}, \"restrictions\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"Any restrictions or limitations on the driver's license (e.g., 'Corrective Lenses', 'Daylight Only', 'Automatic Transmission').\\n\\nCOMMON LABELS: 'Restrictions', 'Restriction', 'Rest', 'REST'\\n\\nLOCATION: Typically in the license information section, often near the class or endorsements.; May appear in a dedicated restrictions field.; Usually clearly labeled.; Look for codes or descriptions of restrictions.\\n\\nFORMAT: Return restrictions exactly as they appear on the license. Common formats:\\n - Codes (e.g., 'B', 'C', '1', '2')\\n - Descriptions (e.g., 'Corrective Lenses', 'Daylight Only')\\n - Combined (e.g., 'B - Corrective Lenses')\\n - Multiple restrictions separated by spaces, commas, or on separate lines\\nIf multiple restrictions exist, include all of them. If no restrictions are listed or the field is empty, return null.\\n\\nEDGE CASES:\\n - Restrictions may be coded (e.g., 'B', 'C') or described in text - extract as shown.\\n - Some licenses show 'None' or leave the field blank for no restrictions - return null in these cases.\\n - Multiple restrictions may be listed - include all of them, preserving the format.\\n - Restrictions codes vary by state - preserve the exact codes or descriptions as shown.\\n - Some restrictions may be abbreviated - preserve abbreviations.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Restrictions: B' -> extract 'B'\\n \\u2713 Text shows 'REST: Corrective Lenses' -> extract 'Corrective Lenses'\\n \\u2713 Text shows 'Restrictions: B - Corrective Lenses, 1 - Daylight Only' -> extract 'B - Corrective Lenses, 1 - Daylight Only'\\n \\u2713 Text shows 'Restrictions: None' -> extract null\\n \\u2713 Text shows 'Restrictions: (blank or empty)' -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract endorsements as restrictions\\n \\u2717 Do NOT extract license class as restrictions\\n \\u2717 Do NOT return empty string if no restrictions - return null instead\"}, \"endorsements\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"Any endorsements or special authorizations on the driver's license (e.g., 'H - Hazardous Materials', 'M - Motorcycle', 'P - Passenger').\\n\\nCOMMON LABELS: 'Endorsements', 'Endorsement', 'End', 'END'\\n\\nLOCATION: Typically in the license information section, often near restrictions or class.; May appear in a dedicated endorsements field.; Usually clearly labeled.; Look for codes or descriptions of endorsements.\\n\\nFORMAT: Return endorsements exactly as they appear on the license. Common formats:\\n - Codes (e.g., 'H', 'M', 'P', 'S')\\n - Descriptions (e.g., 'Hazardous Materials', 'Motorcycle')\\n - Combined (e.g., 'H - Hazardous Materials')\\n - Multiple endorsements separated by spaces, commas, or on separate lines\\nIf multiple endorsements exist, include all of them. If no endorsements are listed or the field is empty, return null.\\n\\nEDGE CASES:\\n - Endorsements may be coded (e.g., 'H', 'M') or described in text - extract as shown.\\n - Some licenses show 'None' or leave the field blank for no endorsements - return null in these cases.\\n - Multiple endorsements may be listed - include all of them, preserving the format.\\n - Endorsement codes vary by state - preserve the exact codes or descriptions as shown.\\n - Some endorsements may be abbreviated - preserve abbreviations.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Endorsements: H' -> extract 'H'\\n \\u2713 Text shows 'END: Motorcycle' -> extract 'Motorcycle'\\n \\u2713 Text shows 'Endorsements: H - Hazardous Materials, M - Motorcycle' -> extract 'H - Hazardous Materials, M - Motorcycle'\\n \\u2713 Text shows 'Endorsements: None' -> extract null\\n \\u2713 Text shows 'Endorsements: (blank or empty)' -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract restrictions as endorsements\\n \\u2717 Do NOT extract license class as endorsements\\n \\u2717 Do NOT return empty string if no endorsements - return null instead\"}, \"height\": {\"type\": \"string\", \"datapoint_prompt\": \"The height of the license holder.\\n\\nCOMMON LABELS: 'Height', 'Ht', 'HT', 'HGT'\\n\\nLOCATION: Typically in the personal information section, often near weight and other physical characteristics.; Usually in a clearly labeled field.; Look for height measurements.\\n\\nFORMAT: Return height exactly as it appears on the license. Common formats:\\n - Feet and inches (e.g., '5-10', '5 10', '5FT 10IN', '5'10\\\"')\\n - Inches only (e.g., '70 IN', '70\\\"')\\n - Metric (e.g., '178 CM', '178cm')\\nPreserve the exact format, units, and spacing as shown on the license.\\n\\nEDGE CASES:\\n - Height formats vary by state - some use feet-inches, others use inches only or metric.\\n - Separators may be dashes, spaces, or quotes - preserve as shown.\\n - Units may be abbreviated (FT, IN, CM) or spelled out - preserve as shown.\\n - Some licenses may show height in a compact format (e.g., '5-10') or expanded (e.g., '5 FT 10 IN').\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Height: 5-10' -> extract '5-10'\\n \\u2713 Text shows 'Ht: 5 FT 10 IN' -> extract '5 FT 10 IN'\\n \\u2713 Text shows 'Height: 70 IN' -> extract '70 IN'\\n \\u2713 Text shows 'HT: 178 CM' -> extract '178 CM'\\n\\nAVOID:\\n \\u2717 Do NOT convert between measurement systems unless the license shows both\\n \\u2717 Do NOT extract weight or other measurements as height\\n \\u2717 Do NOT normalize the format - preserve as shown\"}, \"weight\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The weight of the license holder (if shown on the license).\\n\\nCOMMON LABELS: 'Weight', 'Wt', 'WT', 'WGT'\\n\\nLOCATION: Typically in the personal information section, often near height and other physical characteristics.; Usually in a clearly labeled field if present.; Not all states include weight on driver's licenses.; Look for weight measurements.\\n\\nFORMAT: Return weight exactly as it appears on the license. Common formats:\\n - Pounds (e.g., '150 LBS', '150', '150 LB')\\n - Kilograms (e.g., '68 KG', '68kg')\\nPreserve the exact format, units, and spacing as shown. If weight is not shown on the license, return null.\\n\\nEDGE CASES:\\n - Weight is not included on all state licenses - return null if not present.\\n - Units may be abbreviated (LBS, LB, KG) or spelled out - preserve as shown.\\n - Some licenses may show weight without units - preserve as shown.\\n - Weight may be rounded or shown as a range - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Weight: 150 LBS' -> extract '150 LBS'\\n \\u2713 Text shows 'Wt: 68 KG' -> extract '68 KG'\\n \\u2713 Text shows 'Weight: 150' -> extract '150'\\n \\u2713 Text shows 'Weight: (blank or not present)' -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract height or other measurements as weight\\n \\u2717 Do NOT return empty string if weight is not shown - return null instead\\n \\u2717 Do NOT convert between measurement systems unless the license shows both\"}, \"eye_color\": {\"type\": \"string\", \"datapoint_prompt\": \"The eye color of the license holder.\\n\\nCOMMON LABELS: 'Eye Color', 'Eyes', 'Eye', 'EYE', 'EYES'\\n\\nLOCATION: Typically in the personal information section, often near height, weight, and hair color.; Usually in a clearly labeled field.; Look for eye color designations.\\n\\nFORMAT: Return eye color exactly as it appears on the license. Common values:\\n - 'BLU', 'BLUE'\\n - 'BRN', 'BROWN'\\n - 'GRN', 'GREEN'\\n - 'GRY', 'GRAY', 'GREY'\\n - 'HAZ', 'HAZEL'\\n - 'BLK', 'BLACK'\\n - 'DIC', 'DICHROMATIC' (two different colors)\\nPreserve the exact format and capitalization as shown. Colors may be abbreviated or spelled out.\\n\\nEDGE CASES:\\n - Eye colors may be abbreviated (typically 3-letter codes) or spelled out - preserve as shown.\\n - Some licenses use all uppercase, others use mixed case - preserve capitalization.\\n - Less common colors may appear - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Eye Color: BLU' -> extract 'BLU'\\n \\u2713 Text shows 'Eyes: Brown' -> extract 'Brown'\\n \\u2713 Text shows 'EYE: HAZEL' -> extract 'HAZEL'\\n\\nAVOID:\\n \\u2717 Do NOT extract hair color as eye color\\n \\u2717 Do NOT normalize abbreviations - preserve as shown\\n \\u2717 Do NOT change capitalization\"}, \"hair_color\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The hair color of the license holder (if shown on the license).\\n\\nCOMMON LABELS: 'Hair Color', 'Hair', 'HAIR'\\n\\nLOCATION: Typically in the personal information section, often near height, weight, and eye color.; Usually in a clearly labeled field if present.; Not all states include hair color on driver's licenses (many have removed this field).; Look for hair color designations.\\n\\nFORMAT: Return hair color exactly as it appears on the license. Common values:\\n - 'BLK', 'BLACK'\\n - 'BLN', 'BLOND', 'BLONDE'\\n - 'BRN', 'BROWN'\\n - 'GRY', 'GRAY', 'GREY'\\n - 'RED'\\n - 'SDY', 'SANDY'\\n - 'WHI', 'WHITE'\\n - 'BAL', 'BALD'\\nPreserve the exact format and capitalization as shown. If hair color is not shown on the license, return null.\\n\\nEDGE CASES:\\n - Hair color is not included on all state licenses - return null if not present.\\n - Hair colors may be abbreviated (typically 3-letter codes) or spelled out - preserve as shown.\\n - Some licenses use all uppercase, others use mixed case - preserve capitalization.\\n - 'Bald' may be indicated with 'BAL' or 'BALD' - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Hair Color: BLK' -> extract 'BLK'\\n \\u2713 Text shows 'Hair: Brown' -> extract 'Brown'\\n \\u2713 Text shows 'HAIR: BALD' -> extract 'BALD'\\n \\u2713 Text shows 'Hair Color: (blank or not present)' -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract eye color as hair color\\n \\u2717 Do NOT return empty string if hair color is not shown - return null instead\\n \\u2717 Do NOT normalize abbreviations - preserve as shown\"}, \"sex\": {\"type\": \"string\", \"datapoint_prompt\": \"The sex or gender designation on the license.\\n\\nCOMMON LABELS: 'Sex', 'Gender', 'SEX', 'GENDER'\\n\\nLOCATION: Typically in the personal information section, often near date of birth and other identifying information.; Usually in a clearly labeled field.; Look for sex/gender designations.\\n\\nFORMAT: Return the sex/gender designation exactly as it appears on the license. Common values:\\n - 'M', 'MALE', 'Male'\\n - 'F', 'FEMALE', 'Female'\\n - 'X', 'NON-BINARY', 'Non-Binary' (in some states)\\nPreserve the exact format and capitalization as shown. May be a single letter or full word.\\n\\nEDGE CASES:\\n - Sex/gender may be abbreviated (typically 'M' or 'F') or spelled out - preserve as shown.\\n - Some licenses use all uppercase, others use mixed case - preserve capitalization.\\n - Some states now offer non-binary options (X, NON-BINARY) - preserve as shown if present.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Sex: M' -> extract 'M'\\n \\u2713 Text shows 'Gender: FEMALE' -> extract 'FEMALE'\\n \\u2713 Text shows 'SEX: F' -> extract 'F'\\n\\nAVOID:\\n \\u2717 Do NOT normalize to full words if abbreviated - preserve as shown\\n \\u2717 Do NOT change capitalization\\n \\u2717 Do NOT extract other fields as sex/gender\"}, \"issuing_state\": {\"type\": \"string\", \"datapoint_prompt\": \"The state or jurisdiction that issued the driver's license.\\n\\nCOMMON LABELS: 'Issued By', 'State', 'Issuing State', 'State of Issue', 'Jurisdiction', 'Issuing Authority'\\n\\nLOCATION: Typically in the header or top portion of the license.; Often appears prominently, sometimes as part of the license design or header.; May be in the state name/logo area.; Look for state names or abbreviations.\\n\\nFORMAT: Return the issuing state exactly as it appears on the license. Common formats:\\n - State abbreviation (e.g., 'CA', 'NY', 'TX', 'FL')\\n - Full state name (e.g., 'California', 'New York', 'Texas', 'Florida')\\n - May appear in the license header or design\\nPreserve the exact format and capitalization as shown.\\n\\nEDGE CASES:\\n - State may be shown as abbreviation or full name - preserve as shown.\\n - Some licenses show the state name prominently in the header/design - extract from there.\\n - District of Columbia may appear as 'DC' or 'District of Columbia' - preserve as shown.\\n - US territories (Puerto Rico, Guam, etc.) may be shown - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 License header shows 'CALIFORNIA' -> extract 'CALIFORNIA'\\n \\u2713 Text shows 'State: CA' -> extract 'CA'\\n \\u2713 Text shows 'Issued By: Texas' -> extract 'Texas'\\n\\nAVOID:\\n \\u2717 Do NOT extract addresses (which contain state names) as the issuing state\\n \\u2717 Do NOT extract other location references as the issuing state\"}}, \"required\": [\"license_number\", \"full_name\", \"date_of_birth\", \"address\", \"issue_date\", \"expiration_date\", \"license_class\", \"height\", \"eye_color\", \"sex\", \"issuing_state\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"issue_date\", \"end_field\": \"expiration_date\", \"min_days\": 1, \"max_days\": 3650, \"message\": \"Expiration date should be after issue date and within 10 years\"}, {\"type\": \"date_comparison\", \"field1\": \"date_of_birth\", \"field2\": \"issue_date\", \"comparison\": \"before\", \"message\": \"Date of birth should be before issue date (license holder must be at least 16 years old)\"}]}}", "true_json_output": "{\"license_number\": \"DL9 2006 00538573 (R)\", \"full_name\": \"T VIJAYA BHARATHI\", \"date_of_birth\": \"1966-06-15\", \"address\": \"C 609 NEW AROHI APTS PNO 13 SEC 12 DWARKA, SOUTH WEST DELHI 110078\", \"issue_date\": \"2021-06-28\", \"expiration_date\": \"2026-06-17\", \"license_class\": \"LMV\", \"restrictions\": null, \"endorsements\": null, \"height\": null, \"weight\": null, \"eye_color\": null, \"hair_color\": null, \"sex\": null, \"issuing_state\": \"DL\", \"source_filename\": \"d_l_2.pdf\"}", "true_markdown_output": "**License Number:** DL9 2006 00538573 (R)\n**Full Name:** T VIJAYA BHARATHI\n**Date Of Birth:** 1966-06-15\n**Address:** C 609 NEW AROHI APTS PNO 13 SEC 12 DWARKA, SOUTH WEST DELHI 110078\n**Issue Date:** 2021-06-28\n**Expiration Date:** 2026-06-17\n**License Class:** LMV\n**Restrictions:** N/A\n**Endorsements:** N/A\n**Height:** N/A\n**Weight:** N/A\n**Eye Color:** N/A\n**Hair Color:** N/A\n**Sex:** N/A\n**Issuing State:** DL"} {"file_name": "images/deed_1.png", "id": 4, "metadata": "{\"format\": \"DEED\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"deed_1.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"deed_type\": {\"type\": \"string\", \"datapoint_prompt\": \"The type of deed document (e.g., 'Warranty Deed', 'Quitclaim Deed', 'Grant Deed', 'Special Warranty Deed', 'Deed of Trust').\\n\\nCOMMON LABELS: The deed type typically appears in the document title or header.\\n\\nLOCATION: Usually at the top of the document in the title or header area.; Often appears prominently in large, bold text.; May be in the first few lines of the document.; Look for phrases like 'WARRANTY DEED', 'QUITCLAIM DEED', 'GRANT DEED', etc.\\n\\nFORMAT: Return the deed type exactly as it appears on the document. Common values:\\n - 'Warranty Deed'\\n - 'Quitclaim Deed'\\n - 'Grant Deed'\\n - 'Special Warranty Deed'\\n - 'Deed of Trust'\\n - 'Bargain and Sale Deed'\\n - 'Sheriff's Deed'\\n - 'Tax Deed'\\nPreserve capitalization and exact wording as shown.\\n\\nEDGE CASES:\\n - Deed types may be in all uppercase, title case, or mixed case - preserve as shown.\\n - Some documents may include additional qualifiers (e.g., 'Individual Warranty Deed') - include the full phrase.\\n - If the document title includes multiple words, extract the complete deed type phrase.\\n\\nEXAMPLES:\\n \\u2713 Document title shows 'WARRANTY DEED' -> extract 'WARRANTY DEED'\\n \\u2713 Document title shows 'Quitclaim Deed' -> extract 'Quitclaim Deed'\\n \\u2713 Document title shows 'SPECIAL WARRANTY DEED' -> extract 'SPECIAL WARRANTY DEED'\\n\\nAVOID:\\n \\u2717 Do NOT extract only part of the deed type (e.g., 'Warranty' when it says 'Warranty Deed')\\n \\u2717 Do NOT extract other document types or legal instruments as the deed type\"}, \"grantor_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name(s) of the grantor(s) - the person(s) or entity(ies) transferring/selling the property.\\n\\nCOMMON LABELS: 'Grantor', 'Grantor(s)', 'Grantors', 'Party of the First Part', 'Seller', 'Grantor:', 'Grantors:'\\n\\nLOCATION: Typically in the opening paragraph or introductory section of the deed.; Usually appears near the beginning of the document, before the property description.; Often follows phrases like 'Know All Men By These Presents' or 'This Deed'.; Look for names that appear after 'Grantor' labels or in the 'Party of the First Part' section.\\n\\nFORMAT: Return the grantor name(s) exactly as they appear on the document. Common formats:\\n - Single grantor: 'John Doe'\\n - Multiple grantors: 'John Doe and Jane Doe', 'John Doe, Jane Doe', 'John Doe and Jane Doe, as husband and wife'\\n - Entities: 'ABC Corporation', 'XYZ LLC', 'John and Jane Doe, Trustees'\\n - With marital status: 'John Doe and Jane Doe, husband and wife', 'John Doe, a single man'\\nPreserve capitalization, punctuation, and all qualifiers (marital status, entity types, trustee designations, etc.).\\n\\nEDGE CASES:\\n - Multiple grantors: Include all names as they appear, preserving conjunctions and separators.\\n - Marital status qualifiers: Include phrases like 'husband and wife', 'as tenants by the entirety', 'a single man/woman' if present.\\n - Entity designations: Include 'LLC', 'Inc.', 'Corporation', 'Trust', etc. if present.\\n - Trustee designations: Include 'Trustees', 'as Trustee', etc. if present.\\n - Names may appear in multiple places (signature area, notary section) - prefer the name in the main grantor section near the beginning.\\n - If grantors are listed with 'and' or '&', preserve the connector as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Grantor: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Grantors: John Doe and Jane Doe, husband and wife' -> extract 'John Doe and Jane Doe, husband and wife'\\n \\u2713 Text shows 'ABC Corporation, a Delaware corporation' -> extract 'ABC Corporation, a Delaware corporation'\\n \\u2713 Text shows 'John Doe and Jane Doe, Trustees of the Doe Family Trust' -> extract 'John Doe and Jane Doe, Trustees of the Doe Family Trust'\\n\\nAVOID:\\n \\u2717 Do NOT extract grantee (buyer) names as grantor names\\n \\u2717 Do NOT extract only last names when full names are provided\\n \\u2717 Do NOT extract witness or notary names as grantor names\"}, \"grantee_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name(s) of the grantee(s) - the person(s) or entity(ies) receiving/purchasing the property.\\n\\nCOMMON LABELS: 'Grantee', 'Grantee(s)', 'Grantees', 'Party of the Second Part', 'Buyer', 'Grantee:', 'Grantees:', 'To:'\\n\\nLOCATION: Typically in the opening paragraph or introductory section of the deed.; Usually appears near the beginning of the document, after grantor information.; Often follows phrases like 'does hereby grant' or 'convey and warrant to'.; Look for names that appear after 'Grantee' labels or in the 'Party of the Second Part' section.\\n\\nFORMAT: Return the grantee name(s) exactly as they appear on the document. Common formats:\\n - Single grantee: 'John Doe'\\n - Multiple grantees: 'John Doe and Jane Doe', 'John Doe, Jane Doe', 'John Doe and Jane Doe, as husband and wife'\\n - Entities: 'ABC Corporation', 'XYZ LLC', 'John and Jane Doe, Trustees'\\n - With marital status: 'John Doe and Jane Doe, husband and wife', 'John Doe, a single man'\\nPreserve capitalization, punctuation, and all qualifiers (marital status, entity types, trustee designations, etc.).\\n\\nEDGE CASES:\\n - Multiple grantees: Include all names as they appear, preserving conjunctions and separators.\\n - Marital status qualifiers: Include phrases like 'husband and wife', 'as tenants by the entirety', 'a single man/woman' if present.\\n - Entity designations: Include 'LLC', 'Inc.', 'Corporation', 'Trust', etc. if present.\\n - Trustee designations: Include 'Trustees', 'as Trustee', etc. if present.\\n - Names may appear in multiple places (signature area) - prefer the name in the main grantee section near the beginning.\\n - If grantees are listed with 'and' or '&', preserve the connector as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Grantee: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Grantees: John Doe and Jane Doe, husband and wife' -> extract 'John Doe and Jane Doe, husband and wife'\\n \\u2713 Text shows 'To: ABC Corporation, a Delaware corporation' -> extract 'ABC Corporation, a Delaware corporation'\\n \\u2713 Text shows 'John Doe and Jane Doe, Trustees of the Doe Family Trust' -> extract 'John Doe and Jane Doe, Trustees of the Doe Family Trust'\\n\\nAVOID:\\n \\u2717 Do NOT extract grantor (seller) names as grantee names\\n \\u2717 Do NOT extract only last names when full names are provided\\n \\u2717 Do NOT extract witness or notary names as grantee names\"}, \"property_address\": {\"type\": \"string\", \"datapoint_prompt\": \"The street address of the property being conveyed (if shown separately from the legal description).\\n\\nCOMMON LABELS: 'Property Address', 'Address', 'Street Address', 'Property Location', 'Situs', 'Common Address'\\n\\nLOCATION: Typically in a property information section, often near the legal description.; May appear in a separate address field or box.; Sometimes appears in the opening paragraph before the legal description.; Look for a clearly labeled address field or a street address that appears separately from the detailed legal description.\\n\\nFORMAT: Return the property address exactly as it appears on the document. Common formats:\\n - Single line: '123 Main Street, City, State 12345'\\n - Multi-line (join with commas): '123 Main Street\\\\nCity, State 12345' -> '123 Main Street, City, State 12345'\\n - With unit: '123 Main Street, Unit 4B, City, State 12345'\\nInclude street number, street name, city, state, and zip code if provided. If only street address is shown (without city/state/zip), return that.\\n\\nEDGE CASES:\\n - Property address may not always be explicitly labeled - look for street addresses that appear separate from legal descriptions.\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Some deeds only show the legal description without a common street address - return null if no street address is provided.\\n - If address appears in multiple places, prefer the one in a dedicated address field over one embedded in the legal description.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Property Address: 123 Main Street, Anytown, CA 12345' -> extract '123 Main Street, Anytown, CA 12345'\\n \\u2713 Text shows 'Address: 456 Oak Avenue\\\\nSpringfield, IL 62701' -> extract '456 Oak Avenue, Springfield, IL 62701'\\n \\u2713 Text shows '123 Pine Road' (no city/state shown) -> extract '123 Pine Road'\\n\\nAVOID:\\n \\u2717 Do NOT extract the legal description as the property address\\n \\u2717 Do NOT extract grantor or grantee addresses as the property address\\n \\u2717 Do NOT extract mailing addresses or PO boxes as the property address\"}, \"legal_description\": {\"type\": \"string\", \"datapoint_prompt\": \"The complete legal description of the property being conveyed. This is the detailed description that identifies the exact boundaries and location of the property.\\n\\nCOMMON LABELS: 'Legal Description', 'Property Description', 'Description', 'Parcel Description', 'Real Property Description', 'Land Description'\\n\\nLOCATION: Typically in the main body of the deed, often in a dedicated section.; Usually appears after the grantor/grantee information and before or after the consideration clause.; May span multiple paragraphs or lines.; Often begins with phrases like 'Lot', 'Tract', 'Parcel', 'Being', 'Situated', 'Beginning at', or contains metes and bounds descriptions.\\n\\nFORMAT: Return the complete legal description exactly as it appears on the document. Legal descriptions commonly include:\\n - Lot and block numbers (e.g., 'Lot 5, Block 3')\\n - Subdivision names (e.g., 'Sunset Hills Subdivision')\\n - Metes and bounds descriptions (e.g., 'Beginning at a point...')\\n - Township, Range, Section (e.g., 'T2N, R3W, Section 5')\\n - Reference to recorded maps or plats\\n - May span multiple paragraphs - include all paragraphs, preserving line breaks or joining with spaces.\\nPreserve all formatting, abbreviations, and technical language as shown.\\n\\nEDGE CASES:\\n - Legal descriptions may be very long and span multiple paragraphs - include the complete description.\\n - Descriptions may reference other documents (e.g., 'as shown on Map Book 45, Page 123') - include these references.\\n - Metes and bounds descriptions contain technical survey language - preserve exactly as shown.\\n - Some deeds may reference the legal description by saying 'as described in' another document - include that reference.\\n - If the description is split across multiple pages, include all parts.\\n - Preserve abbreviations (e.g., 'Lot', 'Blk', 'Subd', 'T', 'R', 'Sec').\\n\\nEXAMPLES:\\n \\u2713 'Lot 5, Block 3, Sunset Hills Subdivision, according to the official plat thereof recorded in Map Book 45, Page 123'\\n \\u2713 'The North 50 feet of Lot 10, Block 2, Green Valley Estates'\\n \\u2713 'Beginning at a point... [full metes and bounds description]'\\n \\u2713 'T2N, R3W, Section 5, NW1/4 of the SW1/4'\\n\\nAVOID:\\n \\u2717 Do NOT extract only part of the legal description - include the complete description\\n \\u2717 Do NOT extract the street address as the legal description\\n \\u2717 Do NOT extract property tax information or parcel numbers as the legal description (unless they're part of the description itself)\"}, \"consideration_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The consideration (sale price or value) paid for the property.\\n\\nCOMMON LABELS: 'Consideration', 'Consideration:', 'For the sum of', 'For the consideration of', 'Purchase Price', 'Sale Price', 'Amount', 'For and in consideration of'\\n\\nLOCATION: Typically in a consideration clause, often in the opening paragraphs of the deed.; Usually appears after the grantor/grantee information and before or near the legal description.; Often begins with phrases like 'For and in consideration of', 'For the sum of', 'For the consideration of'.; Look for currency amounts (dollar amounts) in this section.\\n\\nFORMAT: Return the consideration amount as a numeric value with two decimal places, no currency symbol and no thousands separators (e.g., '$150,000.00' -> 150000.00, '$10.00' -> 10.00). If the amount is written in words (e.g., 'Ten Dollars'), convert to numeric. If no consideration amount is specified or the deed states 'for love and affection' or similar non-monetary consideration, return null.\\n\\nEDGE CASES:\\n - Consideration may be written in words (e.g., 'Ten and 00/100 Dollars') - convert to numeric.\\n - Some deeds state 'for love and affection' or '$1.00 and other valuable consideration' - extract the dollar amount if specified, or return null if no monetary amount.\\n - Amounts may include cents (e.g., '$150,000.50') - preserve decimal precision.\\n - Some deeds may state 'nominal consideration' without specifying an amount - return null.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n - If multiple amounts appear, prefer the one in the consideration clause over other amounts in the document.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'For the sum of $150,000.00' -> extract 150000.00\\n \\u2713 Text shows 'Consideration: Ten and 00/100 Dollars ($10.00)' -> extract 10.00\\n \\u2713 Text shows 'For and in consideration of $1.00 and other valuable consideration' -> extract 1.00\\n \\u2713 Text shows 'For love and affection' (no monetary amount) -> extract null\\n \\u2713 Text shows 'For nominal consideration' (no amount specified) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract property tax amounts as consideration\\n \\u2717 Do NOT extract recording fees or other fees as consideration\\n \\u2717 Do NOT extract amounts from other sections (like tax information) as consideration\"}, \"deed_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date when the deed was executed (signed) by the grantor in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Dated', 'Date', 'Executed this', 'Executed on', 'Date of Deed', 'Deed Date', 'Date of Execution'\\n\\nLOCATION: Typically near the signature area at the end of the document.; Often appears on the same line as or near the grantor signature.; May appear in the notary acknowledgment section.; Sometimes appears in the opening paragraph or near the consideration clause.; Look for dates that are associated with the execution of the deed (when it was signed).\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2020' -> '2020-01-15')\\n - M/D/YYYY (e.g., '1/15/2020' -> '2020-01-15')\\n - MM-DD-YYYY (e.g., '01-15-2020' -> '2020-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2020' -> '2020-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2020' -> '2020-01-15')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, expand appropriately (e.g., '01/15/20' -> '2020-01-15').\\n\\nEDGE CASES:\\n - Deed date should be before or equal to the recording date (deeds are executed before being recorded).\\n - Two-digit years: Expand based on context.\\n - Some deeds may show only month and year - use the first day of the month if day is missing (e.g., '01/2020' -> '2020-01-01').\\n - If multiple dates appear, prefer the one near the signature/execution area over dates in other sections.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Dated: January 15, 2020' -> extract '2020-01-15'\\n \\u2713 Text shows 'Executed this 15th day of January, 2020' -> extract '2020-01-15'\\n \\u2713 Text shows 'Date: 1/15/2020' -> extract '2020-01-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract the recording date as the deed date (recording date is typically later)\\n \\u2717 Do NOT extract dates from the legal description or other sections as the deed date\\n \\u2717 Do NOT extract notary commission expiration dates as the deed date\"}, \"recording_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the deed was recorded with the county recorder's office in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Recorded', 'Recorded on', 'Recording Date', 'Date Recorded', 'Recorded:', 'Filed', 'Filed on', 'File Date'\\n\\nLOCATION: Typically at the top or bottom of the first page, often in a stamped or printed area.; Usually appears in a header or footer section with recording information.; May appear in a certification or recording stamp from the county recorder.; Often appears with book/page/instrument number information.; Look for dates that are associated with the recording of the document.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '02/20/2020' -> '2020-02-20')\\n - M/D/YYYY (e.g., '2/20/2020' -> '2020-02-20')\\n - MM-DD-YYYY (e.g., '02-20-2020' -> '2020-02-20')\\n - Month DD, YYYY (e.g., 'February 20, 2020' -> '2020-02-20')\\n - Mon DD, YYYY (e.g., 'Feb 20, 2020' -> '2020-02-20')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, expand appropriately. If no recording date is shown (unrecorded deed), return null.\\n\\nEDGE CASES:\\n - Recording date should be on or after the deed date (deeds are executed before being recorded).\\n - Some deeds may not be recorded yet - return null if no recording date is shown.\\n - Recording dates are often in stamped areas - look for official recorder stamps.\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Recording dates may appear in multiple formats (stamped, typed, handwritten) - extract as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Recorded: February 20, 2020' -> extract '2020-02-20'\\n \\u2713 Text shows 'Recorded on 02/20/2020' -> extract '2020-02-20'\\n \\u2713 Text shows 'FILED: Feb 20, 2020' -> extract '2020-02-20'\\n \\u2713 Text shows no recording date (unrecorded deed) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract the deed date (execution date) as the recording date\\n \\u2717 Do NOT extract dates from the legal description or other sections as the recording date\\n \\u2717 Do NOT extract notary dates as the recording date\"}, \"book_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The book number where the deed was recorded in the county recorder's office.\\n\\nCOMMON LABELS: 'Book', 'Book No.', 'Book Number', 'Bk', 'BK', 'Volume', 'Vol', 'Book:'\\n\\nLOCATION: Typically at the top or bottom of the first page, often in a stamped or printed area with recording information.; Usually appears near the recording date and page/instrument number.; Often in a header or footer section.; May appear with other recording information like 'Book X, Page Y'.; Look for book numbers in the recording information area.\\n\\nFORMAT: Return the book number exactly as it appears on the document. Book numbers may be:\\n - Numeric (e.g., '12345', '1234')\\n - Alphanumeric (e.g., 'A1234', 'BK-1234')\\n - With prefixes (e.g., 'Book 1234', 'BK 1234')\\nPreserve the exact format, including any prefixes, suffixes, or formatting. If no book number is shown (unrecorded deed), return null.\\n\\nEDGE CASES:\\n - Book numbers vary by county - some use numeric only, others include letters.\\n - Some counties use volume numbers instead of book numbers - extract as shown.\\n - Book numbers may have prefixes like 'BK', 'Book', or 'Vol' - preserve as shown or extract just the number.\\n - If the deed is unrecorded, there may be no book number - return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Book: 12345' -> extract '12345' or 'Book 12345'\\n \\u2713 Text shows 'BK 1234' -> extract '1234' or 'BK 1234'\\n \\u2713 Text shows 'Volume 567' -> extract '567' or 'Volume 567'\\n \\u2713 Text shows no book number (unrecorded) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract page numbers or instrument numbers as book numbers\\n \\u2717 Do NOT extract document numbers or reference numbers as book numbers\"}, \"page_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The page number where the deed was recorded in the county recorder's office (within the book).\\n\\nCOMMON LABELS: 'Page', 'Page No.', 'Page Number', 'Pg', 'PG', 'Page:', 'at Page'\\n\\nLOCATION: Typically at the top or bottom of the first page, often in a stamped or printed area with recording information.; Usually appears near the book number and instrument number.; Often in a header or footer section.; May appear with other recording information like 'Book X, Page Y'.; Look for page numbers in the recording information area.\\n\\nFORMAT: Return the page number exactly as it appears on the document. Page numbers are typically:\\n - Numeric (e.g., '123', '1234')\\n - May include suffixes (e.g., '123-A', '1234-1')\\n - With prefixes (e.g., 'Page 123', 'Pg 123')\\nPreserve the exact format, including any prefixes, suffixes, or formatting. If no page number is shown (unrecorded deed), return null.\\n\\nEDGE CASES:\\n - Page numbers are usually numeric but may include letter suffixes.\\n - Some counties use instrument numbers instead of or in addition to page numbers - distinguish between them.\\n - Page numbers may have prefixes like 'Page', 'Pg', or 'P' - preserve as shown or extract just the number.\\n - If the deed is unrecorded, there may be no page number - return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Page: 123' -> extract '123' or 'Page 123'\\n \\u2713 Text shows 'Pg 456' -> extract '456' or 'Pg 456'\\n \\u2713 Text shows 'at Page 789' -> extract '789' or 'at Page 789'\\n \\u2713 Text shows '123-A' -> extract '123-A'\\n \\u2713 Text shows no page number (unrecorded) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract book numbers or instrument numbers as page numbers\\n \\u2717 Do NOT extract document numbers or reference numbers as page numbers\"}, \"instrument_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The instrument number or document number assigned to the deed when it was recorded.\\n\\nCOMMON LABELS: 'Instrument No.', 'Instrument Number', 'Document No.', 'Document Number', 'Doc No.', 'Inst No.', 'Instrument:', 'Doc:'\\n\\nLOCATION: Typically at the top or bottom of the first page, often in a stamped or printed area with recording information.; Usually appears near the book number and page number.; Often in a header or footer section.; May appear with other recording information.; Look for instrument/document numbers in the recording information area.\\n\\nFORMAT: Return the instrument number exactly as it appears on the document. Instrument numbers may be:\\n - Numeric (e.g., '2020-001234', '123456')\\n - Alphanumeric (e.g., '2020-1234-A', 'INST-123456')\\n - With prefixes (e.g., 'Instrument No. 2020-001234', 'Doc 123456')\\nPreserve the exact format, including any prefixes, suffixes, dashes, or formatting. If no instrument number is shown (unrecorded deed), return null.\\n\\nEDGE CASES:\\n - Instrument numbers vary by county - formats differ significantly.\\n - Some counties use year prefixes (e.g., '2020-001234') - preserve the full format.\\n - Instrument numbers may have prefixes like 'Instrument No.', 'Doc No.', or 'Inst.' - preserve as shown or extract just the number.\\n - If the deed is unrecorded, there may be no instrument number - return null.\\n - Some counties use document numbers instead of instrument numbers - extract as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Instrument No.: 2020-001234' -> extract '2020-001234' or 'Instrument No. 2020-001234'\\n \\u2713 Text shows 'Doc No. 123456' -> extract '123456' or 'Doc No. 123456'\\n \\u2713 Text shows '2020-1234-A' -> extract '2020-1234-A'\\n \\u2713 Text shows no instrument number (unrecorded) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract book numbers or page numbers as instrument numbers\\n \\u2717 Do NOT extract parcel numbers or tax ID numbers as instrument numbers\\n \\u2717 Do NOT extract reference numbers from other sections as instrument numbers\"}, \"county\": {\"type\": \"string\", \"datapoint_prompt\": \"The county where the property is located and where the deed is recorded.\\n\\nCOMMON LABELS: 'County', 'County of', 'In the County of', 'Recorded in', 'State and County of', 'County:'\\n\\nLOCATION: Typically in the legal description section or in the recording information area.; Often appears at the beginning of the legal description (e.g., 'County of X, State of Y'); May appear in the header or footer with recording information.; Sometimes appears in the opening paragraph.; Look for county names in these areas.\\n\\nFORMAT: Return the county name exactly as it appears on the document. Common formats:\\n - County name only (e.g., 'Los Angeles', 'Cook', 'Harris')\\n - With 'County' (e.g., 'Los Angeles County', 'Cook County')\\nPreserve capitalization and exact wording. If the county name appears with 'County of' or 'In the County of', you may extract just the county name or include the phrase - be consistent.\\n\\nEDGE CASES:\\n - County names may appear with or without the word 'County' - preserve as shown or normalize to include 'County'.\\n - Some counties have unique names (e.g., 'District of Columbia' is not a county but may appear) - extract as shown.\\n - County names may appear in multiple places - prefer the one in the legal description or recording area.\\n - If the county appears in phrases like 'County of Los Angeles' or 'In the County of Cook', extract 'Los Angeles' or 'Cook County' (include 'County' if it helps clarity).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'County of Los Angeles' -> extract 'Los Angeles County' or 'County of Los Angeles'\\n \\u2713 Text shows 'Cook County' -> extract 'Cook County'\\n \\u2713 Text shows 'In the County of Harris' -> extract 'Harris County' or 'County of Harris'\\n\\nAVOID:\\n \\u2717 Do NOT extract state names as county names\\n \\u2717 Do NOT extract city names as county names\\n \\u2717 Do NOT extract other location references as county names\"}, \"state\": {\"type\": \"string\", \"datapoint_prompt\": \"The state where the property is located and where the deed is recorded.\\n\\nCOMMON LABELS: 'State', 'State of', 'In the State of', 'State:'\\n\\nLOCATION: Typically in the legal description section or in the recording information area.; Often appears at the beginning of the legal description (e.g., 'County of X, State of Y'); May appear in the header or footer with recording information.; Sometimes appears in the opening paragraph.; Look for state names in these areas.\\n\\nFORMAT: Return the state name exactly as it appears on the document. Common formats:\\n - Full state name (e.g., 'California', 'Texas', 'Florida')\\n - State abbreviation (e.g., 'CA', 'TX', 'FL')\\nPreserve capitalization and exact format. If both full name and abbreviation appear, prefer the full name, but preserve as shown if only one format appears.\\n\\nEDGE CASES:\\n - State names may appear as full names or abbreviations - preserve as shown.\\n - States may appear in phrases like 'State of California' or 'In the State of Texas' - extract 'California' or 'Texas' (the state name itself).\\n - State names may appear in multiple places - prefer the one in the legal description or recording area.\\n - District of Columbia may appear - extract as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'State of California' -> extract 'California'\\n \\u2713 Text shows 'TX' -> extract 'TX'\\n \\u2713 Text shows 'In the State of Florida' -> extract 'Florida'\\n\\nAVOID:\\n \\u2717 Do NOT extract county names as state names\\n \\u2717 Do NOT extract city names as state names\\n \\u2717 Do NOT extract country names as state names\"}}, \"required\": [\"deed_type\", \"grantor_name\", \"grantee_name\", \"legal_description\", \"county\", \"state\"], \"validation\": {\"cross_field\": [{\"type\": \"date_comparison\", \"field1\": \"deed_date\", \"field2\": \"recording_date\", \"comparison\": \"before_or_equal\", \"message\": \"Deed date (execution date) should be before or equal to recording date (deeds are executed before being recorded)\"}]}}", "true_json_output": "{\"deed_type\": \"Warranty Deed\", \"grantor_name\": \"KIRBY DOBBS, an unmarried man and IVA DOBBS, an unmarried woman, AS KIRBY DOBBS and IVA DOBBS, husband and wife\", \"grantee_name\": \"GEORGE BAKER and CAROLYN BAKER, husband and wife\", \"property_address\": null, \"legal_description\": \"All of the Southwest Quarter (SW1/4) of the Northwest Quarter (NW1/4), Blocks One (1), Two (2) and Three (3) in Leeton P. Pierce and Wife's Subdivision (recorded in Plat Book 10 at page 92) of the Southeast Quarter (SE1/4) of the Northwest Quarter (NW1/4) and the Southwest Quarter (SW1/4) of the Northeast Quarter (NE1/4), the Southwest Quarter (SW1/4) and Block One (1) in Wells G. Winnan and Albert N. Winnan, her husband, Subdivision (recorded in Plat Book 4 at page 12) of the Southeast Quarter (SE1/4) of the Southeast Quarter (SE1/4), all in Section Twenty-One (21) in Township Twenty-three (23) North of the base line and Range Four (4) West of the Fifth Principal Meridian; Containing two hundred forty-one and 8/10 (241.8) acres of land be it more or less;\", \"consideration_amount\": 10.0, \"deed_date\": \"1972-04-11\", \"recording_date\": null, \"book_number\": null, \"page_number\": \"250\", \"instrument_number\": null, \"county\": \"Oregon County\", \"state\": \"Missouri\", \"source_filename\": \"deed_1.pdf\"}", "true_markdown_output": "**Deed Type:** Warranty Deed\n**Grantor Name:** KIRBY DOBBS, an unmarried man and IVA DOBBS, an unmarried woman, AS KIRBY DOBBS and IVA DOBBS, husband and wife\n**Grantee Name:** GEORGE BAKER and CAROLYN BAKER, husband and wife\n**Property Address:** N/A\n**Legal Description:** All of the Southwest Quarter (SW1/4) of the Northwest Quarter (NW1/4), Blocks One (1), Two (2) and Three (3) in Leeton P. Pierce and Wife's Subdivision (recorded in Plat Book 10 at page 92) of the Southeast Quarter (SE1/4) of the Northwest Quarter (NW1/4) and the Southwest Quarter (SW1/4) of the Northeast Quarter (NE1/4), the Southwest Quarter (SW1/4) and Block One (1) in Wells G. Winnan and Albert N. Winnan, her husband, Subdivision (recorded in Plat Book 4 at page 12) of the Southeast Quarter (SE1/4) of the Southeast Quarter (SE1/4), all in Section Twenty-One (21) in Township Twenty-three (23) North of the base line and Range Four (4) West of the Fifth Principal Meridian; Containing two hundred forty-one and 8/10 (241.8) acres of land be it more or less;\n**Consideration Amount:** 10.0\n**Deed Date:** 1972-04-11\n**Recording Date:** N/A\n**Book Number:** N/A\n**Page Number:** 250\n**Instrument Number:** N/A\n**County:** Oregon County\n**State:** Missouri"} {"file_name": "images/deed_2_.png", "id": 5, "metadata": "{\"format\": \"DEED\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"deed_2_.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"deed_type\": {\"type\": \"string\", \"datapoint_prompt\": \"The type of deed document (e.g., 'Warranty Deed', 'Quitclaim Deed', 'Grant Deed', 'Special Warranty Deed', 'Deed of Trust').\\n\\nCOMMON LABELS: The deed type typically appears in the document title or header.\\n\\nLOCATION: Usually at the top of the document in the title or header area.; Often appears prominently in large, bold text.; May be in the first few lines of the document.; Look for phrases like 'WARRANTY DEED', 'QUITCLAIM DEED', 'GRANT DEED', etc.\\n\\nFORMAT: Return the deed type exactly as it appears on the document. Common values:\\n - 'Warranty Deed'\\n - 'Quitclaim Deed'\\n - 'Grant Deed'\\n - 'Special Warranty Deed'\\n - 'Deed of Trust'\\n - 'Bargain and Sale Deed'\\n - 'Sheriff's Deed'\\n - 'Tax Deed'\\nPreserve capitalization and exact wording as shown.\\n\\nEDGE CASES:\\n - Deed types may be in all uppercase, title case, or mixed case - preserve as shown.\\n - Some documents may include additional qualifiers (e.g., 'Individual Warranty Deed') - include the full phrase.\\n - If the document title includes multiple words, extract the complete deed type phrase.\\n\\nEXAMPLES:\\n \\u2713 Document title shows 'WARRANTY DEED' -> extract 'WARRANTY DEED'\\n \\u2713 Document title shows 'Quitclaim Deed' -> extract 'Quitclaim Deed'\\n \\u2713 Document title shows 'SPECIAL WARRANTY DEED' -> extract 'SPECIAL WARRANTY DEED'\\n\\nAVOID:\\n \\u2717 Do NOT extract only part of the deed type (e.g., 'Warranty' when it says 'Warranty Deed')\\n \\u2717 Do NOT extract other document types or legal instruments as the deed type\"}, \"grantor_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name(s) of the grantor(s) - the person(s) or entity(ies) transferring/selling the property.\\n\\nCOMMON LABELS: 'Grantor', 'Grantor(s)', 'Grantors', 'Party of the First Part', 'Seller', 'Grantor:', 'Grantors:'\\n\\nLOCATION: Typically in the opening paragraph or introductory section of the deed.; Usually appears near the beginning of the document, before the property description.; Often follows phrases like 'Know All Men By These Presents' or 'This Deed'.; Look for names that appear after 'Grantor' labels or in the 'Party of the First Part' section.\\n\\nFORMAT: Return the grantor name(s) exactly as they appear on the document. Common formats:\\n - Single grantor: 'John Doe'\\n - Multiple grantors: 'John Doe and Jane Doe', 'John Doe, Jane Doe', 'John Doe and Jane Doe, as husband and wife'\\n - Entities: 'ABC Corporation', 'XYZ LLC', 'John and Jane Doe, Trustees'\\n - With marital status: 'John Doe and Jane Doe, husband and wife', 'John Doe, a single man'\\nPreserve capitalization, punctuation, and all qualifiers (marital status, entity types, trustee designations, etc.).\\n\\nEDGE CASES:\\n - Multiple grantors: Include all names as they appear, preserving conjunctions and separators.\\n - Marital status qualifiers: Include phrases like 'husband and wife', 'as tenants by the entirety', 'a single man/woman' if present.\\n - Entity designations: Include 'LLC', 'Inc.', 'Corporation', 'Trust', etc. if present.\\n - Trustee designations: Include 'Trustees', 'as Trustee', etc. if present.\\n - Names may appear in multiple places (signature area, notary section) - prefer the name in the main grantor section near the beginning.\\n - If grantors are listed with 'and' or '&', preserve the connector as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Grantor: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Grantors: John Doe and Jane Doe, husband and wife' -> extract 'John Doe and Jane Doe, husband and wife'\\n \\u2713 Text shows 'ABC Corporation, a Delaware corporation' -> extract 'ABC Corporation, a Delaware corporation'\\n \\u2713 Text shows 'John Doe and Jane Doe, Trustees of the Doe Family Trust' -> extract 'John Doe and Jane Doe, Trustees of the Doe Family Trust'\\n\\nAVOID:\\n \\u2717 Do NOT extract grantee (buyer) names as grantor names\\n \\u2717 Do NOT extract only last names when full names are provided\\n \\u2717 Do NOT extract witness or notary names as grantor names\"}, \"grantee_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name(s) of the grantee(s) - the person(s) or entity(ies) receiving/purchasing the property.\\n\\nCOMMON LABELS: 'Grantee', 'Grantee(s)', 'Grantees', 'Party of the Second Part', 'Buyer', 'Grantee:', 'Grantees:', 'To:'\\n\\nLOCATION: Typically in the opening paragraph or introductory section of the deed.; Usually appears near the beginning of the document, after grantor information.; Often follows phrases like 'does hereby grant' or 'convey and warrant to'.; Look for names that appear after 'Grantee' labels or in the 'Party of the Second Part' section.\\n\\nFORMAT: Return the grantee name(s) exactly as they appear on the document. Common formats:\\n - Single grantee: 'John Doe'\\n - Multiple grantees: 'John Doe and Jane Doe', 'John Doe, Jane Doe', 'John Doe and Jane Doe, as husband and wife'\\n - Entities: 'ABC Corporation', 'XYZ LLC', 'John and Jane Doe, Trustees'\\n - With marital status: 'John Doe and Jane Doe, husband and wife', 'John Doe, a single man'\\nPreserve capitalization, punctuation, and all qualifiers (marital status, entity types, trustee designations, etc.).\\n\\nEDGE CASES:\\n - Multiple grantees: Include all names as they appear, preserving conjunctions and separators.\\n - Marital status qualifiers: Include phrases like 'husband and wife', 'as tenants by the entirety', 'a single man/woman' if present.\\n - Entity designations: Include 'LLC', 'Inc.', 'Corporation', 'Trust', etc. if present.\\n - Trustee designations: Include 'Trustees', 'as Trustee', etc. if present.\\n - Names may appear in multiple places (signature area) - prefer the name in the main grantee section near the beginning.\\n - If grantees are listed with 'and' or '&', preserve the connector as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Grantee: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Grantees: John Doe and Jane Doe, husband and wife' -> extract 'John Doe and Jane Doe, husband and wife'\\n \\u2713 Text shows 'To: ABC Corporation, a Delaware corporation' -> extract 'ABC Corporation, a Delaware corporation'\\n \\u2713 Text shows 'John Doe and Jane Doe, Trustees of the Doe Family Trust' -> extract 'John Doe and Jane Doe, Trustees of the Doe Family Trust'\\n\\nAVOID:\\n \\u2717 Do NOT extract grantor (seller) names as grantee names\\n \\u2717 Do NOT extract only last names when full names are provided\\n \\u2717 Do NOT extract witness or notary names as grantee names\"}, \"property_address\": {\"type\": \"string\", \"datapoint_prompt\": \"The street address of the property being conveyed (if shown separately from the legal description).\\n\\nCOMMON LABELS: 'Property Address', 'Address', 'Street Address', 'Property Location', 'Situs', 'Common Address'\\n\\nLOCATION: Typically in a property information section, often near the legal description.; May appear in a separate address field or box.; Sometimes appears in the opening paragraph before the legal description.; Look for a clearly labeled address field or a street address that appears separately from the detailed legal description.\\n\\nFORMAT: Return the property address exactly as it appears on the document. Common formats:\\n - Single line: '123 Main Street, City, State 12345'\\n - Multi-line (join with commas): '123 Main Street\\\\nCity, State 12345' -> '123 Main Street, City, State 12345'\\n - With unit: '123 Main Street, Unit 4B, City, State 12345'\\nInclude street number, street name, city, state, and zip code if provided. If only street address is shown (without city/state/zip), return that.\\n\\nEDGE CASES:\\n - Property address may not always be explicitly labeled - look for street addresses that appear separate from legal descriptions.\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Some deeds only show the legal description without a common street address - return null if no street address is provided.\\n - If address appears in multiple places, prefer the one in a dedicated address field over one embedded in the legal description.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Property Address: 123 Main Street, Anytown, CA 12345' -> extract '123 Main Street, Anytown, CA 12345'\\n \\u2713 Text shows 'Address: 456 Oak Avenue\\\\nSpringfield, IL 62701' -> extract '456 Oak Avenue, Springfield, IL 62701'\\n \\u2713 Text shows '123 Pine Road' (no city/state shown) -> extract '123 Pine Road'\\n\\nAVOID:\\n \\u2717 Do NOT extract the legal description as the property address\\n \\u2717 Do NOT extract grantor or grantee addresses as the property address\\n \\u2717 Do NOT extract mailing addresses or PO boxes as the property address\"}, \"legal_description\": {\"type\": \"string\", \"datapoint_prompt\": \"The complete legal description of the property being conveyed. This is the detailed description that identifies the exact boundaries and location of the property.\\n\\nCOMMON LABELS: 'Legal Description', 'Property Description', 'Description', 'Parcel Description', 'Real Property Description', 'Land Description'\\n\\nLOCATION: Typically in the main body of the deed, often in a dedicated section.; Usually appears after the grantor/grantee information and before or after the consideration clause.; May span multiple paragraphs or lines.; Often begins with phrases like 'Lot', 'Tract', 'Parcel', 'Being', 'Situated', 'Beginning at', or contains metes and bounds descriptions.\\n\\nFORMAT: Return the complete legal description exactly as it appears on the document. Legal descriptions commonly include:\\n - Lot and block numbers (e.g., 'Lot 5, Block 3')\\n - Subdivision names (e.g., 'Sunset Hills Subdivision')\\n - Metes and bounds descriptions (e.g., 'Beginning at a point...')\\n - Township, Range, Section (e.g., 'T2N, R3W, Section 5')\\n - Reference to recorded maps or plats\\n - May span multiple paragraphs - include all paragraphs, preserving line breaks or joining with spaces.\\nPreserve all formatting, abbreviations, and technical language as shown.\\n\\nEDGE CASES:\\n - Legal descriptions may be very long and span multiple paragraphs - include the complete description.\\n - Descriptions may reference other documents (e.g., 'as shown on Map Book 45, Page 123') - include these references.\\n - Metes and bounds descriptions contain technical survey language - preserve exactly as shown.\\n - Some deeds may reference the legal description by saying 'as described in' another document - include that reference.\\n - If the description is split across multiple pages, include all parts.\\n - Preserve abbreviations (e.g., 'Lot', 'Blk', 'Subd', 'T', 'R', 'Sec').\\n\\nEXAMPLES:\\n \\u2713 'Lot 5, Block 3, Sunset Hills Subdivision, according to the official plat thereof recorded in Map Book 45, Page 123'\\n \\u2713 'The North 50 feet of Lot 10, Block 2, Green Valley Estates'\\n \\u2713 'Beginning at a point... [full metes and bounds description]'\\n \\u2713 'T2N, R3W, Section 5, NW1/4 of the SW1/4'\\n\\nAVOID:\\n \\u2717 Do NOT extract only part of the legal description - include the complete description\\n \\u2717 Do NOT extract the street address as the legal description\\n \\u2717 Do NOT extract property tax information or parcel numbers as the legal description (unless they're part of the description itself)\"}, \"consideration_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The consideration (sale price or value) paid for the property.\\n\\nCOMMON LABELS: 'Consideration', 'Consideration:', 'For the sum of', 'For the consideration of', 'Purchase Price', 'Sale Price', 'Amount', 'For and in consideration of'\\n\\nLOCATION: Typically in a consideration clause, often in the opening paragraphs of the deed.; Usually appears after the grantor/grantee information and before or near the legal description.; Often begins with phrases like 'For and in consideration of', 'For the sum of', 'For the consideration of'.; Look for currency amounts (dollar amounts) in this section.\\n\\nFORMAT: Return the consideration amount as a numeric value with two decimal places, no currency symbol and no thousands separators (e.g., '$150,000.00' -> 150000.00, '$10.00' -> 10.00). If the amount is written in words (e.g., 'Ten Dollars'), convert to numeric. If no consideration amount is specified or the deed states 'for love and affection' or similar non-monetary consideration, return null.\\n\\nEDGE CASES:\\n - Consideration may be written in words (e.g., 'Ten and 00/100 Dollars') - convert to numeric.\\n - Some deeds state 'for love and affection' or '$1.00 and other valuable consideration' - extract the dollar amount if specified, or return null if no monetary amount.\\n - Amounts may include cents (e.g., '$150,000.50') - preserve decimal precision.\\n - Some deeds may state 'nominal consideration' without specifying an amount - return null.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n - If multiple amounts appear, prefer the one in the consideration clause over other amounts in the document.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'For the sum of $150,000.00' -> extract 150000.00\\n \\u2713 Text shows 'Consideration: Ten and 00/100 Dollars ($10.00)' -> extract 10.00\\n \\u2713 Text shows 'For and in consideration of $1.00 and other valuable consideration' -> extract 1.00\\n \\u2713 Text shows 'For love and affection' (no monetary amount) -> extract null\\n \\u2713 Text shows 'For nominal consideration' (no amount specified) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract property tax amounts as consideration\\n \\u2717 Do NOT extract recording fees or other fees as consideration\\n \\u2717 Do NOT extract amounts from other sections (like tax information) as consideration\"}, \"deed_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date when the deed was executed (signed) by the grantor in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Dated', 'Date', 'Executed this', 'Executed on', 'Date of Deed', 'Deed Date', 'Date of Execution'\\n\\nLOCATION: Typically near the signature area at the end of the document.; Often appears on the same line as or near the grantor signature.; May appear in the notary acknowledgment section.; Sometimes appears in the opening paragraph or near the consideration clause.; Look for dates that are associated with the execution of the deed (when it was signed).\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2020' -> '2020-01-15')\\n - M/D/YYYY (e.g., '1/15/2020' -> '2020-01-15')\\n - MM-DD-YYYY (e.g., '01-15-2020' -> '2020-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2020' -> '2020-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2020' -> '2020-01-15')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, expand appropriately (e.g., '01/15/20' -> '2020-01-15').\\n\\nEDGE CASES:\\n - Deed date should be before or equal to the recording date (deeds are executed before being recorded).\\n - Two-digit years: Expand based on context.\\n - Some deeds may show only month and year - use the first day of the month if day is missing (e.g., '01/2020' -> '2020-01-01').\\n - If multiple dates appear, prefer the one near the signature/execution area over dates in other sections.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Dated: January 15, 2020' -> extract '2020-01-15'\\n \\u2713 Text shows 'Executed this 15th day of January, 2020' -> extract '2020-01-15'\\n \\u2713 Text shows 'Date: 1/15/2020' -> extract '2020-01-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract the recording date as the deed date (recording date is typically later)\\n \\u2717 Do NOT extract dates from the legal description or other sections as the deed date\\n \\u2717 Do NOT extract notary commission expiration dates as the deed date\"}, \"recording_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the deed was recorded with the county recorder's office in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Recorded', 'Recorded on', 'Recording Date', 'Date Recorded', 'Recorded:', 'Filed', 'Filed on', 'File Date'\\n\\nLOCATION: Typically at the top or bottom of the first page, often in a stamped or printed area.; Usually appears in a header or footer section with recording information.; May appear in a certification or recording stamp from the county recorder.; Often appears with book/page/instrument number information.; Look for dates that are associated with the recording of the document.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '02/20/2020' -> '2020-02-20')\\n - M/D/YYYY (e.g., '2/20/2020' -> '2020-02-20')\\n - MM-DD-YYYY (e.g., '02-20-2020' -> '2020-02-20')\\n - Month DD, YYYY (e.g., 'February 20, 2020' -> '2020-02-20')\\n - Mon DD, YYYY (e.g., 'Feb 20, 2020' -> '2020-02-20')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits, expand appropriately. If no recording date is shown (unrecorded deed), return null.\\n\\nEDGE CASES:\\n - Recording date should be on or after the deed date (deeds are executed before being recorded).\\n - Some deeds may not be recorded yet - return null if no recording date is shown.\\n - Recording dates are often in stamped areas - look for official recorder stamps.\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Recording dates may appear in multiple formats (stamped, typed, handwritten) - extract as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Recorded: February 20, 2020' -> extract '2020-02-20'\\n \\u2713 Text shows 'Recorded on 02/20/2020' -> extract '2020-02-20'\\n \\u2713 Text shows 'FILED: Feb 20, 2020' -> extract '2020-02-20'\\n \\u2713 Text shows no recording date (unrecorded deed) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract the deed date (execution date) as the recording date\\n \\u2717 Do NOT extract dates from the legal description or other sections as the recording date\\n \\u2717 Do NOT extract notary dates as the recording date\"}, \"book_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The book number where the deed was recorded in the county recorder's office.\\n\\nCOMMON LABELS: 'Book', 'Book No.', 'Book Number', 'Bk', 'BK', 'Volume', 'Vol', 'Book:'\\n\\nLOCATION: Typically at the top or bottom of the first page, often in a stamped or printed area with recording information.; Usually appears near the recording date and page/instrument number.; Often in a header or footer section.; May appear with other recording information like 'Book X, Page Y'.; Look for book numbers in the recording information area.\\n\\nFORMAT: Return the book number exactly as it appears on the document. Book numbers may be:\\n - Numeric (e.g., '12345', '1234')\\n - Alphanumeric (e.g., 'A1234', 'BK-1234')\\n - With prefixes (e.g., 'Book 1234', 'BK 1234')\\nPreserve the exact format, including any prefixes, suffixes, or formatting. If no book number is shown (unrecorded deed), return null.\\n\\nEDGE CASES:\\n - Book numbers vary by county - some use numeric only, others include letters.\\n - Some counties use volume numbers instead of book numbers - extract as shown.\\n - Book numbers may have prefixes like 'BK', 'Book', or 'Vol' - preserve as shown or extract just the number.\\n - If the deed is unrecorded, there may be no book number - return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Book: 12345' -> extract '12345' or 'Book 12345'\\n \\u2713 Text shows 'BK 1234' -> extract '1234' or 'BK 1234'\\n \\u2713 Text shows 'Volume 567' -> extract '567' or 'Volume 567'\\n \\u2713 Text shows no book number (unrecorded) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract page numbers or instrument numbers as book numbers\\n \\u2717 Do NOT extract document numbers or reference numbers as book numbers\"}, \"page_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The page number where the deed was recorded in the county recorder's office (within the book).\\n\\nCOMMON LABELS: 'Page', 'Page No.', 'Page Number', 'Pg', 'PG', 'Page:', 'at Page'\\n\\nLOCATION: Typically at the top or bottom of the first page, often in a stamped or printed area with recording information.; Usually appears near the book number and instrument number.; Often in a header or footer section.; May appear with other recording information like 'Book X, Page Y'.; Look for page numbers in the recording information area.\\n\\nFORMAT: Return the page number exactly as it appears on the document. Page numbers are typically:\\n - Numeric (e.g., '123', '1234')\\n - May include suffixes (e.g., '123-A', '1234-1')\\n - With prefixes (e.g., 'Page 123', 'Pg 123')\\nPreserve the exact format, including any prefixes, suffixes, or formatting. If no page number is shown (unrecorded deed), return null.\\n\\nEDGE CASES:\\n - Page numbers are usually numeric but may include letter suffixes.\\n - Some counties use instrument numbers instead of or in addition to page numbers - distinguish between them.\\n - Page numbers may have prefixes like 'Page', 'Pg', or 'P' - preserve as shown or extract just the number.\\n - If the deed is unrecorded, there may be no page number - return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Page: 123' -> extract '123' or 'Page 123'\\n \\u2713 Text shows 'Pg 456' -> extract '456' or 'Pg 456'\\n \\u2713 Text shows 'at Page 789' -> extract '789' or 'at Page 789'\\n \\u2713 Text shows '123-A' -> extract '123-A'\\n \\u2713 Text shows no page number (unrecorded) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract book numbers or instrument numbers as page numbers\\n \\u2717 Do NOT extract document numbers or reference numbers as page numbers\"}, \"instrument_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The instrument number or document number assigned to the deed when it was recorded.\\n\\nCOMMON LABELS: 'Instrument No.', 'Instrument Number', 'Document No.', 'Document Number', 'Doc No.', 'Inst No.', 'Instrument:', 'Doc:'\\n\\nLOCATION: Typically at the top or bottom of the first page, often in a stamped or printed area with recording information.; Usually appears near the book number and page number.; Often in a header or footer section.; May appear with other recording information.; Look for instrument/document numbers in the recording information area.\\n\\nFORMAT: Return the instrument number exactly as it appears on the document. Instrument numbers may be:\\n - Numeric (e.g., '2020-001234', '123456')\\n - Alphanumeric (e.g., '2020-1234-A', 'INST-123456')\\n - With prefixes (e.g., 'Instrument No. 2020-001234', 'Doc 123456')\\nPreserve the exact format, including any prefixes, suffixes, dashes, or formatting. If no instrument number is shown (unrecorded deed), return null.\\n\\nEDGE CASES:\\n - Instrument numbers vary by county - formats differ significantly.\\n - Some counties use year prefixes (e.g., '2020-001234') - preserve the full format.\\n - Instrument numbers may have prefixes like 'Instrument No.', 'Doc No.', or 'Inst.' - preserve as shown or extract just the number.\\n - If the deed is unrecorded, there may be no instrument number - return null.\\n - Some counties use document numbers instead of instrument numbers - extract as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Instrument No.: 2020-001234' -> extract '2020-001234' or 'Instrument No. 2020-001234'\\n \\u2713 Text shows 'Doc No. 123456' -> extract '123456' or 'Doc No. 123456'\\n \\u2713 Text shows '2020-1234-A' -> extract '2020-1234-A'\\n \\u2713 Text shows no instrument number (unrecorded) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract book numbers or page numbers as instrument numbers\\n \\u2717 Do NOT extract parcel numbers or tax ID numbers as instrument numbers\\n \\u2717 Do NOT extract reference numbers from other sections as instrument numbers\"}, \"county\": {\"type\": \"string\", \"datapoint_prompt\": \"The county where the property is located and where the deed is recorded.\\n\\nCOMMON LABELS: 'County', 'County of', 'In the County of', 'Recorded in', 'State and County of', 'County:'\\n\\nLOCATION: Typically in the legal description section or in the recording information area.; Often appears at the beginning of the legal description (e.g., 'County of X, State of Y'); May appear in the header or footer with recording information.; Sometimes appears in the opening paragraph.; Look for county names in these areas.\\n\\nFORMAT: Return the county name exactly as it appears on the document. Common formats:\\n - County name only (e.g., 'Los Angeles', 'Cook', 'Harris')\\n - With 'County' (e.g., 'Los Angeles County', 'Cook County')\\nPreserve capitalization and exact wording. If the county name appears with 'County of' or 'In the County of', you may extract just the county name or include the phrase - be consistent.\\n\\nEDGE CASES:\\n - County names may appear with or without the word 'County' - preserve as shown or normalize to include 'County'.\\n - Some counties have unique names (e.g., 'District of Columbia' is not a county but may appear) - extract as shown.\\n - County names may appear in multiple places - prefer the one in the legal description or recording area.\\n - If the county appears in phrases like 'County of Los Angeles' or 'In the County of Cook', extract 'Los Angeles' or 'Cook County' (include 'County' if it helps clarity).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'County of Los Angeles' -> extract 'Los Angeles County' or 'County of Los Angeles'\\n \\u2713 Text shows 'Cook County' -> extract 'Cook County'\\n \\u2713 Text shows 'In the County of Harris' -> extract 'Harris County' or 'County of Harris'\\n\\nAVOID:\\n \\u2717 Do NOT extract state names as county names\\n \\u2717 Do NOT extract city names as county names\\n \\u2717 Do NOT extract other location references as county names\"}, \"state\": {\"type\": \"string\", \"datapoint_prompt\": \"The state where the property is located and where the deed is recorded.\\n\\nCOMMON LABELS: 'State', 'State of', 'In the State of', 'State:'\\n\\nLOCATION: Typically in the legal description section or in the recording information area.; Often appears at the beginning of the legal description (e.g., 'County of X, State of Y'); May appear in the header or footer with recording information.; Sometimes appears in the opening paragraph.; Look for state names in these areas.\\n\\nFORMAT: Return the state name exactly as it appears on the document. Common formats:\\n - Full state name (e.g., 'California', 'Texas', 'Florida')\\n - State abbreviation (e.g., 'CA', 'TX', 'FL')\\nPreserve capitalization and exact format. If both full name and abbreviation appear, prefer the full name, but preserve as shown if only one format appears.\\n\\nEDGE CASES:\\n - State names may appear as full names or abbreviations - preserve as shown.\\n - States may appear in phrases like 'State of California' or 'In the State of Texas' - extract 'California' or 'Texas' (the state name itself).\\n - State names may appear in multiple places - prefer the one in the legal description or recording area.\\n - District of Columbia may appear - extract as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'State of California' -> extract 'California'\\n \\u2713 Text shows 'TX' -> extract 'TX'\\n \\u2713 Text shows 'In the State of Florida' -> extract 'Florida'\\n\\nAVOID:\\n \\u2717 Do NOT extract county names as state names\\n \\u2717 Do NOT extract city names as state names\\n \\u2717 Do NOT extract country names as state names\"}}, \"required\": [\"deed_type\", \"grantor_name\", \"grantee_name\", \"legal_description\", \"county\", \"state\"], \"validation\": {\"cross_field\": [{\"type\": \"date_comparison\", \"field1\": \"deed_date\", \"field2\": \"recording_date\", \"comparison\": \"before_or_equal\", \"message\": \"Deed date (execution date) should be before or equal to recording date (deeds are executed before being recorded)\"}]}}", "true_json_output": "{\"deed_type\": \"WARRANTY DEED\", \"grantor_name\": \"Sri Harsha Puli and Sridevi Karemola\", \"grantee_name\": \"Sri Harsha Puli\", \"property_address\": null, \"legal_description\": \"SEE ATTACHED EXHIBIT 'A' ATTACHED HERETO AND MADE A PART HEREOF BY REFERENCE HERETO\", \"consideration_amount\": null, \"deed_date\": \"2023-03-13\", \"recording_date\": \"2023-03-14\", \"book_number\": \"BK 10951\", \"page_number\": \"PG 59 - 61\", \"instrument_number\": null, \"county\": \"Forsyth County\", \"state\": \"GEORGIA\", \"source_filename\": \"deed_2_.pdf\"}", "true_markdown_output": "**Deed Type:** WARRANTY DEED\n**Grantor Name:** Sri Harsha Puli and Sridevi Karemola\n**Grantee Name:** Sri Harsha Puli\n**Property Address:** N/A\n**Legal Description:** SEE ATTACHED EXHIBIT 'A' ATTACHED HERETO AND MADE A PART HEREOF BY REFERENCE HERETO\n**Consideration Amount:** N/A\n**Deed Date:** 2023-03-13\n**Recording Date:** 2023-03-14\n**Book Number:** BK 10951\n**Page Number:** PG 59 - 61\n**Instrument Number:** N/A\n**County:** Forsyth County\n**State:** GEORGIA"} {"file_name": "images/insurance.png", "id": 6, "metadata": "{\"format\": \"INSURANCE\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"insurance.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"insurance_company_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the insurance company or carrier that issued the insurance document.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - header, body, footer, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: Insurance company name typically appears prominently in the header/logo area at the top of the document.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the header area with the company logo.; Within the first 10-20% of page height, centered or left-aligned.; May appear in larger, bold font near the document title.; Often appears with the insurance company logo or branding.; May also appear in footer, letterhead, or contact sections.\\n\\nFORMAT: Return the insurance company name as it appears on the document. Common formats: 'State Farm', 'Allstate', 'Progressive', 'Geico', 'Blue Cross Blue Shield', 'UnitedHealthcare'. Preserve capitalization and abbreviations. Prefer the brand/company name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'State Farm Mutual Automobile Insurance Company' and 'State Farm'), prefer the shorter brand name if clear.\\n - Insurance company names may include designations like 'Insurance Company', 'Insurance Group', etc. - preserve as shown or extract the core brand name.\\n - If the company name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n - Search ALL pages and ALL sections - company name may appear in header, footer, contact info, or policy details sections.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'STATE FARM' in large header text -> extract 'STATE FARM' or 'State Farm'\\n \\u2713 Document shows 'Allstate Insurance Company' in header -> extract 'Allstate' or 'Allstate Insurance Company'\\n \\u2713 Document shows 'Blue Cross Blue Shield' -> extract 'Blue Cross Blue Shield'\\n\\nAVOID:\\n \\u2717 Do NOT extract policyholder names as the insurance company name\\n \\u2717 Do NOT extract agent names or agency names as the insurance company name\\n \\u2717 Do NOT extract policy numbers or other identifiers as the company name\"}, \"policy_type\": {\"type\": \"string\", \"datapoint_prompt\": \"The type of insurance policy (e.g., 'Auto', 'Home', 'Life', 'Health', 'Renters', 'Commercial').\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, headers, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Policy Type', 'Type', 'Coverage Type', 'Insurance Type', 'Product', 'Policy:', 'Coverage'\\n\\nLOCATION: Typically in the policy information section, often near the policy number.; May appear in the header area or in a dedicated policy details section.; May appear in summary boxes or policy declarations.; Look for policy type designations in ALL sections of the document.\\n\\nFORMAT: Return the policy type exactly as it appears on the document. Common values:\\n - 'Auto', 'Automobile', 'Vehicle'\\n - 'Home', 'Homeowners', 'Homeowner'\\n - 'Life', 'Life Insurance'\\n - 'Health', 'Health Insurance', 'Medical'\\n - 'Renters', 'Renters Insurance'\\n - 'Commercial', 'Business'\\n - 'Umbrella', 'General Liability'\\nPreserve the exact format and capitalization as shown.\\n\\nEDGE CASES:\\n - Policy types may be abbreviated or spelled out - preserve as shown.\\n - Some documents show policy types as part of policy numbers or descriptions - extract the type designation.\\n - Multiple policy types may be combined (e.g., 'Auto and Home') - extract as shown.\\n - Search ALL sections - policy type may appear in headers, policy declarations, coverage summaries, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Policy Type: Auto' -> extract 'Auto'\\n \\u2713 Text shows 'Coverage: Homeowners Insurance' -> extract 'Homeowners Insurance' or 'Homeowners'\\n \\u2713 Text shows 'Policy: Life' -> extract 'Life'\\n\\nAVOID:\\n \\u2717 Do NOT extract policy numbers or policy IDs as policy types\\n \\u2717 Do NOT extract coverage limits or amounts as policy types\"}, \"policy_number\": {\"type\": \"string\", \"datapoint_prompt\": \"The insurance policy number, quote number, or policy identifier.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, headers, body, footer, all pages. Extract this field if it appears ANYWHERE on the document. Policy/quote numbers are key identifiers and may appear multiple times.\\n\\nCOMMON LABELS: 'Policy Number', 'Policy No.', 'Policy #', 'Policy ID', 'Policy', 'Quote Number', 'Quote No.', 'Quote #', 'Policy Number:', 'Policy #:', 'Quote Number:'\\n\\nLOCATION: Typically in the policy information section, often near the policy type and policyholder information.; May appear in the header area or in a dedicated policy details section.; Usually prominently displayed as it's a key identifier.; Look for policy/quote numbers in the policy information area, headers, footers, and ALL sections of the document.; May appear on every page.\\n\\nFORMAT: Return the policy/quote number exactly as it appears on the document. Policy/quote numbers may be numeric, alphanumeric, or include dashes/spaces. Preserve any formatting, dashes, spaces, or special characters as shown. If the policy/quote number appears in multiple places, use the one in the main policy information section.\\n\\nEDGE CASES:\\n - Policy/quote numbers vary by insurance company - preserve the exact format.\\n - Policy/quote numbers may include dashes, spaces, or other separators (e.g., 'POL-123456', '123 456 789', '46023655-04') - preserve as shown.\\n - For quote documents, extract the quote number as the policy number.\\n - Policy/quote numbers may appear in multiple places - extract from the main policy information section if available, otherwise use the first clear instance found.\\n - Do not confuse with claim numbers, certificate numbers, or other identifiers.\\n - Search ALL pages and ALL sections - policy/quote numbers are often repeated for reference.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Policy Number: 123456789' -> extract '123456789'\\n \\u2713 Text shows 'Policy #: POL-123-456' -> extract 'POL-123-456'\\n \\u2713 Text shows 'Quote Number: 46023655-04' -> extract '46023655-04'\\n \\u2713 Text shows 'Policy: 123 456 789' -> extract '123 456 789'\\n\\nAVOID:\\n \\u2717 Do NOT extract claim numbers as policy numbers\\n \\u2717 Do NOT extract certificate numbers as policy numbers\\n \\u2717 Do NOT extract group numbers or member IDs as policy numbers\\n \\u2717 Do NOT extract account numbers as policy numbers\"}, \"policyholder_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the policyholder (the person or entity covered by the insurance policy).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, headers, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Policyholder', 'Insured', 'Named Insured', 'Policyholder Name', 'Insured Name', 'Name', 'Policyholder:', 'Insured:'\\n\\nLOCATION: Typically in the policyholder information section, often near the policy number.; May appear in the header area or in a dedicated policy details section.; Usually in the upper portion of the document.; Look for policyholder names in the policy information area, declarations page, and ALL sections of the document.\\n\\nFORMAT: Return the policyholder name exactly as it appears on the document. Common formats:\\n - Full name: 'John Doe'\\n - With middle name/initial: 'John Michael Doe' or 'John M. Doe'\\n - Last name first: 'Doe, John'\\n - Business/entity names: 'ABC Corporation', 'XYZ LLC'\\nPreserve capitalization, punctuation, and formatting (including middle names/initials, suffixes, entity designations, etc.).\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Some documents show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Names may be in all uppercase on insurance documents - preserve the capitalization.\\n - Business/entity names may include legal designations (LLC, Inc., Corp.) - preserve as shown.\\n - If name appears in multiple places, prefer the one in the main policyholder information section, but extract from ANY location if the main section doesn't have it.\\n - Search ALL pages - policyholder name may appear in headers, declarations, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Policyholder: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Insured: DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Named Insured: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n \\u2713 Text shows 'Policyholder: ABC Corporation, Inc.' -> extract 'ABC Corporation, Inc.'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract agent names or insurance company names as policyholder names\\n \\u2717 Do NOT extract beneficiary names as policyholder names\"}, \"policy_effective_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the insurance policy becomes effective (starts) in YYYY-MM-DD format.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, declarations, headers, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Effective Date', 'Policy Effective Date', 'Effective', 'Inception Date', 'Start Date', 'Policy Start Date', 'Effective Date:', 'Inception'\\n\\nLOCATION: Typically in the policy information section, often near the policy number and expiration date.; May appear in a policy details box or summary section.; May appear in declarations page or policy declarations section.; Look for effective date or inception date in the policy information area, declarations, and ALL sections of the document.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/01/2024' -> '2024-01-01')\\n - M/D/YYYY (e.g., '1/1/2024' -> '2024-01-01')\\n - MM-DD-YYYY (e.g., '01-01-2024' -> '2024-01-01')\\n - Month DD, YYYY (e.g., 'January 1, 2024' -> '2024-01-01')\\n - Mon DD, YYYY (e.g., 'Jan 1, 2024' -> '2024-01-01')\\nIf year is two digits, expand appropriately. If effective date is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Effective date should be before or equal to the expiration date.\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Search ALL pages - effective date may appear in declarations, policy summary, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Effective Date: 01/01/2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'Policy Effective: January 1, 2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'Inception: 1/1/24' -> extract '2024-01-01'\\n\\nAVOID:\\n \\u2717 Do NOT extract expiration dates as effective dates\\n \\u2717 Do NOT extract renewal dates or other dates as effective dates\"}, \"policy_expiration_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the insurance policy expires (ends) in YYYY-MM-DD format.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policy information sections, declarations, headers, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Expiration Date', 'Policy Expiration Date', 'Expires', 'Expiration', 'End Date', 'Policy End Date', 'Expiration Date:', 'Expires:'\\n\\nLOCATION: Typically in the policy information section, often near the policy number and effective date.; May appear in a policy details box or summary section.; May appear in declarations page or policy declarations section.; Look for expiration date or end date in the policy information area, declarations, and ALL sections of the document.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If expiration date is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Expiration date should be after or equal to the effective date.\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Search ALL pages - expiration date may appear in declarations, policy summary, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Expiration Date: 12/31/2024' -> extract '2024-12-31'\\n \\u2713 Text shows 'Expires: December 31, 2024' -> extract '2024-12-31'\\n \\u2713 Text shows 'Policy End Date: 12/31/24' -> extract '2024-12-31'\\n\\nAVOID:\\n \\u2717 Do NOT extract effective dates as expiration dates\\n \\u2717 Do NOT extract renewal dates or other dates as expiration dates\"}, \"premium_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The premium amount (cost of the insurance policy) for the coverage period.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - billing sections, policy summaries, declarations, payment information, all pages. Extract this field if it appears ANYWHERE on the document. Look for premium amounts in billing sections, policy declarations, summary boxes, and payment areas.\\n\\nCOMMON LABELS: 'Premium', 'Premium Amount', 'Total Premium', 'Annual Premium', 'Premium Due', 'Amount', 'Premium:', 'Total Premium:'\\n\\nLOCATION: Typically in a billing or premium section, often near payment information.; May appear in a policy summary or billing details section.; May appear in declarations page, policy declarations, or premium summary sections.; Look for premium amounts in billing or payment areas, policy summaries, and ALL sections of the document.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$1,200.00' -> 1200.00, '$500.00' -> 500.00). If premium amount is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Premium amounts may be annual, semi-annual, quarterly, or monthly - extract as shown (the amount, not the period).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n - If multiple premium amounts appear (e.g., annual and monthly), prefer the total/annual premium.\\n - Search ALL pages and ALL sections - premium may appear in billing section, declarations, payment info, or summary boxes.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Premium: $1,200.00' -> extract 1200.00\\n \\u2713 Text shows 'Annual Premium: $500.00' -> extract 500.00\\n \\u2713 Text shows 'Total Premium: $2,400.00' -> extract 2400.00\\n\\nAVOID:\\n \\u2717 Do NOT extract deductible amounts as premium amounts\\n \\u2717 Do NOT extract coverage limits as premium amounts\\n \\u2717 Do NOT extract claim amounts as premium amounts\"}, \"coverage_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The primary coverage amount or policy limit (maximum amount the policy will pay). Extract the PRIMARY or TOTAL coverage amount when multiple coverage types exist.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - coverage sections, policy declarations, coverage summaries, all pages. Extract this field if it appears ANYWHERE on the document. Look for coverage amounts in coverage sections, declarations, policy summaries, and coverage detail sections.\\n\\nEXTRACTION PRIORITY (when multiple coverage amounts exist):\\n1. If a single 'Total Coverage' or aggregate amount is shown, extract that value.\\n2. If multiple coverage types exist (e.g., Liability, Medical Payments, Uninsured Motorists for auto; Dwelling, Personal Property, Liability for homeowners), extract the PRIMARY coverage amount:\\n - For AUTO insurance: Extract the LIABILITY coverage amount (the main coverage limit, typically the largest)\\n - For HOMEOWNERS insurance: Extract the DWELLING coverage amount (Coverage A - the primary property coverage)\\n - For LIFE insurance: Extract the death benefit amount\\n3. If only one coverage amount is shown, extract that value.\\n4. If no clear primary/total coverage amount can be determined, return null.\\n\\nCOMMON LABELS: 'Coverage Amount', 'Policy Limit', 'Coverage Limit', 'Limit', 'Total Coverage', 'Coverage', 'Liability Limit', 'Death Benefit' (for life insurance), 'Coverage A' (for homeowners), 'Dwelling'\\n\\nLOCATION: Typically in a coverage or policy details section.; May appear in a policy summary or coverage summary section.; May appear in declarations page or policy declarations.; Look for coverage amounts or policy limits in the coverage information area, declarations, summaries, and ALL sections of the document.\\n\\nFORMAT: Return a numeric value with appropriate precision. Handle units appropriately (e.g., if shown as '$500K' or '500 thousand', convert to numeric: 500000.00).\\n\\nEDGE CASES:\\n - Coverage amounts may be shown in thousands, millions, or actual currency - convert appropriately.\\n - For auto insurance with multiple coverage types: Extract the Liability coverage amount (e.g., '$100,000 each accident')\\n - For homeowners insurance: Extract the Dwelling coverage amount (Coverage A, e.g., '$202,871')\\n - If multiple coverage amounts exist but no clear primary/total is shown, extract the largest or most prominent coverage amount.\\n - Search ALL pages - coverage amounts may appear in declarations, coverage summaries, or policy details sections.\\n\\nEXAMPLES:\\n \\u2713 Auto insurance shows 'A. Liability: $100,000 each accident' -> extract 100000.00 (Liability is primary)\\n \\u2713 Homeowners shows 'Coverage A: Dwelling: $202,871' -> extract 202871.00 (Dwelling is primary)\\n \\u2713 Text shows 'Total Coverage: $1,000,000' -> extract 1000000.00\\n \\u2713 Text shows 'Coverage Amount: $500,000' -> extract 500000.00\\n\\nAVOID:\\n \\u2717 Do NOT extract premium amounts as coverage amounts\\n \\u2717 Do NOT extract deductible amounts as coverage amounts\\n \\u2717 Do NOT extract claim amounts as coverage amounts\"}, \"deductible_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The primary deductible amount (amount the policyholder must pay before insurance coverage begins). Extract the PRIMARY deductible when multiple deductibles exist.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - coverage sections, policy declarations, coverage summaries, deductible information sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nEXTRACTION PRIORITY (when multiple deductibles exist):\\n1. If a single 'Deductible' or 'Annual Deductible' amount is shown, extract that value.\\n2. If multiple deductibles exist for different coverage types:\\n - For AUTO insurance: Extract the COLLISION or PRIMARY property damage deductible (typically the most common/main deductible, e.g., '$100' for Collision)\\n - For HOMEOWNERS insurance: Extract the 'All Other Perils' or primary deductible (e.g., '$2,500' for All Other Perils)\\n - If deductibles are the same across coverages, extract that common amount.\\n3. Prefer annual/per-occurrence deductibles over per-incident deductibles when both exist.\\n4. If no deductible is shown, return null.\\n\\nCOMMON LABELS: 'Deductible', 'Deductible Amount', 'Deductible:', 'Annual Deductible', 'Per Occurrence Deductible', 'All Other Perils' (for homeowners), 'Collision Deductible' (for auto)\\n\\nLOCATION: Typically in a coverage or policy details section.; May appear in a policy summary or coverage summary section.; May appear in declarations page or policy declarations.; Look for deductible amounts in the coverage information area, declarations, summaries, and ALL sections of the document.\\n\\nFORMAT: Return a numeric value with two decimal places, no currency symbol and no thousands separators. If deductible amount is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Deductibles may be per occurrence, per claim, or annual - extract the amount shown.\\n - For auto insurance with Collision and Other Than Collision deductibles (often the same, e.g., both $100), extract that common amount.\\n - For homeowners with 'All Other Perils' deductible, extract that value (e.g., '$2,500').\\n - If multiple deductibles exist with different values, extract the PRIMARY one (Collision for auto, All Other Perils for homeowners).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n - Search ALL pages - deductible may appear in declarations, coverage summaries, or policy details sections.\\n\\nEXAMPLES:\\n \\u2713 Auto insurance shows 'Collision Loss: ACV minus $100 Deductible' -> extract 100.00 (primary collision deductible)\\n \\u2713 Homeowners shows 'All Other Perils: $2,500' -> extract 2500.00 (primary deductible)\\n \\u2713 Text shows 'Annual Deductible: $1,000.00' -> extract 1000.00\\n \\u2713 Text shows 'Deductible: $500.00' -> extract 500.00\\n\\nAVOID:\\n \\u2717 Do NOT extract premium amounts as deductible amounts\\n \\u2717 Do NOT extract coverage amounts as deductible amounts\\n \\u2717 Do NOT extract out-of-pocket maximums as deductible amounts\"}, \"agent_name\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The name of the insurance agent or agent/broker who sold or manages the policy (if shown).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - agent information sections, headers, footers, contact sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Agent', 'Agent Name', 'Producer', 'Broker', 'Agent:', 'Producer Name', 'Representative'\\n\\nLOCATION: Typically in an agent information section, often near contact information.; May appear in the header, footer, or contact section.; May appear in policy declarations or agent information boxes.; Look for agent names in agent/contact information areas, headers, footers, and ALL sections of the document.\\n\\nFORMAT: Return the agent name exactly as it appears. May be a person's name or an agency name. Preserve capitalization and formatting. If agent name is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Agent names may be individual names or agency/brokerage names - extract as shown.\\n - Some documents show agent contact information without names - return null if name is not shown.\\n - Search ALL pages - agent name may appear in headers, footers, contact sections, or policy declarations.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Agent: John Smith' -> extract 'John Smith'\\n \\u2713 Text shows 'Producer: ABC Insurance Agency' -> extract 'ABC Insurance Agency'\\n \\u2713 Text shows no agent name -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract policyholder names as agent names\\n \\u2717 Do NOT extract insurance company names as agent names\"}, \"policyholder_address\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The address of the policyholder (if shown on the insurance document).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - policyholder information sections, policy declarations, contact sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Address', 'Mailing Address', 'Policyholder Address', 'Insured Address', 'Billing Address', 'Residence Address'\\n\\nLOCATION: Typically in the policyholder information section, often near the policyholder name.; May appear in a policy details or contact section.; May appear in declarations page or policy declarations.; Look for addresses in the policyholder information area, declarations, contact sections, and ALL sections of the document.\\n\\nFORMAT: Return the complete address as it appears on the document. Common formats: '123 Main St, City, State ZIP' or multi-line addresses. Preserve the format as shown, or join multi-line addresses with commas. If policyholder address is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Some documents show only city and state - extract as shown.\\n - Addresses may include country - include if shown.\\n - Search ALL pages - address may appear in declarations, policyholder info sections, or contact areas.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Address: 123 Main St, Anytown, CA 12345' -> extract '123 Main St, Anytown, CA 12345'\\n \\u2713 Text shows 'Mailing Address:\\\\n123 Main Street\\\\nAnytown, CA 12345' -> extract '123 Main Street, Anytown, CA 12345'\\n\\nAVOID:\\n \\u2717 Do NOT extract agent addresses as policyholder addresses\\n \\u2717 Do NOT extract insurance company addresses as policyholder addresses\"}, \"issue_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the insurance document was issued (for quotes, binders, or policy documents) in YYYY-MM-DD format.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - headers, policy information sections, declarations, body, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Issue Date', 'Date Issued', 'Issued Date', 'Date', 'Quote Date' (for quotes), 'Binder Date' (for binders), 'Issue Date:', 'Date Issued:'\\n\\nLOCATION: Typically in the header area or policy information section, often near the effective date or policy number.; May appear in a policy details box or summary section.; May appear in declarations page or document header.; Look for issue dates in headers, policy information areas, declarations, and ALL sections of the document.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '12/14/2020' -> '2020-12-14')\\n - M/D/YYYY (e.g., '12/14/2020' -> '2020-12-14')\\n - MM-DD-YYYY (e.g., '12-14-2020' -> '2020-12-14')\\n - Month DD, YYYY (e.g., 'December 14, 2020' -> '2020-12-14')\\n - Mon DD, YYYY (e.g., 'Dec 14, 2020' -> '2020-12-14')\\nIf year is two digits, expand appropriately. If issue date is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Issue date is typically the date the document was created/issued, which may be different from the effective date.\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n - Search ALL pages - issue date may appear in headers, declarations, policy summary, or other sections.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Issue Date: 12/14/2020' -> extract '2020-12-14'\\n \\u2713 Text shows 'Date Issued: December 14, 2020' -> extract '2020-12-14'\\n \\u2713 Text shows 'Quote Date: 12/14/20' -> extract '2020-12-14'\\n\\nAVOID:\\n \\u2717 Do NOT extract effective dates as issue dates\\n \\u2717 Do NOT extract expiration dates as issue dates\\n \\u2717 Do NOT extract renewal dates as issue dates\"}, \"sub_broker_name\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The name of the sub-broker or sub-agent (if shown on the insurance document). This is typically a secondary broker or agent involved in the policy transaction.\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - broker information sections, headers, footers, contact sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nCOMMON LABELS: 'Sub-Broker', 'Sub-Broker Name', 'Sub Broker', 'Sub-Agent', 'Sub Agent', 'Sub-Broker:', 'Sub Broker:'\\n\\nLOCATION: Typically in a broker or agent information section, often near the main broker/agent name.; May appear in the header, footer, or contact section.; May appear in policy declarations or broker information boxes.; Look for sub-broker names in broker/agent information areas, headers, footers, and ALL sections of the document.\\n\\nFORMAT: Return the sub-broker name exactly as it appears. May be a person's name or an agency name. Preserve capitalization and formatting. If sub-broker name is not shown ANYWHERE on the document, return null.\\n\\nEDGE CASES:\\n - Sub-broker names may be individual names or agency/brokerage names - extract as shown.\\n - Some documents show sub-broker contact information without names - return null if name is not shown.\\n - Search ALL pages - sub-broker name may appear in headers, footers, contact sections, or policy declarations.\\n - Not all documents will have a sub-broker - return null if not present.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Sub-Broker: American Ins. Brokers' -> extract 'American Ins. Brokers'\\n \\u2713 Text shows 'Sub Broker: ABC Insurance Agency' -> extract 'ABC Insurance Agency'\\n \\u2713 Text shows no sub-broker name -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract main broker/agent names as sub-broker names\\n \\u2717 Do NOT extract policyholder names as sub-broker names\\n \\u2717 Do NOT extract insurance company names as sub-broker names\"}, \"coverage_breakdown\": {\"type\": [\"array\", \"null\"], \"description\": \"Detailed breakdown of all coverage types and their amounts. Extract ALL coverage types shown on the document (e.g., Dwelling, Personal Property, Liability, Medical Payments, etc.).\", \"items\": {\"type\": \"object\", \"properties\": {\"coverage_type\": {\"type\": \"string\", \"description\": \"The type or name of the coverage (e.g., 'Dwelling', 'Personal Property', 'Personal Liability', 'Medical Payments to Others', 'Other Structures', 'Loss Of Use', 'Loss Assessment Coverage'). Extract the exact coverage type name as it appears on the document, including coverage letters if shown (e.g., 'Coverage A: Dwelling' -> 'Coverage A: Dwelling' or 'Dwelling').\"}, \"amount\": {\"type\": \"number\", \"description\": \"The coverage amount or limit for this coverage type. Return as a numeric value with no currency symbol and no thousands separators (e.g., '$202,871' -> 202871.0, '$3,700' -> 3700.0).\"}}, \"required\": [\"coverage_type\", \"amount\"]}, \"datapoint_prompt\": \"A detailed breakdown of ALL coverage types and their amounts shown on the insurance document. Extract EVERY coverage type listed in the coverage section (e.g., Coverage A: Dwelling, Coverage B: Other Structures, Coverage C: Personal Property, Coverage D: Loss Of Use, Coverage E: Personal Liability, Coverage F: Medical Payments to Others, Loss Assessment Coverage, etc.).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - coverage sections, policy declarations, coverage summaries, all pages. Extract ALL coverage types if they appear ANYWHERE on the document.\\n\\nCOMMON LABELS: Coverage sections are typically labeled as 'Coverage Part', 'Coverage', 'Coverages', 'Policy Coverage', 'Coverage Breakdown', or individual coverage types like 'Coverage A: Dwelling', 'Coverage B: Other Structures', etc.\\n\\nLOCATION: Typically in a coverage or policy details section.; May appear in a policy summary or coverage summary section.; May appear in declarations page or policy declarations.; Look for coverage breakdowns in the coverage information area, declarations, summaries, and ALL sections of the document.\\n\\nFORMAT: Extract each coverage type as an object with 'coverage_type' (the name/type) and 'amount' (the numeric coverage limit). Return the coverage type name exactly as shown (e.g., 'Coverage A: Dwelling', 'Personal Property', 'Personal Liability'). Amount should be numeric with no currency symbol (e.g., 202871.0 for '$202,871').\\n\\nEDGE CASES:\\n - Some coverage types may show $0 - include them in the breakdown.\\n - Coverage types may be labeled with letters (Coverage A, B, C, etc.) - preserve these in the coverage_type name.\\n - Extract ALL coverage types shown, not just the primary one.\\n - Coverage amounts may be shown in thousands or actual currency - convert appropriately.\\n - Search ALL pages - coverage breakdown may appear in declarations, coverage summaries, or policy details sections.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'Coverage A: Dwelling - $202,871' -> {\\\"coverage_type\\\": \\\"Coverage A: Dwelling\\\", \\\"amount\\\": 202871.0}\\n \\u2713 Document shows 'Coverage B: Other Structures - $3,700' -> {\\\"coverage_type\\\": \\\"Coverage B: Other Structures\\\", \\\"amount\\\": 3700.0}\\n \\u2713 Document shows 'Personal Liability - $100,000' -> {\\\"coverage_type\\\": \\\"Personal Liability\\\", \\\"amount\\\": 100000.0}\\n \\u2713 Document shows 'Medical Payments to Others - $2,000' -> {\\\"coverage_type\\\": \\\"Medical Payments to Others\\\", \\\"amount\\\": 2000.0}\\n\\nAVOID:\\n \\u2717 Do NOT extract only the primary coverage - extract ALL coverage types\\n \\u2717 Do NOT extract premium amounts as coverage amounts\\n \\u2717 Do NOT extract deductible amounts as coverage amounts\"}}, \"required\": [\"insurance_company_name\", \"policy_type\", \"policy_number\", \"policyholder_name\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"policy_effective_date\", \"end_field\": \"policy_expiration_date\", \"max_days\": 366, \"message\": \"Policy expiration date should be within 366 days (approximately 1 year) after effective date\"}, {\"type\": \"date_comparison\", \"field1\": \"policy_effective_date\", \"field2\": \"policy_expiration_date\", \"comparison\": \"before_or_equal\", \"message\": \"Policy effective date should be before or equal to expiration date\"}]}}", "true_json_output": "{\"insurance_company_name\": \"B.I.G. AUTO FINANCE COMPANY\", \"policy_type\": \"Auto\", \"policy_number\": \"80-42910\", \"policyholder_name\": \"Daniel Lawrence\", \"policy_effective_date\": \"1998-08-21\", \"policy_expiration_date\": \"1999-08-21\", \"premium_amount\": 647.0, \"coverage_amount\": 100000.0, \"deductible_amount\": 100.0, \"agent_name\": \"Rocky Rhodes\", \"policyholder_address\": \"4029 Tree St., Middletown, Massachusetts\", \"coverage_breakdown\": [{\"coverage_type\": \"A. Liability\", \"amount\": 100000.0}, {\"coverage_type\": \"B. Medical Payments\", \"amount\": 1000.0}, {\"coverage_type\": \"C. Uninsured Motorists\", \"amount\": 25000.0}, {\"coverage_type\": \"D. Damage to your Auto - 1. Collision Loss\", \"amount\": 0.0}, {\"coverage_type\": \"D. Damage to your Auto - 2. Other Than Collision Loss\", \"amount\": 0.0}, {\"coverage_type\": \"D. Damage to your Auto - Towing and Labor Costs\", \"amount\": 25.0}], \"source_filename\": \"insurance.pdf\"}", "true_markdown_output": "**Insurance Company Name:** B.I.G. AUTO FINANCE COMPANY\n**Policy Type:** Auto\n**Policy Number:** 80-42910\n**Policyholder Name:** Daniel Lawrence\n**Policy Effective Date:** 1998-08-21\n**Policy Expiration Date:** 1999-08-21\n**Premium Amount:** 647.0\n**Coverage Amount:** 100000.0\n**Deductible Amount:** 100.0\n**Agent Name:** Rocky Rhodes\n**Policyholder Address:** 4029 Tree St., Middletown, Massachusetts\n**Coverage Breakdown:**\n **Coverage Type:** A. Liability\n **Amount:** 100000.0\n **Coverage Type:** B. Medical Payments\n **Amount:** 1000.0\n **Coverage Type:** C. Uninsured Motorists\n **Amount:** 25000.0\n **Coverage Type:** D. Damage to your Auto - 1. Collision Loss\n **Amount:** 0.0\n **Coverage Type:** D. Damage to your Auto - 2. Other Than Collision Loss\n **Amount:** 0.0\n **Coverage Type:** D. Damage to your Auto - Towing and Labor Costs\n **Amount:** 25.0"} {"file_name": "images/invoice.png", "id": 7, "metadata": "{\"format\": \"INVOICE\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"invoice.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"vendor_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The SHORT brand name of the utility company as it appears prominently on the invoice header (e.g., 'FPL', 'Duke Energy', 'ENTERGY', 'CPS Energy'). Extract the abbreviated or marketing name, NOT the full legal entity name like 'Florida Power & Light Company, LLC' or 'Entergy Louisiana, LLC'.\"}, \"account_number\": {\"type\": \"string\", \"datapoint_prompt\": \"Customer account number\\n\\nCOMMON LABELS: 'Customer Number:', 'Customer Number', 'CUSTOMER NUMBER', 'Customer No:', 'Customer #'\\n\\nLOCATION: Upper-right header area near 'Billing Date' (top 10\\u201325% of the page, rightmost ~30%). Look immediately right of the 'Customer Number:' label.; Detachable payment stub - lower-right region above or near the 'Balance Due' on the payment stub (lower ~30% of the page, rightmost ~30%) where text 'CUSTOMER NUMBER' appears in bold.; Do NOT select numbers from the bottom MICR/machine readable line below the 'DO NOT WRITE BELOW THIS LINE' separator (center-bottom of page).; Do NOT select numbers from barcodes or the long OCR line under the tear-off area (long continuous digit blocks).\\n\\nFORMAT: Prefer the value exactly as shown adjacent to the 'Customer Number' label. Accept these common formats: - 3-4-3 form (e.g. 300-5686-237) - 1-4-4-4 form (e.g. 0-2101-4382-2541). If hyphens are missing in OCR, normalize: if raw digits length == 10 -> format as XXX-XXXX-XXX (3-4-3). If raw digits length == 13 -> format as X-XXXX-XXXX-XXXX (1-4-4-4). If digits length does not match 10 or 13, return the exact digits only if adjacent to the 'Customer Number' label; otherwise return empty. Always preserve hyphens if present in the labeled field on the document.\\n\\nEDGE CASES: \\n - Two identical labels appear (top-right header and detachable stub). If both exist and match, return that value. If they differ, prioritize the detachable stub value labeled 'CUSTOMER NUMBER' in the lower-right payment stub.\\n - OCR may remove or merge hyphens (e.g. '3005686237') \\u2014 apply normalization rules above only when the numeric block is adjacent to a 'Customer Number' label.\\n - Do NOT extract long continuous numeric blocks from the MICR / payment-line (they often contain routing/transaction codes and are not the customer number).\\n - Some bills may show the account number in multiple places (account summary or service address) \\u2014 only extract the one next to the explicit 'Customer Number' label.\\n\\nEXAMPLES: \\n \\u2713 If the text 'Customer Number: 300-5686-237' appears in the top-right -> extract '300-5686-237'.\\n \\u2713 If the payment stub shows 'CUSTOMER NUMBER 300-5589-637' -> extract '300-5589-637'.\\n \\u2713 If OCR returns '3005686237' directly next to label 'Customer Number:' -> normalize to '300-5686-237' (10 digits -> 3-4-3).\\n \\u2713 If label shows 'Customer Number: 0-2101-4382-2541' -> extract '0-2101-4382-2541'.\\n\\nAVOID: \\n \\u2717 Do NOT extract '500009833012' (a long machine-readable number in the MICR line) when it's not adjacent to a 'Customer Number' label.\\n \\u2717 Do NOT extract '1 3005686237 5 0000000000000 ...' (full MICR/payment-line) \\u2014 these are not the labeled customer number.\\n \\u2717 Do NOT extract address numbers, PO Box numbers, RUM, or any other numeric IDs unless they are directly labeled 'Customer Number' or 'Customer No'.\"}, \"invoice_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date the invoice was issued in YYYY-MM-DD format. May be labeled as 'Invoice Date', 'Bill Date', 'Statement Date', or simply 'Date'. Look for the LATEST date associated with when the bill was generated, typically at the top of the invoice near the company name.\\n\\nCOMMON LABELS: 'Billing Date', 'Billing Date:', 'Invoice Date', 'Invoice Date:', 'Bill Date', 'Statement Date', 'Statement of Account', 'Date'\\n\\nLOCATION: Top-right area of the first page, near 'Customer Number' and 'Balance Due'.; Header area directly to the right of the company logo (upper-right corner).; Within the first ~20% of page height and rightmost ~30% of page width.; Avoid dates inside the billing summary body (lines labelled 'On or Before', 'After', 'Previous Bill') and avoid dates in footer or barcode lines.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats: MM/DD/YY, M/D/YY, MM/DD/YYYY, M/D/YYYY, 'Mon DD, YYYY' (e.g., Nov 04, 2025), 'DD Mon YYYY'. If the year is two digits (e.g., 25), assume 20YY (e.g., '10/17/25' -> 2025-10-17). If only month and year present (e.g., 'Oct 2025'), do NOT return that as invoice_date unless no explicit day is found \\u2014 prefer an explicitly day-containing 'Billing Date'. If multiple candidate dates remain with equal priority, choose the one explicitly labelled 'Billing Date' (or 'Invoice Date' / 'Statement Date').\\n\\nEDGE CASES: \\n - Multiple dates on page: 'Billing Date' vs 'Previous Bill' vs 'On or Before Nov 04, 2025 Pay' \\u2014 do NOT choose 'On or Before' or 'After' payment dates.\\n - Two-digit years (10/17/25) \\u2014 must be expanded to 2025.\\n - Month name formats (Nov 04, 2025) \\u2014 convert to ISO.\\n - OCR errors that insert extra punctuation or characters (e.g., '10/17/25,' or '10/17/2S') \\u2014 strip non-digit noise around date tokens before parsing.\\n - If the label 'Billing Date' is missing, prefer 'Invoice Date' or 'Statement Date' in the header/top-right; if none found, fall back to the latest explicitly-labelled date within the top third of the first page, but still ignore 'On or Before'/'After' lines.\\n - If only found dates are part of example lines like 'Previous Bill 09/18/2025' or payment scheduling lines, do NOT extract them unless explicitly asked.\\n\\nEXAMPLES: \\n \\u2713 Document shows 'Billing Date: 10/17/25' in the top-right -> extract '2025-10-17'.\\n \\u2713 Document shows 'Invoice Date: Nov 4, 2025' in header -> extract '2025-11-04'.\\n \\u2713 Document shows 'Statement Date 09/18/2025' near company header -> extract '2025-09-18'.\\n\\nAVOID: \\n \\u2717 Do NOT extract 'On or Before Nov 04, 2025 Pay' or 'After Nov 04, 2025 Pay' (these are payment due windows, not invoice issue date).\\n \\u2717 Do NOT extract 'Previous Bill 09/18/2025' (this is prior-period date).\\n \\u2717 Do NOT extract month-only labels like 'Oct 2025' unless no day-containing billing/invoice/statement date exists in the header.\"}, \"due_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"Payment due date in YYYY-MM-DD format.\\n\\nLOCATION STRATEGY:\\n- Primary labels: \\\"Due Date\\\", \\\"Payment Due Date\\\", \\\"Please Pay By\\\", \\\"Pay By\\\", \\\"Payment Due\\\"\\n- Usually appears: Top right corner OR in payment summary box\\n- Often paired with: Amount Due field\\n- Visual style: May be in bold, colored text, or highlighted box\\n\\nOCR YEAR VALIDATION (CRITICAL):\\n- Due date should be: 15-30 days AFTER invoice_date\\n- Cross-field check: invoice_date + 15-45 days = due_date\\n- Common OCR errors:\\n * 2025 misread as 2006 (5\\u21926 confusion)\\n * 2025 misread as 2026 (5\\u21926 confusion)\\n * 2025 misread as 2075 (2\\u21927 confusion)\\n- If year seems wrong (>60 days from invoice date or in past): RE-EXAMINE the original image\\n * Look for partial obscurity, poor print quality, or similar digit shapes\\n * Validate against other dates on invoice (all should be similar year)\\n\\nFORMAT CONVERSION:\\n- Input formats seen: MM/DD/YYYY, MM-DD-YYYY, \\\"November 7, 2025\\\", \\\"Nov 7, 2025\\\"\\n- Output format: YYYY-MM-DD (ISO 8601)\\n- Examples:\\n * \\\"11/07/2025\\\" \\u2192 \\\"2025-11-07\\\"\\n * \\\"November 7, 2025\\\" \\u2192 \\\"2025-11-07\\\"\\n\\nVALIDATION:\\n- Must be AFTER invoice_date\\n- Must be within 60 days of invoice_date (utility payment windows)\\n- Should not be in the past (if invoice is current)\\n- Should not be more than 2 months in future\\n\\nCOMMON LABELS: 'On or Before', 'On or Before
, Pay', 'After
, Pay', 'On or Before
, Pay', 'Balance Due', 'Balance Due On or Before', 'Balance Due On or Before ', 'Payment Due Date', 'Pay By', 'Please Pay By', 'On or Before Nov 04, 2025 Pay', 'On or Before Nov 04, 2025', 'After Nov 04, 2025 Pay'\\n\\nLOCATION: Right-hand side of the first page, inside or immediately adjacent to the 'Balance Due' / 'BILLING SUMMARY' area (upper right quadrant).; Inside the boxed 'Balance Due' area just beneath the 'Balance Due' header or on the same line as 'On or Before' / 'After' phrases.; Lower-right detachable payment stub (bottom-right area) under 'Balance Due' / 'On or Before' \\u2014 choose the stub only if it matches the header area or if the header area is missing.; Avoid top-right corner 'Billing Date' field (this is the invoice_date, not the due_date).; Prefer the date token that is nearest to the phrase 'On or Before' or nearest to 'Balance Due' and its amount.\\n\\nFORMAT: Output must be ISO 8601 YYYY-MM-DD. Accept and normalize the following input formats: 'Nov 04, 2025', 'November 4, 2025', '11/04/2025', '11/4/25', '11-04-2025', '11/04/25'. If the year is given as two digits (e.g. '25'), expand to 20YY (->2025). Remove trailing words like 'Pay' or surrounding text before parsing. Accept single-digit days and pad with zero to two digits. Accept month names (full and 3-letter abbrev) and numeric months. Examples: 'On or Before Nov 04, 2025 Pay' -> '2025-11-04'; '11/4/25' -> '2025-11-04'.\\n\\nEDGE CASES: \\n - Multiple dates on page: explicitly prefer the date adjacent to 'On or Before' or the date appearing in the Balance Due box. If both 'On or Before' and 'After' lines exist, take the 'On or Before' date as the due_date.\\n - Body text may contain similar phrasing (e.g. 'will be withdrawn from your bank on or after Nov 04, 2025') \\u2014 ignore dates in long paragraphs unless they are inside the Balance Due area or directly adjacent to balance amount.\\n - Two-digit year '25' should be expanded to 2025; treat any two-digit year < 50 as 20XX.\\n - OCR noise: trailing 'Pay' or attached currency values (e.g. 'Nov 04, 2025 Pay $17.41') \\u2014 strip non-date tokens and parse only the date substring.\\n - Month vs numeric formats: allow both 'Nov' and '11', and support single-digit days without leading zero.\\n - If the candidate due_date is earlier than invoice_date or > 90 days after invoice_date, mark for human review; if within 5\\u201390 days accept (adjustable window). Do not rigidly reject valid due dates because prompt previously enforced too narrow 15\\u201330 day window.\\n - If multiple identical date values appear, select the one in the Balance Due area; if they differ, prefer the one labeled 'On or Before' next to Balance Due.\\n\\nEXAMPLES: \\n \\u2713 Text: 'Balance Due\\\\nOn or Before Nov 04, 2025 Pay\\\\n$17.41' -> Extract: '2025-11-04'\\n \\u2713 Text: 'Balance Due\\\\nOn or Before Nov 04, 2025 Pay\\\\nAfter Nov 04, 2025 Pay' -> Extract the 'On or Before' date: '2025-11-04'\\n \\u2713 Text (stub): 'Balance Due On or Before Nov 04, 2025 Pay $17.41' -> Extract: '2025-11-04'\\n \\u2713 Text: 'On or Before 11/04/2025 Pay' -> Extract: '2025-11-04'\\n \\u2713 Text: 'On or Before Nov 4, 2025' -> Extract: '2025-11-04'\\n\\nAVOID: \\n \\u2717 Text: 'Billing Date: 10/17/25' -> DO NOT extract as due_date (this is invoice_date).\\n \\u2717 Text: 'Previous Bill 09/18/2025' -> DO NOT extract as due_date.\\n \\u2717 Body sentence: 'will be withdrawn from your bank on or after Nov 04, 2025' (paragraph) -> DO NOT extract unless this exact text is inside the Balance Due box or immediately adjacent to the balance amount.\\n \\u2717 Text: 'On or Before' appearing far from balance amount or inside unrelated blocks (e.g., company footer) -> DO NOT extract without proximity to Balance Due.\"}, \"service_address\": {\"type\": \"string\", \"datapoint_prompt\": \"ONLY the street address and unit number where utility service is provided. DO NOT include city, state, or zip code.\\n\\nLOCATION STRATEGY:\\n- Primary: Labeled \\\"Service Address\\\", \\\"Service Location\\\", \\\"Premise Address\\\", \\\"Service For\\\", \\\"Location\\\"\\n- Secondary: Address block near top of invoice (often in a box)\\n- Usually appears: Upper left or upper right of first page\\n- Often has: Vertical layout with street address on one line, city/state/zip on separate line below\\n\\nEXTRACTION FORMAT:\\n- Include: Street number, street name, unit/apt number\\n- Example: '300 N MAIN AVE #1302' or '16441 S Harrells Ferry Rd Apt 6502'\\n- Stop at city name (do NOT include city, state, or zip)\\n\\nOCR VALIDATION (CRITICAL for apartment numbers):\\n- Carefully distinguish similar digits: 0 vs 8 vs 6 vs 9\\n- Cross-validate against multiple instances if address appears more than once on invoice\\n- Example: APT 836 \\u2260 APT 036 \\u2260 APT 896 (these are different units!)\\n- If uncertain about a digit, examine the original image closely for the numeral shape:\\n * 0 = circular/oval\\n * 6 = has top loop + tail descending\\n * 8 = two stacked loops\\n * 9 = top loop + descending tail\\n- Address should match exactly across all instances on the invoice (header, stub, service info box)\\n\\nVALIDATION:\\n- Should NOT contain: City name, state abbreviation, zip code, country\\n- Should be: A single line of text with street info only\\n- Bad examples: '300 N MAIN AVE #1302, San Antonio, TX 78205' (too much), '300 Main' (too little - missing unit)\\n- Good examples: '300 N MAIN AVE #1302', '1224 SEAGATE DR APT 208'\\n\\nCOMMON LABELS: 'Statement of Account', 'Service Address', 'Service Location', 'Premise Address', 'Service For', 'Location', 'Account Holder', 'Statement'\\n\\nLOCATION: Top-left of first page, directly under the 'Statement of Account' header or account/customer name block.; Within the first ~200\\u2013300 px from the top (first 15\\u201320% of page) and left third of page.; Inside the address block that sits above the 'YOUR ELECTRICITY USE' graph (visual region in examples).; Do NOT select addresses from the bottom/mid-footer area (remittance address, PO BOX) or the boxed 'Pay Online' / contact blocks on right.\\n\\nFORMAT: Return a single line containing only the street number, street name, and unit designator (if present). Stop at the end of the street/unit line; do NOT include the city, state, zip, country, or company/DBA name. Preferred output style: UPPERCASE with unit shown as '#1234' or 'APT 1234' if present (examples: '300 N MAIN AVE #1302', '780 FASHION DR APT 3213'). If the street line is split across two OCR lines, join them but still do not include the following city/state/zip line. Validation rules (apply in order):\\n- Must begin with a street number (regex: ^\\\\d{1,6}\\\\b).\\n- Must contain a street name and a street suffix (match common suffixes: AVE, AV, STREET, ST, RD, DR, BLVD, LN, CT, PL, CIR, TER, PKWY, WAY, TRL, HWY, ROUTE, BLVD, SQ, etc.).\\n- Acceptable unit markers: '#', 'APT', 'UNIT', 'STE' followed by digits/letters (e.g. '#1302', 'APT 3213', 'STE 201').\\n- Do NOT return lines containing 'PO BOX', 'P.O. BOX', 'POBOX', 'PO BOX', or that are clearly mailing/remit addresses.\\n- Exclude lines containing business entity words (DBA, LLC, INC, CO, CORP) unless a separate street line follows them; in that case select the following street line not the entity name.\\n- Discard lines that are long numeric MICR/payment lines or contain many groups of digits separated by spaces (bottom payment string).\\n\\nEDGE CASES: \\n - Company/DBA lines that include a street-like token (e.g., 'WUB1 LLC DBA 300 MAIN AVE LLC'). Rule: if a line contains 'DBA' or 'LLC' or 'INC' or 'PO BOX', treat it as organization and check the next line for the actual street address.\\n - Unit appears on second line together with city/state (e.g., OCR split places '#1302' on the same line as city): prefer the token that is adjacent to the street number and keep only the street+unit tokens, dropping city/state/zip even if they share a line with the unit.\\n - OCR line splits (street name broken over 2 lines): if the first of the split lines begins with a number and the next line looks like a continuation (starts with a word or abbreviation, not a city/state pattern), join them and then trim after unit or before comma/city token.\\n - Multiple addresses present: choose the address located nearest to the 'Statement of Account' header or the account holder name block. If multiple candidate street lines are in that header block, prefer the one that contains a unit marker (#, APT) or that is directly below the account-holder/company name line.\\n - MICR/footer numeric strings and long barcodes: always ignore bottom-most lines that consist primarily of long numeric sequences, special characters, or postal barcode patterns.\\n - Different unit notations: accept '#' (hash), 'APT', 'APARTMENT', 'UNIT', 'STE', 'SUITE' (case-insensitive).\\n\\nEXAMPLES: \\n \\u2713 Input region (top-left header): lines: 'WUB1 LLC DBA 300 MAIN AVE LLC', '300 N MAIN AVE #1302', 'SAN ANTONIO TX 78205' -> Extract: '300 N MAIN AVE #1302'\\n \\u2713 Input region: 'AND I CANNOT LYE LP', '500 N SANTA ROSA AVE #1032', 'SAN ANTONIO TX 78207' -> Extract: '500 N SANTA ROSA AVE #1032'\\n \\u2713 Input region: 'WUB1 LLC DBA 300 MAIN AVE LLC', '300 N MAIN AVE #1401', 'SAN ANTONIO TX 78205' -> Extract: '300 N MAIN AVE #1401'\\n \\u2713 Street line without '#': '780 FASHION DR APT 3213', 'CITY STATE ZIP' -> Extract: '780 FASHION DR APT 3213'\\n \\u2713 If street line is split: '16441 S Harrells Ferry Rd', 'Apt 6502', 'Other city info' -> Join and extract: '16441 S Harrells Ferry Rd Apt 6502'\\n\\nAVOID: \\n \\u2717 Footer remittance block: 'CPS ENERGY', 'PO BOX 2678', 'SAN ANTONIO TX 78289-0001' -> DO NOT extract 'PO BOX 2678' or 'SAN ANTONIO TX 78289-0001'.\\n \\u2717 Organization line containing street tokens: 'WUB1 LLC DBA 300 MAIN AVE LLC' -> DO NOT extract whole 'WUB1 LLC DBA 300 MAIN AVE LLC'; instead check next line for the actual street+unit.\\n \\u2717 MICR/payment line near bottom: '1 300556878 2 000000000...' -> DO NOT extract (not a service street address).\\n \\u2717 Boxed contact blocks on right with addresses or phone numbers -> DO NOT extract these.\\n \\u2717 Any output including city/state/zip, e.g. '300 N MAIN AVE #1302, SAN ANTONIO, TX 78205' -> BAD; strip city/state/zip and return only street+unit.\"}, \"amount_due\": {\"type\": \"number\", \"datapoint_prompt\": \"Total amount due for this billing period\\n\\nCOMMON LABELS: 'Balance Due', 'Balance Due On or Before', 'On or Before', 'After Pay', 'Billing Summary', 'Total Account Balance', 'Total Current Energy Charge', 'Total Amount Enclosed', 'Balance'\\n\\nLOCATION: Top-right quadrant of the first page, near 'Billing Date' and 'Customer Number'; Inside or immediately to the right of the 'Balance Due' block/header (above the 'BILLING SUMMARY' column); Prefer the main billing summary area in the upper half of the page \\u2014 do NOT use the bottom payment stub or 'Total Amount Enclosed' box unless the main 'Balance Due' amount is missing/illegible; If there are duplicate amounts in the billing summary column, pick the amount that is on the same line as 'On or Before Pay' or the first currency value listed under 'Balance Due'\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$17.41' -> 17.41, '$87.20' -> 87.20). If OCR produces '17.4' normalize to two decimals '17.40'. If the extracted value is missing or illegible, return null.\\n\\nEDGE CASES: \\n - If the 'Balance Due' block contains two amounts labeled 'On or Before' and 'After', always choose the 'On or Before' amount (the first listed amount).\\n - If the 'Balance Due' heading includes an AutoPay note (e.g., 'CPS Energy AutoPay Account'), choose the first currency amount shown in that block (this is the amount that will be withdrawn).\\n - If 'On or Before' is not present but 'Total Account Balance' exists in the Billing Summary, use the 'Total Account Balance' amount as a fallback.\\n - Do NOT extract component charges (e.g., 'Current Electricity Charge', 'City Services', 'State & Local Sales Taxes') \\u2014 those are line items, not the total amount due.\\n - Ignore amounts in the tear-off/payment stub at the bottom ('Total Amount Enclosed') unless the main billing summary amount cannot be found or is unreadable.\\n - Ignore negative adjustment lines like 'Payments/Adjustments Thank You -$108.24' \\u2014 those are adjustments, not the balance due.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n\\nEXAMPLES: \\n \\u2713 'Balance Due\\\\nOn or Before Nov 04, 2025 Pay $17.41\\\\nAfter Nov 04, 2025 Pay $17.63' -> 17.41\\n \\u2713 'Balance Due\\\\nCPS Energy AutoPay Account $87.20\\\\nAfter Nov 04, 2025 Pay $88.31' -> 87.20\\n \\u2713 'BILLING SUMMARY\\\\n...\\\\nTotal Account Balance $11.12' (no On or Before present) -> 11.12\\n\\nAVOID: \\n \\u2717 Do NOT extract the 'After Nov 04, 2025 Pay $17.63' amount when 'On or Before $17.41' is present -> do NOT return 17.63\\n \\u2717 Do NOT extract component lines like 'Total Current Energy Charge $13.26' or 'City Services $3.83' -> do NOT return 13.26 or 3.83\\n \\u2717 Do NOT extract the tear-off 'Total Amount Enclosed' field at the bottom when the main billing summary 'Balance Due' is present -> do NOT return the tear-off value\\n \\u2717 Do NOT extract negative adjustment amounts (e.g., '-$108.24') as the 'amount_due' -> do NOT return -108.24\"}, \"current_charges\": {\"type\": \"number\", \"datapoint_prompt\": \"Total current charges INCLUDING all taxes and fees (e.g., Gross Receipts Tax, Regulatory Fees). This is the full amount of charges for THIS billing period, before any previous balance is added.\\n\\nLOCATION STRATEGY:\\n- Primary label: \\\"Current Charges\\\", \\\"Total Current Charges\\\", \\\"Current Amount\\\", \\\"Charges This Period\\\"\\n- Secondary: In summary box/table, often boldface or larger font\\n- Tertiary: Sum of all line items (calculate if not explicitly labeled)\\n- Usually appears: Top right summary area OR bottom of charges section\\n\\nVISUAL IDENTIFICATION:\\n- Typically the LARGEST dollar amount in the current charges section\\n- Often appears in: Bold text, larger font, or highlighted box\\n- May have visual separator (line above/below) to distinguish from line items\\n- Positioned: After all line items but before payment info\\n\\nDECIMAL POINT VALIDATION (CRITICAL):\\n- Utility bills typically: $20-$500 for residential accounts\\n- If amount seems too small: Check if decimal point was misread\\n * Example: Extracted $8.27 but see $827.60 nearby \\u2192 likely wrong decimal\\n * Example: Extracted $4.33 but see $433.18 nearby \\u2192 check both\\n- Cross-validate: Current charges should \\u2248 Amount Due (\\u00b110%) unless previous balance exists\\n- Visual check: Is the font size appropriate for the largest charge?\\n\\nSPECIAL CASES:\\n- NEGATIVE amounts: Valid for credits/refunds (e.g., solar overage, billing adjustments)\\n * Example: -$16.08 for solar credit is CORRECT\\n- Zero amounts: Rare but valid for fully credited accounts\\n- High amounts: Commercial accounts may be >$500, validate against line items sum\\n\\nVALIDATION CHECKLIST:\\n1. Does the amount match a labeled \\\"Current Charges\\\" field? (preferred)\\n2. Does it approximately equal the sum of all line items? (should match within $0.50)\\n3. Is it within 10% of Amount Due? (unless previous balance present)\\n4. Is the magnitude reasonable for a utility bill?\\n5. Does the decimal point placement make sense?\\n\\nIf multiple values seem correct, choose the one explicitly labeled \\\"Current Charges\\\" or \\\"Total Current Charges\\\".\\n\\nCOMMON LABELS: 'Total Account Balance', 'Balance Due', 'Balance Due On or Before', 'Balance Due (On or Before ... Pay)', 'Total Current Charges', 'Total Current Energy Charge', 'Current Charges', 'Charges This Period'\\n\\nLOCATION: Right side of the first page in the 'BILLING SUMMARY' area (center-right); Top-right near the Billing Date / 'Balance Due' header (prefer the 'On or Before' value); Right-aligned, directly to the right of the label text, usually bold; NOT the MICR line or the lower detachable 'Total Amount Enclosed' box (bottom-right); If you see two 'Balance Due' values (On or Before vs After), choose the 'On or Before' (earlier due) amount\\n\\nFORMAT: Return the numeric value only (no currency symbol). Normalize to two decimal places (e.g., 87.20). Preserve a leading negative sign for credits (e.g., -16.08). Always select the single final total for THIS billing period (not previous balance nor payment-amount-after-late-date). If you cannot find an explicit 'Total Account Balance' or 'Balance Due On or Before' label, compute the current charges by summing the relevant current period lines: include 'Total Current Energy Charge' (or 'Current Electricity Charge') + 'City Services' + 'State & Local Sales Taxes' + any other current-period fees shown in the billing summary. Do NOT include 'Previous Bill', 'Payments/Adjustments', 'Balance' (if it's a leftover or zero), 'Final Balance Transfer', or deposits. Allow +/-$0.50 tolerance when summing components but prefer an explicitly labeled total when present.\\n\\nEDGE CASES: \\n - Document has both a detailed billing summary and a detached payment stub: prefer the amount in the main 'BILLING SUMMARY' or the top-right 'Balance Due (On or Before ... Pay)'. Do not return the amount shown in the detachable 'Total Amount Enclosed' box or MICR numbers.\\n - If both 'On or Before' and 'After' amounts are present, always return the 'On or Before' amount (the earlier-due balance).\\n - If only energy subtotal lines are present (e.g., 'Current Electricity Charge' and 'Total Current Energy Charge') and there are visible taxes/fees, sum them to get the total; if taxes/fees are absent assume 'Total Current Energy Charge' is the total (but still check for a labeled 'Total Account Balance').\\n - Negative totals are valid (credits) \\u2014 preserve the sign.\\n - Commercial bills may be > $500 \\u2014 do not reject high amounts if labeled properly.\\n - OCR can misplace decimal points (e.g., '8720' vs '87.20'); use visual grouping and label alignment to find correct decimal placement and cross-validate against other lines.\\n\\nEXAMPLES: \\n \\u2713 Billing Summary -> 'Total Account Balance $17.41' => extract 17.41\\n \\u2713 Top-right header -> 'Balance Due On or Before Nov 04, 2025 Pay $87.20' => extract 87.20\\n \\u2713 Billing Summary lines: 'Total Current Energy Charge $13.26', 'City Services $3.83', 'State & Local Sales Taxes $0.32' => sum and extract 17.41 (if no explicit 'Total Account Balance' label present)\\n\\nAVOID: \\n \\u2717 Do NOT extract 'Current Electricity Charge $13.26' when the final total is $17.41 (this is an energy-only subtotal)\\n \\u2717 Do NOT extract the '$17.63' or '$88.31' (the 'After' late pay amount) when 'On or Before' is available\\n \\u2717 Do NOT extract numeric strings from the MICR/encoding line at bottom (e.g., '000000001763') or the 'Total Amount Enclosed' field in the payment stub\\n \\u2717 Do NOT use 'Payments/Adjustments Thank You -$108.24' lines as the current charges\", \"validation\": {\"type\": \"range\", \"min\": 20, \"max\": 500, \"message\": \"Utility bills typically between $20-$500 - check decimal point placement\"}}, \"total_tax_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total tax amount (sales tax, state tax, local tax, etc.) if shown separately on the invoice. This is the sum of all tax line items (e.g., 'State & Local Sales Taxes').\\n\\nCOMMON LABELS: 'State & Local Sales Taxes', 'State and Local Sales Taxes', 'Sales Tax', 'Tax', 'Total Tax', 'Taxes', 'Tax Amount'\\n\\nLOCATION: Typically in the billing summary section or line items section.; May appear as a separate line item in the line_items array (e.g., 'State & Local Sales Taxes'); May appear in a summary area near current_charges.; Look for tax amounts in the billing summary or line items.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$0.32' -> 0.32, '$5.00' -> 5.00). If tax amount is not shown separately (taxes are included in line items but not summarized), calculate by summing tax line items from the line_items array. If no tax amount is present on the invoice, return null.\\n\\nEDGE CASES:\\n - Tax amount may be shown as a separate line item (e.g., 'State & Local Sales Taxes: $0.32') - extract that amount.\\n - If taxes are included in line items but not summarized separately, sum all tax-related line items to calculate total_tax_amount.\\n - Some invoices may have $0.00 tax - return 0.00 (not null) if explicitly shown.\\n - If taxes are included in the charges but not itemized, return null.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'State & Local Sales Taxes: $0.32' -> extract 0.32\\n \\u2713 Line items include 'State & Local Sales Taxes' with amount 5.00 -> extract 5.00\\n \\u2713 Text shows no separate tax amount and no tax line items -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract non-tax fees (e.g., 'Regulatory Fees', 'Service Charges') as tax amounts\\n \\u2717 Do NOT extract the total current_charges as tax amount\"}, \"balance_forward\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Previous UNPAID balance carried forward from prior billing period. CRITICAL: This is ONLY the unpaid balance from the previous bill, NOT 'Payment Received' or 'Previous Balance Paid'. If the invoice shows 'Payment Received' or the account was paid in full, balance_forward should be 0 or null. Look for labels like 'Balance Forward', 'Previous Balance', 'Unpaid Balance', or calculate as (Amount Due - Current Charges). If Amount Due equals Current Charges, return null.\\n\\nCOMMON LABELS: 'Balance', 'Balance Forward', 'Previous Bill', 'Previous Balance', 'Final Balance Transfer', 'Payments/Adjustments', 'Payment(s)/Adjustments', 'Payments / Adjustments', 'Payments/Adjustments Thank You', 'BILLING SUMMARY', 'Balance Due', 'Total Account Balance'\\n\\nLOCATION: Top-right quadrant of the page inside the boxed area titled 'BILLING SUMMARY' (heading often centered or right of the box).; Look in the right-side column of the Billing Summary box where monetary values are right-aligned in a single vertical column.; The target 'Balance' or 'Balance Forward' numeric is the right-aligned currency on the same horizontal band as the label 'Balance' or 'Balance Forward' under the 'BILLING SUMMARY' heading.; If calculating from components, use the right-aligned numeric for 'Previous Bill' (or 'Final Balance Transfer') and 'Payments/Adjustments' that are inside the same Billing Summary box and aligned in the same numeric column.; Ignore numeric amounts in the detachable payment stub at the bottom, and ignore 'Balance Due' or 'Total Account Balance' amounts shown above or outside the Billing Summary box.\\n\\nFORMAT: Return a numeric float with two decimal places (e.g. 0.00 -> 0.0 or 15.25 -> 15.25). Strip currency symbols ($) and commas. Recognize negatives marked with a leading '-' or parentheses and convert to negative numeric. Numbers may appear with extra OCR noise (e.g. 'O' for '0') \\u2014 apply simple digit normalization before parsing. Use the right-most number on the same horizontal line as the label inside the Billing Summary box. If a 'Balance' line exists inside the Billing Summary box, return that value directly. Otherwise, compute balance_forward = Previous Bill amount + Payments/Adjustments amount (remember Payments/Adjustments is usually negative). If the computed result is <= 0, return 0.0. Return null only if the Billing Summary box is missing or both Previous Bill and Payments/Adjustments and Balance lines are all missing or illegible.\\n\\nEDGE CASES: \\n - Labels sometimes include trailing dates: e.g., 'Previous Bill 09/18/2025 $108.24'. Ignore the date text and parse the numeric amount.\\n - Payments/Adjustments line may include words like 'Thank You' before the number (e.g., 'Payments/Adjustments Thank You -$108.24') \\u2014 extract the numeric and treat as negative.\\n - Variant labels for prior balance: 'Final Balance Transfer', 'Final Balance', or 'Previous Balance' should be treated equivalently to 'Previous Bill'.\\n - Negative adjustments may be shown as '-$108.24' or '($108.24)'. Treat both as -108.24.\\n - If Previous Bill exists but Payments/Adjustments is missing and there is no explicit 'Balance' line, prefer null rather than assuming unpaid balance.\\n - If 'Balance' line is present but shows $0.00, return 0.0 (do not return null).\\n - Do NOT extract amounts from the detachable stub (bottom) - e.g., 'Total Amount Enclosed' or the OCR track line amounts.\\n - If multiple 'Balance' labels exist on page, prefer the numeric located directly under the 'BILLING SUMMARY' heading and right-aligned in the same column as 'Previous Bill' and 'Payments/Adjustments'.\\n\\nEXAMPLES: \\n \\u2713 Billing Summary -> Balance $0.00 => 0.0\\n \\u2713 Billing Summary: Previous Bill 09/18/2025 $108.24 Payments/Adjustments Thank You -$108.24 Balance $0.00 => 0.0\\n \\u2713 Billing Summary: Final Balance Transfer $32.48 Payments/Adjustments -$32.48 Balance $0.00 => 0.0\\n \\u2713 Billing Summary missing 'Balance' but Previous Bill $50.00 and Payments/Adjustments ($-20.00) => compute 30.0 (and return 30.0)\\n\\nAVOID: \\n \\u2717 Extracting the top-right 'Balance Due $17.41' (outside Billing Summary box) as balance_forward \\u2014 INCORRECT.\\n \\u2717 Taking 'Total Account Balance $17.41' (current total) as previous unpaid balance \\u2014 INCORRECT.\\n \\u2717 Using 'Previous Bill' alone as balance_forward when Payments/Adjustments is present but not parsed \\u2014 INCORRECT.\\n \\u2717 Picking numeric from the detachable payment stub (Total Amount Enclosed) as balance_forward \\u2014 INCORRECT.\"}, \"line_items\": {\"type\": \"array\", \"datapoint_prompt\": \"ALL individual charges and taxes on the bill. CRITICAL: Extract EVERY line item from ALL sections of the invoice - do not skip any items.\\n\\nCOMPLETENESS REQUIREMENT:\\n- You MUST extract ALL line items visible on the document\\n- Count items first, then extract each one completely\\n- If you only extracted 2-3 items, you are MISSING items - search more thoroughly\\n- Sum the amounts and verify they match the total charges\\n\\nMULTI-LOCATION SEARCH STRATEGY (CRITICAL - Check ALL 3 locations):\\n\\n1. PRIMARY SECTION - Detailed Charges Table:\\n Common labels: \\\"Detailed Charges\\\", \\\"Current Charges\\\", \\\"Charges This Period\\\", \\\"Electric Charges\\\", \\\"Gas Charges\\\", \\\"Current Service\\\"\\n Look for: Multi-row tables with charge names in left column, amounts in right column\\n Usually contains: Service/Customer charges, Energy charges, Fuel adjustments, Regulatory fees, Environmental fees\\n\\n2. SECONDARY SECTION - Summary Area (top right or bottom of page):\\n Common labels: \\\"Summary of Charges\\\", \\\"Bill Summary\\\", \\\"Total Charges\\\"\\n Look for: Indented list or box with charges + totals\\n Usually contains: Same charges as detailed section, but condensed\\n IMPORTANT: May be THE ONLY location on some invoices (DominionEnergy, some Georgia Power)\\n\\n3. TERTIARY SECTION - Tax Lines (often separate):\\n Common labels: \\\"Taxes and Fees\\\", \\\"Other Charges\\\", near the bottom\\n Look for: Sales tax, Franchise fees, Municipal taxes, Gross receipts tax\\n Usually contains: Tax-specific charges not in main tables\\n\\nVISUAL LAYOUT HINTS:\\n- Line items appear as VERTICAL LISTS (not single lines)\\n- Each item has: Description (left/top) + Dollar amount (right/bottom)\\n- May span multiple pages\\n- Tables may have borders OR be borderless with aligned columns\\n- Dollar amounts always have $ symbol or align to decimal points\\n\\nEXTRACTION COMPLETENESS CHECK:\\n- Count the line items you extracted\\n- Sum their amounts\\n- Compare sum to 'Current Charges' or 'Total Current Charges' field\\n- If sum is significantly different (>$5), you MISSED line items - search other locations\\n\\nCOMMON VARIATIONS:\\n- DominionEnergy: Line items in summary box only (top right), not in detailed section\\n- FPL/Duke: Line items in detailed table + separate tax section\\n- CPS/Entergy: Line items in main table with taxes inline\\n- Georgia Power: May show as indented list under \\\"Current Service\\\"\\n\\nEXCLUSIONS (NOT line items):\\n- Payment Received, Previous Balance, Amount Due, Balance Forward (these are account-level totals, not line items)\\n- Year-to-date usage totals\\n- Meter reading information\\n- Service period dates\\n\\nINCLUSIONS (DO include as line items):\\n- 'Total' or 'Subtotal' lines that appear in the charges/line items breakdown section (these are part of the breakdown)\\n\\nIf you cannot find line items in the first location, KEEP SEARCHING the other sections. Some invoices intentionally show charges in summary boxes instead of detailed tables.\\n\\nCOMMON LABELS: 'BILLING SUMMARY', 'Summary of Charges', 'Bill Summary', 'Current Charges', 'Current Electricity Charge', 'Total Current Energy Charge', 'Service Availability Charge', 'City Services', 'State & Local Sales Taxes', 'State and Local Sales Taxes', 'Taxes and Fees', 'Environmental Fee', 'Environmental Fee-Solid Waste', 'Environmental Fee-Parks', 'Fuel Adjustment', 'Regulatory Adj', 'Regulatory Adjustment', 'Energy Charge'\\n\\nLOCATION: Primary: Inside the 'BILLING SUMMARY' box in the top-right quadrant of page 1 \\u2013 approximate horizontal range 60%\\u201395% of page width; vertical range 5%\\u201345% of page height. Look directly under the 'BILLING SUMMARY' heading and under 'Current Electricity Charge'/'Total Current Energy Charge'.; Primary ordering anchor: within that 'BILLING SUMMARY' box, read items in their visual order (top \\u2192 bottom). If multiple boxes exist, prefer the one titled 'BILLING SUMMARY' or 'Summary of Charges'.; Secondary: If detailed charges exist as a multi-row table (often left/middle of the page), read that table top\\u2192bottom, left\\u2192right (description column then amount column).; Tertiary: Taxes-only lines often appear near the bottom of the page or bottom-right labeled 'Taxes and Fees', 'State & Local Sales Taxes', or 'Other Charges' \\u2014 include these but preserve page order.; If multiple pages, repeat same search on each page and append items in page order (page1 top\\u2192bottom, then page2 top\\u2192bottom).\\n\\nFORMAT: Return an array of {description, amount} in the exact visual order they appear on the invoice (top-to-bottom; tie-breaker: left-to-right). Rules:\\n1) Description: verbatim text span from the invoice (trim whitespace). Preserve any usage fragments (e.g., '51 kWh', 'x $0.07503') and multi-line descriptions by concatenating lines in visual order with a single space. Do NOT normalize ampersands, abbreviations, or wording.\\n2) Amount: numeric float only, strip $ and commas, convert parentheses to negative, round to two decimals (e.g., 3.83).\\n3) Pairing: pair description to the monetized value within the same horizontal band (y-center difference <= 4% of page height). If multiple amounts line up, choose the amount right-aligned within the same bounding box; use bounding-box left edge proximity as tie-breaker.\\n4) Include totals in breakdown: INCLUDE 'Total' or 'Subtotal' line items when they appear in the charges/line items breakdown section. This provides a complete breakdown showing both individual items AND the total. However, EXCLUDE account-level totals like 'Amount Due', 'Balance Forward', 'Previous Balance', 'Payment Received', 'Total Account Balance' (these are account-level fields, not line items). For utility bills: Exclude intermediate category totals like 'Total Current Energy Charge' or 'Current Electricity Charge' when detailed per-kWh lines exist (to avoid duplication), but include the final 'Total' that sums all charges when it appears in the line items section.\\n5) Deduplicate: if an item appears both in the detailed charges table and in the billing summary box (identical description and amount), keep a single entry \\u2014 prefer the entry inside the 'BILLING SUMMARY' box; otherwise prefer the more granular description (the one containing 'kWh' or 'x $').\\n6) Ordering: always output in visual reading order relative to the chosen section (billing summary box or detailed table). If extracting from the billing summary box, do NOT reorder to put taxes last \\u2014 preserve whatever order the bill printed.\\n7) If only a summary total is present (no detailed per-kWh lines or fees), include that summary total verbatim (label preserved).\\n\\nEDGE CASES: \\n - Totals + details both present: e.g., 'Energy Charge' lines with kWh + 'Total Current Energy Charge' also present. Action: keep the detailed kWh lines and exclude the intermediate 'Total Current Energy Charge' category total (to avoid duplication). Only include the 'Total Current Energy Charge' when no detailed energy lines exist anywhere on the document.\\n - Final 'Total' in breakdown: When a 'Total' line appears at the end of the line items/charges breakdown section (summing all charges), INCLUDE it as the last item in the array. This provides complete breakdown information.\\n - Duplicate labels across sections: if the same description+amount occurs in both the detailed table and the billing-summary box, drop duplicates and keep the one inside 'BILLING SUMMARY' (or the one in the summary box if both are inside different summary boxes).\\n - Multi-line descriptions: If the description wraps across OCR lines (e.g., 'Energy Charge' on one line and '51 kWh x $0.07503' on the next), join preserving order and spacing: 'Energy Charge 51 kWh x $0.07503'.\\n - Amounts in parentheses indicate negative; convert '($13.46)' to -13.46.\\n - Thousands separators and $: strip commas and $ before converting to float.\\n - Small rounding/adjustment lines (e.g., 'Regulatory Adj') may be slightly misaligned \\u2013 use horizontal banding and bounding-box proximity rather than absolute X coordinate.\\n - If 'Current Electricity Charge' appears but detailed energy lines exist, treat 'Current Electricity Charge' as a total and exclude it (unless it is the only energy representation).\\n - If document shows both 'City Services' and separate 'Environmental Fee-*' lines, include both verbatim if present; do not merge or normalize them.\\n\\nEXAMPLES: \\n \\u2713 {description: 'Energy Charge 51 kWh x $0.07503', amount: 3.83} -- preserved kWh & rate, amount numeric\\n \\u2713 {description: 'Fuel Adjustment 51 kWh x $0.02782', amount: 1.42}\\n \\u2713 {description: 'Regulatory Adj 51 kWh x $0.01426', amount: 0.73}\\n \\u2713 {description: 'Environmental Fee-Solid Waste', amount: 2.30}\\n \\u2713 {description: 'Environmental Fee-Parks', amount: 1.53}\\n \\u2713 {description: 'Total', amount: 500.0} -- include final total from breakdown section\\n \\u2713 Correct ordering for first document's billing-summary box (top\\u2192bottom): ['Current Electricity Charge' (if no details), 'City Services', 'State & Local Sales Taxes'] \\u2014 but if detailed energy lines exist, list them in the order they appear and exclude the summary 'Total Current Energy Charge'.\\n\\nAVOID: \\n \\u2717 Including both 'Total Current Energy Charge' AND the detailed 'Energy Charge 51 kWh x $0.07503' lines in the returned array (duplicate intermediate category total + details).\\n \\u2717 Returning 'Current Electricity Charge' or 'Total Current Energy Charge' when detailed per-kWh energy lines are present. (Should exclude the intermediate category total and keep detailed lines.)\\n \\u2717 Excluding the final 'Total' line when it appears in the charges/line items breakdown section (this should be included as part of the complete breakdown).\\n \\u2717 Outputting the same set of line items but sorted incorrectly (e.g., taxes first when they are printed last in the box). The returned array must be in visual top-to-bottom order.\\n \\u2717 Mismatching a description to a different amount because vertical-first scanning was used; use horizontal banding and box proximity to pair.\", \"items\": {\"type\": \"object\", \"properties\": {\"datapoint_prompt\": {\"type\": \"string\", \"datapoint_prompt\": \"EXACT charge description as it appears on the bill, INCLUDING any usage details on the same or following line. CRITICAL: If the charge has usage details (e.g., 'Energy Charge' followed by '418.000 kWh @ 12.219c' on the next line), include ALL of it separated by a newline character. Preserve exact formatting - do NOT add parentheses, do NOT expand abbreviations (keep 'Adj' as 'Adj'), do NOT change special characters (keep '&' as '&', not 'and'), do NOT add spaces around hyphens. Copy the text character-for-character. Examples: 'Energy Charge\\\\n418.000 kWh @ 12.219c', 'Energy Charge 51 kWh x $0.07503', 'State & Local Sales Taxes' (NOT 'State and Local Sales Taxes'), 'Environmental Fee-Solid Waste' (NOT 'Environmental Fee - Solid Waste')\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Dollar amount for this line item\"}}, \"required\": [\"description\", \"amount\"]}}}, \"required\": [\"vendor_name\", \"account_number\", \"invoice_date\", \"due_date\", \"amount_due\"], \"validation\": {\"cross_field\": [{\"type\": \"approximate_match\", \"fields\": [\"amount_due\", \"current_charges\"], \"tolerance\": 0.1, \"message\": \"Amount due should match current charges (\\u00b110%) unless there's a significant previous balance\"}, {\"type\": \"date_range\", \"start_field\": \"invoice_date\", \"end_field\": \"due_date\", \"max_days\": 60, \"message\": \"Due date should be within 60 days of invoice date\"}]}}", "true_json_output": "{\"vendor_name\": \"Miceal Garden service\", \"account_number\": null, \"invoice_date\": \"2025-10-15\", \"due_date\": \"2025-10-15\", \"service_address\": \"123 ANYWHERE ST\", \"amount_due\": \"0.00\", \"current_charges\": 500.0, \"total_tax_amount\": null, \"balance_forward\": null, \"line_items\": [{\"datapoint_prompt\": \"brand consultation\", \"amount\": 100.0}, {\"datapoint_prompt\": \"logo design\", \"amount\": 100.0}, {\"datapoint_prompt\": \"website design\", \"amount\": 100.0}, {\"datapoint_prompt\": \"social media templates\", \"amount\": 100.0}, {\"datapoint_prompt\": \"brand manual\", \"amount\": 100.0}, {\"datapoint_prompt\": \"Total\", \"amount\": 500.0}], \"source_filename\": \"invoice.pdf\"}", "true_markdown_output": "**Vendor Name:** Miceal Garden service\n**Account Number:** N/A\n**Invoice Date:** 2025-10-15\n**Due Date:** 2025-10-15\n**Service Address:** 123 ANYWHERE ST\n**Amount Due:** 0.00\n**Current Charges:** 500.0\n**Total Tax Amount:** N/A\n**Balance Forward:** N/A\n**Line Items:**\n **Datapoint Prompt:** brand consultation\n **Amount:** 100.0\n **Datapoint Prompt:** logo design\n **Amount:** 100.0\n **Datapoint Prompt:** website design\n **Amount:** 100.0\n **Datapoint Prompt:** social media templates\n **Amount:** 100.0\n **Datapoint Prompt:** brand manual\n **Amount:** 100.0\n **Datapoint Prompt:** Total\n **Amount:** 500.0"} {"file_name": "images/invoice_2.png", "id": 8, "metadata": "{\"format\": \"INVOICE\", \"documentQuality\": \"PHOTO\", \"source_filename\": \"invoice_2.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"vendor_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The SHORT brand name of the utility company as it appears prominently on the invoice header (e.g., 'FPL', 'Duke Energy', 'ENTERGY', 'CPS Energy'). Extract the abbreviated or marketing name, NOT the full legal entity name like 'Florida Power & Light Company, LLC' or 'Entergy Louisiana, LLC'.\"}, \"account_number\": {\"type\": \"string\", \"datapoint_prompt\": \"Customer account number\\n\\nCOMMON LABELS: 'Customer Number:', 'Customer Number', 'CUSTOMER NUMBER', 'Customer No:', 'Customer #'\\n\\nLOCATION: Upper-right header area near 'Billing Date' (top 10\\u201325% of the page, rightmost ~30%). Look immediately right of the 'Customer Number:' label.; Detachable payment stub - lower-right region above or near the 'Balance Due' on the payment stub (lower ~30% of the page, rightmost ~30%) where text 'CUSTOMER NUMBER' appears in bold.; Do NOT select numbers from the bottom MICR/machine readable line below the 'DO NOT WRITE BELOW THIS LINE' separator (center-bottom of page).; Do NOT select numbers from barcodes or the long OCR line under the tear-off area (long continuous digit blocks).\\n\\nFORMAT: Prefer the value exactly as shown adjacent to the 'Customer Number' label. Accept these common formats: - 3-4-3 form (e.g. 300-5686-237) - 1-4-4-4 form (e.g. 0-2101-4382-2541). If hyphens are missing in OCR, normalize: if raw digits length == 10 -> format as XXX-XXXX-XXX (3-4-3). If raw digits length == 13 -> format as X-XXXX-XXXX-XXXX (1-4-4-4). If digits length does not match 10 or 13, return the exact digits only if adjacent to the 'Customer Number' label; otherwise return empty. Always preserve hyphens if present in the labeled field on the document.\\n\\nEDGE CASES: \\n - Two identical labels appear (top-right header and detachable stub). If both exist and match, return that value. If they differ, prioritize the detachable stub value labeled 'CUSTOMER NUMBER' in the lower-right payment stub.\\n - OCR may remove or merge hyphens (e.g. '3005686237') \\u2014 apply normalization rules above only when the numeric block is adjacent to a 'Customer Number' label.\\n - Do NOT extract long continuous numeric blocks from the MICR / payment-line (they often contain routing/transaction codes and are not the customer number).\\n - Some bills may show the account number in multiple places (account summary or service address) \\u2014 only extract the one next to the explicit 'Customer Number' label.\\n\\nEXAMPLES: \\n \\u2713 If the text 'Customer Number: 300-5686-237' appears in the top-right -> extract '300-5686-237'.\\n \\u2713 If the payment stub shows 'CUSTOMER NUMBER 300-5589-637' -> extract '300-5589-637'.\\n \\u2713 If OCR returns '3005686237' directly next to label 'Customer Number:' -> normalize to '300-5686-237' (10 digits -> 3-4-3).\\n \\u2713 If label shows 'Customer Number: 0-2101-4382-2541' -> extract '0-2101-4382-2541'.\\n\\nAVOID: \\n \\u2717 Do NOT extract '500009833012' (a long machine-readable number in the MICR line) when it's not adjacent to a 'Customer Number' label.\\n \\u2717 Do NOT extract '1 3005686237 5 0000000000000 ...' (full MICR/payment-line) \\u2014 these are not the labeled customer number.\\n \\u2717 Do NOT extract address numbers, PO Box numbers, RUM, or any other numeric IDs unless they are directly labeled 'Customer Number' or 'Customer No'.\"}, \"invoice_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date the invoice was issued in YYYY-MM-DD format. May be labeled as 'Invoice Date', 'Bill Date', 'Statement Date', or simply 'Date'. Look for the LATEST date associated with when the bill was generated, typically at the top of the invoice near the company name.\\n\\nCOMMON LABELS: 'Billing Date', 'Billing Date:', 'Invoice Date', 'Invoice Date:', 'Bill Date', 'Statement Date', 'Statement of Account', 'Date'\\n\\nLOCATION: Top-right area of the first page, near 'Customer Number' and 'Balance Due'.; Header area directly to the right of the company logo (upper-right corner).; Within the first ~20% of page height and rightmost ~30% of page width.; Avoid dates inside the billing summary body (lines labelled 'On or Before', 'After', 'Previous Bill') and avoid dates in footer or barcode lines.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats: MM/DD/YY, M/D/YY, MM/DD/YYYY, M/D/YYYY, 'Mon DD, YYYY' (e.g., Nov 04, 2025), 'DD Mon YYYY'. If the year is two digits (e.g., 25), assume 20YY (e.g., '10/17/25' -> 2025-10-17). If only month and year present (e.g., 'Oct 2025'), do NOT return that as invoice_date unless no explicit day is found \\u2014 prefer an explicitly day-containing 'Billing Date'. If multiple candidate dates remain with equal priority, choose the one explicitly labelled 'Billing Date' (or 'Invoice Date' / 'Statement Date').\\n\\nEDGE CASES: \\n - Multiple dates on page: 'Billing Date' vs 'Previous Bill' vs 'On or Before Nov 04, 2025 Pay' \\u2014 do NOT choose 'On or Before' or 'After' payment dates.\\n - Two-digit years (10/17/25) \\u2014 must be expanded to 2025.\\n - Month name formats (Nov 04, 2025) \\u2014 convert to ISO.\\n - OCR errors that insert extra punctuation or characters (e.g., '10/17/25,' or '10/17/2S') \\u2014 strip non-digit noise around date tokens before parsing.\\n - If the label 'Billing Date' is missing, prefer 'Invoice Date' or 'Statement Date' in the header/top-right; if none found, fall back to the latest explicitly-labelled date within the top third of the first page, but still ignore 'On or Before'/'After' lines.\\n - If only found dates are part of example lines like 'Previous Bill 09/18/2025' or payment scheduling lines, do NOT extract them unless explicitly asked.\\n\\nEXAMPLES: \\n \\u2713 Document shows 'Billing Date: 10/17/25' in the top-right -> extract '2025-10-17'.\\n \\u2713 Document shows 'Invoice Date: Nov 4, 2025' in header -> extract '2025-11-04'.\\n \\u2713 Document shows 'Statement Date 09/18/2025' near company header -> extract '2025-09-18'.\\n\\nAVOID: \\n \\u2717 Do NOT extract 'On or Before Nov 04, 2025 Pay' or 'After Nov 04, 2025 Pay' (these are payment due windows, not invoice issue date).\\n \\u2717 Do NOT extract 'Previous Bill 09/18/2025' (this is prior-period date).\\n \\u2717 Do NOT extract month-only labels like 'Oct 2025' unless no day-containing billing/invoice/statement date exists in the header.\"}, \"due_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"Payment due date in YYYY-MM-DD format.\\n\\nLOCATION STRATEGY:\\n- Primary labels: \\\"Due Date\\\", \\\"Payment Due Date\\\", \\\"Please Pay By\\\", \\\"Pay By\\\", \\\"Payment Due\\\"\\n- Usually appears: Top right corner OR in payment summary box\\n- Often paired with: Amount Due field\\n- Visual style: May be in bold, colored text, or highlighted box\\n\\nOCR YEAR VALIDATION (CRITICAL):\\n- Due date should be: 15-30 days AFTER invoice_date\\n- Cross-field check: invoice_date + 15-45 days = due_date\\n- Common OCR errors:\\n * 2025 misread as 2006 (5\\u21926 confusion)\\n * 2025 misread as 2026 (5\\u21926 confusion)\\n * 2025 misread as 2075 (2\\u21927 confusion)\\n- If year seems wrong (>60 days from invoice date or in past): RE-EXAMINE the original image\\n * Look for partial obscurity, poor print quality, or similar digit shapes\\n * Validate against other dates on invoice (all should be similar year)\\n\\nFORMAT CONVERSION:\\n- Input formats seen: MM/DD/YYYY, MM-DD-YYYY, \\\"November 7, 2025\\\", \\\"Nov 7, 2025\\\"\\n- Output format: YYYY-MM-DD (ISO 8601)\\n- Examples:\\n * \\\"11/07/2025\\\" \\u2192 \\\"2025-11-07\\\"\\n * \\\"November 7, 2025\\\" \\u2192 \\\"2025-11-07\\\"\\n\\nVALIDATION:\\n- Must be AFTER invoice_date\\n- Must be within 60 days of invoice_date (utility payment windows)\\n- Should not be in the past (if invoice is current)\\n- Should not be more than 2 months in future\\n\\nCOMMON LABELS: 'On or Before', 'On or Before
, Pay', 'After
, Pay', 'On or Before
, Pay', 'Balance Due', 'Balance Due On or Before', 'Balance Due On or Before ', 'Payment Due Date', 'Pay By', 'Please Pay By', 'On or Before Nov 04, 2025 Pay', 'On or Before Nov 04, 2025', 'After Nov 04, 2025 Pay'\\n\\nLOCATION: Right-hand side of the first page, inside or immediately adjacent to the 'Balance Due' / 'BILLING SUMMARY' area (upper right quadrant).; Inside the boxed 'Balance Due' area just beneath the 'Balance Due' header or on the same line as 'On or Before' / 'After' phrases.; Lower-right detachable payment stub (bottom-right area) under 'Balance Due' / 'On or Before' \\u2014 choose the stub only if it matches the header area or if the header area is missing.; Avoid top-right corner 'Billing Date' field (this is the invoice_date, not the due_date).; Prefer the date token that is nearest to the phrase 'On or Before' or nearest to 'Balance Due' and its amount.\\n\\nFORMAT: Output must be ISO 8601 YYYY-MM-DD. Accept and normalize the following input formats: 'Nov 04, 2025', 'November 4, 2025', '11/04/2025', '11/4/25', '11-04-2025', '11/04/25'. If the year is given as two digits (e.g. '25'), expand to 20YY (->2025). Remove trailing words like 'Pay' or surrounding text before parsing. Accept single-digit days and pad with zero to two digits. Accept month names (full and 3-letter abbrev) and numeric months. Examples: 'On or Before Nov 04, 2025 Pay' -> '2025-11-04'; '11/4/25' -> '2025-11-04'.\\n\\nEDGE CASES: \\n - Multiple dates on page: explicitly prefer the date adjacent to 'On or Before' or the date appearing in the Balance Due box. If both 'On or Before' and 'After' lines exist, take the 'On or Before' date as the due_date.\\n - Body text may contain similar phrasing (e.g. 'will be withdrawn from your bank on or after Nov 04, 2025') \\u2014 ignore dates in long paragraphs unless they are inside the Balance Due area or directly adjacent to balance amount.\\n - Two-digit year '25' should be expanded to 2025; treat any two-digit year < 50 as 20XX.\\n - OCR noise: trailing 'Pay' or attached currency values (e.g. 'Nov 04, 2025 Pay $17.41') \\u2014 strip non-date tokens and parse only the date substring.\\n - Month vs numeric formats: allow both 'Nov' and '11', and support single-digit days without leading zero.\\n - If the candidate due_date is earlier than invoice_date or > 90 days after invoice_date, mark for human review; if within 5\\u201390 days accept (adjustable window). Do not rigidly reject valid due dates because prompt previously enforced too narrow 15\\u201330 day window.\\n - If multiple identical date values appear, select the one in the Balance Due area; if they differ, prefer the one labeled 'On or Before' next to Balance Due.\\n\\nEXAMPLES: \\n \\u2713 Text: 'Balance Due\\\\nOn or Before Nov 04, 2025 Pay\\\\n$17.41' -> Extract: '2025-11-04'\\n \\u2713 Text: 'Balance Due\\\\nOn or Before Nov 04, 2025 Pay\\\\nAfter Nov 04, 2025 Pay' -> Extract the 'On or Before' date: '2025-11-04'\\n \\u2713 Text (stub): 'Balance Due On or Before Nov 04, 2025 Pay $17.41' -> Extract: '2025-11-04'\\n \\u2713 Text: 'On or Before 11/04/2025 Pay' -> Extract: '2025-11-04'\\n \\u2713 Text: 'On or Before Nov 4, 2025' -> Extract: '2025-11-04'\\n\\nAVOID: \\n \\u2717 Text: 'Billing Date: 10/17/25' -> DO NOT extract as due_date (this is invoice_date).\\n \\u2717 Text: 'Previous Bill 09/18/2025' -> DO NOT extract as due_date.\\n \\u2717 Body sentence: 'will be withdrawn from your bank on or after Nov 04, 2025' (paragraph) -> DO NOT extract unless this exact text is inside the Balance Due box or immediately adjacent to the balance amount.\\n \\u2717 Text: 'On or Before' appearing far from balance amount or inside unrelated blocks (e.g., company footer) -> DO NOT extract without proximity to Balance Due.\"}, \"service_address\": {\"type\": \"string\", \"datapoint_prompt\": \"ONLY the street address and unit number where utility service is provided. DO NOT include city, state, or zip code.\\n\\nLOCATION STRATEGY:\\n- Primary: Labeled \\\"Service Address\\\", \\\"Service Location\\\", \\\"Premise Address\\\", \\\"Service For\\\", \\\"Location\\\"\\n- Secondary: Address block near top of invoice (often in a box)\\n- Usually appears: Upper left or upper right of first page\\n- Often has: Vertical layout with street address on one line, city/state/zip on separate line below\\n\\nEXTRACTION FORMAT:\\n- Include: Street number, street name, unit/apt number\\n- Example: '300 N MAIN AVE #1302' or '16441 S Harrells Ferry Rd Apt 6502'\\n- Stop at city name (do NOT include city, state, or zip)\\n\\nOCR VALIDATION (CRITICAL for apartment numbers):\\n- Carefully distinguish similar digits: 0 vs 8 vs 6 vs 9\\n- Cross-validate against multiple instances if address appears more than once on invoice\\n- Example: APT 836 \\u2260 APT 036 \\u2260 APT 896 (these are different units!)\\n- If uncertain about a digit, examine the original image closely for the numeral shape:\\n * 0 = circular/oval\\n * 6 = has top loop + tail descending\\n * 8 = two stacked loops\\n * 9 = top loop + descending tail\\n- Address should match exactly across all instances on the invoice (header, stub, service info box)\\n\\nVALIDATION:\\n- Should NOT contain: City name, state abbreviation, zip code, country\\n- Should be: A single line of text with street info only\\n- Bad examples: '300 N MAIN AVE #1302, San Antonio, TX 78205' (too much), '300 Main' (too little - missing unit)\\n- Good examples: '300 N MAIN AVE #1302', '1224 SEAGATE DR APT 208'\\n\\nCOMMON LABELS: 'Statement of Account', 'Service Address', 'Service Location', 'Premise Address', 'Service For', 'Location', 'Account Holder', 'Statement'\\n\\nLOCATION: Top-left of first page, directly under the 'Statement of Account' header or account/customer name block.; Within the first ~200\\u2013300 px from the top (first 15\\u201320% of page) and left third of page.; Inside the address block that sits above the 'YOUR ELECTRICITY USE' graph (visual region in examples).; Do NOT select addresses from the bottom/mid-footer area (remittance address, PO BOX) or the boxed 'Pay Online' / contact blocks on right.\\n\\nFORMAT: Return a single line containing only the street number, street name, and unit designator (if present). Stop at the end of the street/unit line; do NOT include the city, state, zip, country, or company/DBA name. Preferred output style: UPPERCASE with unit shown as '#1234' or 'APT 1234' if present (examples: '300 N MAIN AVE #1302', '780 FASHION DR APT 3213'). If the street line is split across two OCR lines, join them but still do not include the following city/state/zip line. Validation rules (apply in order):\\n- Must begin with a street number (regex: ^\\\\d{1,6}\\\\b).\\n- Must contain a street name and a street suffix (match common suffixes: AVE, AV, STREET, ST, RD, DR, BLVD, LN, CT, PL, CIR, TER, PKWY, WAY, TRL, HWY, ROUTE, BLVD, SQ, etc.).\\n- Acceptable unit markers: '#', 'APT', 'UNIT', 'STE' followed by digits/letters (e.g. '#1302', 'APT 3213', 'STE 201').\\n- Do NOT return lines containing 'PO BOX', 'P.O. BOX', 'POBOX', 'PO BOX', or that are clearly mailing/remit addresses.\\n- Exclude lines containing business entity words (DBA, LLC, INC, CO, CORP) unless a separate street line follows them; in that case select the following street line not the entity name.\\n- Discard lines that are long numeric MICR/payment lines or contain many groups of digits separated by spaces (bottom payment string).\\n\\nEDGE CASES: \\n - Company/DBA lines that include a street-like token (e.g., 'WUB1 LLC DBA 300 MAIN AVE LLC'). Rule: if a line contains 'DBA' or 'LLC' or 'INC' or 'PO BOX', treat it as organization and check the next line for the actual street address.\\n - Unit appears on second line together with city/state (e.g., OCR split places '#1302' on the same line as city): prefer the token that is adjacent to the street number and keep only the street+unit tokens, dropping city/state/zip even if they share a line with the unit.\\n - OCR line splits (street name broken over 2 lines): if the first of the split lines begins with a number and the next line looks like a continuation (starts with a word or abbreviation, not a city/state pattern), join them and then trim after unit or before comma/city token.\\n - Multiple addresses present: choose the address located nearest to the 'Statement of Account' header or the account holder name block. If multiple candidate street lines are in that header block, prefer the one that contains a unit marker (#, APT) or that is directly below the account-holder/company name line.\\n - MICR/footer numeric strings and long barcodes: always ignore bottom-most lines that consist primarily of long numeric sequences, special characters, or postal barcode patterns.\\n - Different unit notations: accept '#' (hash), 'APT', 'APARTMENT', 'UNIT', 'STE', 'SUITE' (case-insensitive).\\n\\nEXAMPLES: \\n \\u2713 Input region (top-left header): lines: 'WUB1 LLC DBA 300 MAIN AVE LLC', '300 N MAIN AVE #1302', 'SAN ANTONIO TX 78205' -> Extract: '300 N MAIN AVE #1302'\\n \\u2713 Input region: 'AND I CANNOT LYE LP', '500 N SANTA ROSA AVE #1032', 'SAN ANTONIO TX 78207' -> Extract: '500 N SANTA ROSA AVE #1032'\\n \\u2713 Input region: 'WUB1 LLC DBA 300 MAIN AVE LLC', '300 N MAIN AVE #1401', 'SAN ANTONIO TX 78205' -> Extract: '300 N MAIN AVE #1401'\\n \\u2713 Street line without '#': '780 FASHION DR APT 3213', 'CITY STATE ZIP' -> Extract: '780 FASHION DR APT 3213'\\n \\u2713 If street line is split: '16441 S Harrells Ferry Rd', 'Apt 6502', 'Other city info' -> Join and extract: '16441 S Harrells Ferry Rd Apt 6502'\\n\\nAVOID: \\n \\u2717 Footer remittance block: 'CPS ENERGY', 'PO BOX 2678', 'SAN ANTONIO TX 78289-0001' -> DO NOT extract 'PO BOX 2678' or 'SAN ANTONIO TX 78289-0001'.\\n \\u2717 Organization line containing street tokens: 'WUB1 LLC DBA 300 MAIN AVE LLC' -> DO NOT extract whole 'WUB1 LLC DBA 300 MAIN AVE LLC'; instead check next line for the actual street+unit.\\n \\u2717 MICR/payment line near bottom: '1 300556878 2 000000000...' -> DO NOT extract (not a service street address).\\n \\u2717 Boxed contact blocks on right with addresses or phone numbers -> DO NOT extract these.\\n \\u2717 Any output including city/state/zip, e.g. '300 N MAIN AVE #1302, SAN ANTONIO, TX 78205' -> BAD; strip city/state/zip and return only street+unit.\"}, \"amount_due\": {\"type\": \"number\", \"datapoint_prompt\": \"Total amount due for this billing period\\n\\nCOMMON LABELS: 'Balance Due', 'Balance Due On or Before', 'On or Before', 'After Pay', 'Billing Summary', 'Total Account Balance', 'Total Current Energy Charge', 'Total Amount Enclosed', 'Balance'\\n\\nLOCATION: Top-right quadrant of the first page, near 'Billing Date' and 'Customer Number'; Inside or immediately to the right of the 'Balance Due' block/header (above the 'BILLING SUMMARY' column); Prefer the main billing summary area in the upper half of the page \\u2014 do NOT use the bottom payment stub or 'Total Amount Enclosed' box unless the main 'Balance Due' amount is missing/illegible; If there are duplicate amounts in the billing summary column, pick the amount that is on the same line as 'On or Before Pay' or the first currency value listed under 'Balance Due'\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$17.41' -> 17.41, '$87.20' -> 87.20). If OCR produces '17.4' normalize to two decimals '17.40'. If the extracted value is missing or illegible, return null.\\n\\nEDGE CASES: \\n - If the 'Balance Due' block contains two amounts labeled 'On or Before' and 'After', always choose the 'On or Before' amount (the first listed amount).\\n - If the 'Balance Due' heading includes an AutoPay note (e.g., 'CPS Energy AutoPay Account'), choose the first currency amount shown in that block (this is the amount that will be withdrawn).\\n - If 'On or Before' is not present but 'Total Account Balance' exists in the Billing Summary, use the 'Total Account Balance' amount as a fallback.\\n - Do NOT extract component charges (e.g., 'Current Electricity Charge', 'City Services', 'State & Local Sales Taxes') \\u2014 those are line items, not the total amount due.\\n - Ignore amounts in the tear-off/payment stub at the bottom ('Total Amount Enclosed') unless the main billing summary amount cannot be found or is unreadable.\\n - Ignore negative adjustment lines like 'Payments/Adjustments Thank You -$108.24' \\u2014 those are adjustments, not the balance due.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n\\nEXAMPLES: \\n \\u2713 'Balance Due\\\\nOn or Before Nov 04, 2025 Pay $17.41\\\\nAfter Nov 04, 2025 Pay $17.63' -> 17.41\\n \\u2713 'Balance Due\\\\nCPS Energy AutoPay Account $87.20\\\\nAfter Nov 04, 2025 Pay $88.31' -> 87.20\\n \\u2713 'BILLING SUMMARY\\\\n...\\\\nTotal Account Balance $11.12' (no On or Before present) -> 11.12\\n\\nAVOID: \\n \\u2717 Do NOT extract the 'After Nov 04, 2025 Pay $17.63' amount when 'On or Before $17.41' is present -> do NOT return 17.63\\n \\u2717 Do NOT extract component lines like 'Total Current Energy Charge $13.26' or 'City Services $3.83' -> do NOT return 13.26 or 3.83\\n \\u2717 Do NOT extract the tear-off 'Total Amount Enclosed' field at the bottom when the main billing summary 'Balance Due' is present -> do NOT return the tear-off value\\n \\u2717 Do NOT extract negative adjustment amounts (e.g., '-$108.24') as the 'amount_due' -> do NOT return -108.24\"}, \"current_charges\": {\"type\": \"number\", \"datapoint_prompt\": \"Total current charges INCLUDING all taxes and fees (e.g., Gross Receipts Tax, Regulatory Fees). This is the full amount of charges for THIS billing period, before any previous balance is added.\\n\\nLOCATION STRATEGY:\\n- Primary label: \\\"Current Charges\\\", \\\"Total Current Charges\\\", \\\"Current Amount\\\", \\\"Charges This Period\\\"\\n- Secondary: In summary box/table, often boldface or larger font\\n- Tertiary: Sum of all line items (calculate if not explicitly labeled)\\n- Usually appears: Top right summary area OR bottom of charges section\\n\\nVISUAL IDENTIFICATION:\\n- Typically the LARGEST dollar amount in the current charges section\\n- Often appears in: Bold text, larger font, or highlighted box\\n- May have visual separator (line above/below) to distinguish from line items\\n- Positioned: After all line items but before payment info\\n\\nDECIMAL POINT VALIDATION (CRITICAL):\\n- Utility bills typically: $20-$500 for residential accounts\\n- If amount seems too small: Check if decimal point was misread\\n * Example: Extracted $8.27 but see $827.60 nearby \\u2192 likely wrong decimal\\n * Example: Extracted $4.33 but see $433.18 nearby \\u2192 check both\\n- Cross-validate: Current charges should \\u2248 Amount Due (\\u00b110%) unless previous balance exists\\n- Visual check: Is the font size appropriate for the largest charge?\\n\\nSPECIAL CASES:\\n- NEGATIVE amounts: Valid for credits/refunds (e.g., solar overage, billing adjustments)\\n * Example: -$16.08 for solar credit is CORRECT\\n- Zero amounts: Rare but valid for fully credited accounts\\n- High amounts: Commercial accounts may be >$500, validate against line items sum\\n\\nVALIDATION CHECKLIST:\\n1. Does the amount match a labeled \\\"Current Charges\\\" field? (preferred)\\n2. Does it approximately equal the sum of all line items? (should match within $0.50)\\n3. Is it within 10% of Amount Due? (unless previous balance present)\\n4. Is the magnitude reasonable for a utility bill?\\n5. Does the decimal point placement make sense?\\n\\nIf multiple values seem correct, choose the one explicitly labeled \\\"Current Charges\\\" or \\\"Total Current Charges\\\".\\n\\nCOMMON LABELS: 'Total Account Balance', 'Balance Due', 'Balance Due On or Before', 'Balance Due (On or Before ... Pay)', 'Total Current Charges', 'Total Current Energy Charge', 'Current Charges', 'Charges This Period'\\n\\nLOCATION: Right side of the first page in the 'BILLING SUMMARY' area (center-right); Top-right near the Billing Date / 'Balance Due' header (prefer the 'On or Before' value); Right-aligned, directly to the right of the label text, usually bold; NOT the MICR line or the lower detachable 'Total Amount Enclosed' box (bottom-right); If you see two 'Balance Due' values (On or Before vs After), choose the 'On or Before' (earlier due) amount\\n\\nFORMAT: Return the numeric value only (no currency symbol). Normalize to two decimal places (e.g., 87.20). Preserve a leading negative sign for credits (e.g., -16.08). Always select the single final total for THIS billing period (not previous balance nor payment-amount-after-late-date). If you cannot find an explicit 'Total Account Balance' or 'Balance Due On or Before' label, compute the current charges by summing the relevant current period lines: include 'Total Current Energy Charge' (or 'Current Electricity Charge') + 'City Services' + 'State & Local Sales Taxes' + any other current-period fees shown in the billing summary. Do NOT include 'Previous Bill', 'Payments/Adjustments', 'Balance' (if it's a leftover or zero), 'Final Balance Transfer', or deposits. Allow +/-$0.50 tolerance when summing components but prefer an explicitly labeled total when present.\\n\\nEDGE CASES: \\n - Document has both a detailed billing summary and a detached payment stub: prefer the amount in the main 'BILLING SUMMARY' or the top-right 'Balance Due (On or Before ... Pay)'. Do not return the amount shown in the detachable 'Total Amount Enclosed' box or MICR numbers.\\n - If both 'On or Before' and 'After' amounts are present, always return the 'On or Before' amount (the earlier-due balance).\\n - If only energy subtotal lines are present (e.g., 'Current Electricity Charge' and 'Total Current Energy Charge') and there are visible taxes/fees, sum them to get the total; if taxes/fees are absent assume 'Total Current Energy Charge' is the total (but still check for a labeled 'Total Account Balance').\\n - Negative totals are valid (credits) \\u2014 preserve the sign.\\n - Commercial bills may be > $500 \\u2014 do not reject high amounts if labeled properly.\\n - OCR can misplace decimal points (e.g., '8720' vs '87.20'); use visual grouping and label alignment to find correct decimal placement and cross-validate against other lines.\\n\\nEXAMPLES: \\n \\u2713 Billing Summary -> 'Total Account Balance $17.41' => extract 17.41\\n \\u2713 Top-right header -> 'Balance Due On or Before Nov 04, 2025 Pay $87.20' => extract 87.20\\n \\u2713 Billing Summary lines: 'Total Current Energy Charge $13.26', 'City Services $3.83', 'State & Local Sales Taxes $0.32' => sum and extract 17.41 (if no explicit 'Total Account Balance' label present)\\n\\nAVOID: \\n \\u2717 Do NOT extract 'Current Electricity Charge $13.26' when the final total is $17.41 (this is an energy-only subtotal)\\n \\u2717 Do NOT extract the '$17.63' or '$88.31' (the 'After' late pay amount) when 'On or Before' is available\\n \\u2717 Do NOT extract numeric strings from the MICR/encoding line at bottom (e.g., '000000001763') or the 'Total Amount Enclosed' field in the payment stub\\n \\u2717 Do NOT use 'Payments/Adjustments Thank You -$108.24' lines as the current charges\", \"validation\": {\"type\": \"range\", \"min\": 20, \"max\": 500, \"message\": \"Utility bills typically between $20-$500 - check decimal point placement\"}}, \"total_tax_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total tax amount (sales tax, state tax, local tax, etc.) if shown separately on the invoice. This is the sum of all tax line items (e.g., 'State & Local Sales Taxes').\\n\\nCOMMON LABELS: 'State & Local Sales Taxes', 'State and Local Sales Taxes', 'Sales Tax', 'Tax', 'Total Tax', 'Taxes', 'Tax Amount'\\n\\nLOCATION: Typically in the billing summary section or line items section.; May appear as a separate line item in the line_items array (e.g., 'State & Local Sales Taxes'); May appear in a summary area near current_charges.; Look for tax amounts in the billing summary or line items.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$0.32' -> 0.32, '$5.00' -> 5.00). If tax amount is not shown separately (taxes are included in line items but not summarized), calculate by summing tax line items from the line_items array. If no tax amount is present on the invoice, return null.\\n\\nEDGE CASES:\\n - Tax amount may be shown as a separate line item (e.g., 'State & Local Sales Taxes: $0.32') - extract that amount.\\n - If taxes are included in line items but not summarized separately, sum all tax-related line items to calculate total_tax_amount.\\n - Some invoices may have $0.00 tax - return 0.00 (not null) if explicitly shown.\\n - If taxes are included in the charges but not itemized, return null.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'State & Local Sales Taxes: $0.32' -> extract 0.32\\n \\u2713 Line items include 'State & Local Sales Taxes' with amount 5.00 -> extract 5.00\\n \\u2713 Text shows no separate tax amount and no tax line items -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract non-tax fees (e.g., 'Regulatory Fees', 'Service Charges') as tax amounts\\n \\u2717 Do NOT extract the total current_charges as tax amount\"}, \"balance_forward\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Previous UNPAID balance carried forward from prior billing period. CRITICAL: This is ONLY the unpaid balance from the previous bill, NOT 'Payment Received' or 'Previous Balance Paid'. If the invoice shows 'Payment Received' or the account was paid in full, balance_forward should be 0 or null. Look for labels like 'Balance Forward', 'Previous Balance', 'Unpaid Balance', or calculate as (Amount Due - Current Charges). If Amount Due equals Current Charges, return null.\\n\\nCOMMON LABELS: 'Balance', 'Balance Forward', 'Previous Bill', 'Previous Balance', 'Final Balance Transfer', 'Payments/Adjustments', 'Payment(s)/Adjustments', 'Payments / Adjustments', 'Payments/Adjustments Thank You', 'BILLING SUMMARY', 'Balance Due', 'Total Account Balance'\\n\\nLOCATION: Top-right quadrant of the page inside the boxed area titled 'BILLING SUMMARY' (heading often centered or right of the box).; Look in the right-side column of the Billing Summary box where monetary values are right-aligned in a single vertical column.; The target 'Balance' or 'Balance Forward' numeric is the right-aligned currency on the same horizontal band as the label 'Balance' or 'Balance Forward' under the 'BILLING SUMMARY' heading.; If calculating from components, use the right-aligned numeric for 'Previous Bill' (or 'Final Balance Transfer') and 'Payments/Adjustments' that are inside the same Billing Summary box and aligned in the same numeric column.; Ignore numeric amounts in the detachable payment stub at the bottom, and ignore 'Balance Due' or 'Total Account Balance' amounts shown above or outside the Billing Summary box.\\n\\nFORMAT: Return a numeric float with two decimal places (e.g. 0.00 -> 0.0 or 15.25 -> 15.25). Strip currency symbols ($) and commas. Recognize negatives marked with a leading '-' or parentheses and convert to negative numeric. Numbers may appear with extra OCR noise (e.g. 'O' for '0') \\u2014 apply simple digit normalization before parsing. Use the right-most number on the same horizontal line as the label inside the Billing Summary box. If a 'Balance' line exists inside the Billing Summary box, return that value directly. Otherwise, compute balance_forward = Previous Bill amount + Payments/Adjustments amount (remember Payments/Adjustments is usually negative). If the computed result is <= 0, return 0.0. Return null only if the Billing Summary box is missing or both Previous Bill and Payments/Adjustments and Balance lines are all missing or illegible.\\n\\nEDGE CASES: \\n - Labels sometimes include trailing dates: e.g., 'Previous Bill 09/18/2025 $108.24'. Ignore the date text and parse the numeric amount.\\n - Payments/Adjustments line may include words like 'Thank You' before the number (e.g., 'Payments/Adjustments Thank You -$108.24') \\u2014 extract the numeric and treat as negative.\\n - Variant labels for prior balance: 'Final Balance Transfer', 'Final Balance', or 'Previous Balance' should be treated equivalently to 'Previous Bill'.\\n - Negative adjustments may be shown as '-$108.24' or '($108.24)'. Treat both as -108.24.\\n - If Previous Bill exists but Payments/Adjustments is missing and there is no explicit 'Balance' line, prefer null rather than assuming unpaid balance.\\n - If 'Balance' line is present but shows $0.00, return 0.0 (do not return null).\\n - Do NOT extract amounts from the detachable stub (bottom) - e.g., 'Total Amount Enclosed' or the OCR track line amounts.\\n - If multiple 'Balance' labels exist on page, prefer the numeric located directly under the 'BILLING SUMMARY' heading and right-aligned in the same column as 'Previous Bill' and 'Payments/Adjustments'.\\n\\nEXAMPLES: \\n \\u2713 Billing Summary -> Balance $0.00 => 0.0\\n \\u2713 Billing Summary: Previous Bill 09/18/2025 $108.24 Payments/Adjustments Thank You -$108.24 Balance $0.00 => 0.0\\n \\u2713 Billing Summary: Final Balance Transfer $32.48 Payments/Adjustments -$32.48 Balance $0.00 => 0.0\\n \\u2713 Billing Summary missing 'Balance' but Previous Bill $50.00 and Payments/Adjustments ($-20.00) => compute 30.0 (and return 30.0)\\n\\nAVOID: \\n \\u2717 Extracting the top-right 'Balance Due $17.41' (outside Billing Summary box) as balance_forward \\u2014 INCORRECT.\\n \\u2717 Taking 'Total Account Balance $17.41' (current total) as previous unpaid balance \\u2014 INCORRECT.\\n \\u2717 Using 'Previous Bill' alone as balance_forward when Payments/Adjustments is present but not parsed \\u2014 INCORRECT.\\n \\u2717 Picking numeric from the detachable payment stub (Total Amount Enclosed) as balance_forward \\u2014 INCORRECT.\"}, \"line_items\": {\"type\": \"array\", \"datapoint_prompt\": \"ALL individual charges and taxes on the bill. CRITICAL: Extract EVERY line item from ALL sections of the invoice - do not skip any items.\\n\\nCOMPLETENESS REQUIREMENT:\\n- You MUST extract ALL line items visible on the document\\n- Count items first, then extract each one completely\\n- If you only extracted 2-3 items, you are MISSING items - search more thoroughly\\n- Sum the amounts and verify they match the total charges\\n\\nMULTI-LOCATION SEARCH STRATEGY (CRITICAL - Check ALL 3 locations):\\n\\n1. PRIMARY SECTION - Detailed Charges Table:\\n Common labels: \\\"Detailed Charges\\\", \\\"Current Charges\\\", \\\"Charges This Period\\\", \\\"Electric Charges\\\", \\\"Gas Charges\\\", \\\"Current Service\\\"\\n Look for: Multi-row tables with charge names in left column, amounts in right column\\n Usually contains: Service/Customer charges, Energy charges, Fuel adjustments, Regulatory fees, Environmental fees\\n\\n2. SECONDARY SECTION - Summary Area (top right or bottom of page):\\n Common labels: \\\"Summary of Charges\\\", \\\"Bill Summary\\\", \\\"Total Charges\\\"\\n Look for: Indented list or box with charges + totals\\n Usually contains: Same charges as detailed section, but condensed\\n IMPORTANT: May be THE ONLY location on some invoices (DominionEnergy, some Georgia Power)\\n\\n3. TERTIARY SECTION - Tax Lines (often separate):\\n Common labels: \\\"Taxes and Fees\\\", \\\"Other Charges\\\", near the bottom\\n Look for: Sales tax, Franchise fees, Municipal taxes, Gross receipts tax\\n Usually contains: Tax-specific charges not in main tables\\n\\nVISUAL LAYOUT HINTS:\\n- Line items appear as VERTICAL LISTS (not single lines)\\n- Each item has: Description (left/top) + Dollar amount (right/bottom)\\n- May span multiple pages\\n- Tables may have borders OR be borderless with aligned columns\\n- Dollar amounts always have $ symbol or align to decimal points\\n\\nEXTRACTION COMPLETENESS CHECK:\\n- Count the line items you extracted\\n- Sum their amounts\\n- Compare sum to 'Current Charges' or 'Total Current Charges' field\\n- If sum is significantly different (>$5), you MISSED line items - search other locations\\n\\nCOMMON VARIATIONS:\\n- DominionEnergy: Line items in summary box only (top right), not in detailed section\\n- FPL/Duke: Line items in detailed table + separate tax section\\n- CPS/Entergy: Line items in main table with taxes inline\\n- Georgia Power: May show as indented list under \\\"Current Service\\\"\\n\\nEXCLUSIONS (NOT line items):\\n- Payment Received, Previous Balance, Amount Due, Balance Forward (these are account-level totals, not line items)\\n- Year-to-date usage totals\\n- Meter reading information\\n- Service period dates\\n\\nINCLUSIONS (DO include as line items):\\n- 'Total' or 'Subtotal' lines that appear in the charges/line items breakdown section (these are part of the breakdown)\\n\\nIf you cannot find line items in the first location, KEEP SEARCHING the other sections. Some invoices intentionally show charges in summary boxes instead of detailed tables.\\n\\nCOMMON LABELS: 'BILLING SUMMARY', 'Summary of Charges', 'Bill Summary', 'Current Charges', 'Current Electricity Charge', 'Total Current Energy Charge', 'Service Availability Charge', 'City Services', 'State & Local Sales Taxes', 'State and Local Sales Taxes', 'Taxes and Fees', 'Environmental Fee', 'Environmental Fee-Solid Waste', 'Environmental Fee-Parks', 'Fuel Adjustment', 'Regulatory Adj', 'Regulatory Adjustment', 'Energy Charge'\\n\\nLOCATION: Primary: Inside the 'BILLING SUMMARY' box in the top-right quadrant of page 1 \\u2013 approximate horizontal range 60%\\u201395% of page width; vertical range 5%\\u201345% of page height. Look directly under the 'BILLING SUMMARY' heading and under 'Current Electricity Charge'/'Total Current Energy Charge'.; Primary ordering anchor: within that 'BILLING SUMMARY' box, read items in their visual order (top \\u2192 bottom). If multiple boxes exist, prefer the one titled 'BILLING SUMMARY' or 'Summary of Charges'.; Secondary: If detailed charges exist as a multi-row table (often left/middle of the page), read that table top\\u2192bottom, left\\u2192right (description column then amount column).; Tertiary: Taxes-only lines often appear near the bottom of the page or bottom-right labeled 'Taxes and Fees', 'State & Local Sales Taxes', or 'Other Charges' \\u2014 include these but preserve page order.; If multiple pages, repeat same search on each page and append items in page order (page1 top\\u2192bottom, then page2 top\\u2192bottom).\\n\\nFORMAT: Return an array of {description, amount} in the exact visual order they appear on the invoice (top-to-bottom; tie-breaker: left-to-right). Rules:\\n1) Description: verbatim text span from the invoice (trim whitespace). Preserve any usage fragments (e.g., '51 kWh', 'x $0.07503') and multi-line descriptions by concatenating lines in visual order with a single space. Do NOT normalize ampersands, abbreviations, or wording.\\n2) Amount: numeric float only, strip $ and commas, convert parentheses to negative, round to two decimals (e.g., 3.83).\\n3) Pairing: pair description to the monetized value within the same horizontal band (y-center difference <= 4% of page height). If multiple amounts line up, choose the amount right-aligned within the same bounding box; use bounding-box left edge proximity as tie-breaker.\\n4) Include totals in breakdown: INCLUDE 'Total' or 'Subtotal' line items when they appear in the charges/line items breakdown section. This provides a complete breakdown showing both individual items AND the total. However, EXCLUDE account-level totals like 'Amount Due', 'Balance Forward', 'Previous Balance', 'Payment Received', 'Total Account Balance' (these are account-level fields, not line items). For utility bills: Exclude intermediate category totals like 'Total Current Energy Charge' or 'Current Electricity Charge' when detailed per-kWh lines exist (to avoid duplication), but include the final 'Total' that sums all charges when it appears in the line items section.\\n5) Deduplicate: if an item appears both in the detailed charges table and in the billing summary box (identical description and amount), keep a single entry \\u2014 prefer the entry inside the 'BILLING SUMMARY' box; otherwise prefer the more granular description (the one containing 'kWh' or 'x $').\\n6) Ordering: always output in visual reading order relative to the chosen section (billing summary box or detailed table). If extracting from the billing summary box, do NOT reorder to put taxes last \\u2014 preserve whatever order the bill printed.\\n7) If only a summary total is present (no detailed per-kWh lines or fees), include that summary total verbatim (label preserved).\\n\\nEDGE CASES: \\n - Totals + details both present: e.g., 'Energy Charge' lines with kWh + 'Total Current Energy Charge' also present. Action: keep the detailed kWh lines and exclude the intermediate 'Total Current Energy Charge' category total (to avoid duplication). Only include the 'Total Current Energy Charge' when no detailed energy lines exist anywhere on the document.\\n - Final 'Total' in breakdown: When a 'Total' line appears at the end of the line items/charges breakdown section (summing all charges), INCLUDE it as the last item in the array. This provides complete breakdown information.\\n - Duplicate labels across sections: if the same description+amount occurs in both the detailed table and the billing-summary box, drop duplicates and keep the one inside 'BILLING SUMMARY' (or the one in the summary box if both are inside different summary boxes).\\n - Multi-line descriptions: If the description wraps across OCR lines (e.g., 'Energy Charge' on one line and '51 kWh x $0.07503' on the next), join preserving order and spacing: 'Energy Charge 51 kWh x $0.07503'.\\n - Amounts in parentheses indicate negative; convert '($13.46)' to -13.46.\\n - Thousands separators and $: strip commas and $ before converting to float.\\n - Small rounding/adjustment lines (e.g., 'Regulatory Adj') may be slightly misaligned \\u2013 use horizontal banding and bounding-box proximity rather than absolute X coordinate.\\n - If 'Current Electricity Charge' appears but detailed energy lines exist, treat 'Current Electricity Charge' as a total and exclude it (unless it is the only energy representation).\\n - If document shows both 'City Services' and separate 'Environmental Fee-*' lines, include both verbatim if present; do not merge or normalize them.\\n\\nEXAMPLES: \\n \\u2713 {description: 'Energy Charge 51 kWh x $0.07503', amount: 3.83} -- preserved kWh & rate, amount numeric\\n \\u2713 {description: 'Fuel Adjustment 51 kWh x $0.02782', amount: 1.42}\\n \\u2713 {description: 'Regulatory Adj 51 kWh x $0.01426', amount: 0.73}\\n \\u2713 {description: 'Environmental Fee-Solid Waste', amount: 2.30}\\n \\u2713 {description: 'Environmental Fee-Parks', amount: 1.53}\\n \\u2713 {description: 'Total', amount: 500.0} -- include final total from breakdown section\\n \\u2713 Correct ordering for first document's billing-summary box (top\\u2192bottom): ['Current Electricity Charge' (if no details), 'City Services', 'State & Local Sales Taxes'] \\u2014 but if detailed energy lines exist, list them in the order they appear and exclude the summary 'Total Current Energy Charge'.\\n\\nAVOID: \\n \\u2717 Including both 'Total Current Energy Charge' AND the detailed 'Energy Charge 51 kWh x $0.07503' lines in the returned array (duplicate intermediate category total + details).\\n \\u2717 Returning 'Current Electricity Charge' or 'Total Current Energy Charge' when detailed per-kWh energy lines are present. (Should exclude the intermediate category total and keep detailed lines.)\\n \\u2717 Excluding the final 'Total' line when it appears in the charges/line items breakdown section (this should be included as part of the complete breakdown).\\n \\u2717 Outputting the same set of line items but sorted incorrectly (e.g., taxes first when they are printed last in the box). The returned array must be in visual top-to-bottom order.\\n \\u2717 Mismatching a description to a different amount because vertical-first scanning was used; use horizontal banding and box proximity to pair.\", \"items\": {\"type\": \"object\", \"properties\": {\"datapoint_prompt\": {\"type\": \"string\", \"datapoint_prompt\": \"EXACT charge description as it appears on the bill, INCLUDING any usage details on the same or following line. CRITICAL: If the charge has usage details (e.g., 'Energy Charge' followed by '418.000 kWh @ 12.219c' on the next line), include ALL of it separated by a newline character. Preserve exact formatting - do NOT add parentheses, do NOT expand abbreviations (keep 'Adj' as 'Adj'), do NOT change special characters (keep '&' as '&', not 'and'), do NOT add spaces around hyphens. Copy the text character-for-character. Examples: 'Energy Charge\\\\n418.000 kWh @ 12.219c', 'Energy Charge 51 kWh x $0.07503', 'State & Local Sales Taxes' (NOT 'State and Local Sales Taxes'), 'Environmental Fee-Solid Waste' (NOT 'Environmental Fee - Solid Waste')\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Dollar amount for this line item\"}}, \"required\": [\"description\", \"amount\"]}}}, \"required\": [\"vendor_name\", \"account_number\", \"invoice_date\", \"due_date\", \"amount_due\"], \"validation\": {\"cross_field\": [{\"type\": \"approximate_match\", \"fields\": [\"amount_due\", \"current_charges\"], \"tolerance\": 0.1, \"message\": \"Amount due should match current charges (\\u00b110%) unless there's a significant previous balance\"}, {\"type\": \"date_range\", \"start_field\": \"invoice_date\", \"end_field\": \"due_date\", \"max_days\": 60, \"message\": \"Due date should be within 60 days of invoice date\"}]}}", "true_json_output": "{\"vendor_name\": \"Darshan Engineering Works\", \"account_number\": null, \"invoice_date\": \"2023-04-08\", \"due_date\": null, \"service_address\": null, \"amount_due\": null, \"current_charges\": \"98384.00\", \"total_tax_amount\": 15007.68, \"balance_forward\": null, \"line_items\": [{\"datapoint_prompt\": \"12 MM PLASTIC RECYCLE SHEET (SIZE 8*4 FT)\", \"amount\": 74764.8}, {\"datapoint_prompt\": \"18 MM PLASTIC RECYCLE SHEET (SIZE 8*4 FT)\", \"amount\": 11705.6}, {\"datapoint_prompt\": \"24 MM PLASTIC RECYCLING SHEET (SIZE 3*7 FT)\", \"amount\": 6796.8}, {\"datapoint_prompt\": \"24 MM PLASTIC RECYCLING SHEET (SIZE - 4? FT)\", \"amount\": 3398.4}, {\"datapoint_prompt\": \"8 MM PLASTIC RECYCLE SHEET\", \"amount\": 1246.08}, {\"datapoint_prompt\": \"LOADING & TRANSPORT\", \"amount\": 472.0}, {\"datapoint_prompt\": \"Total\", \"amount\": 98384.0}], \"source_filename\": \"invoice_2.pdf\"}", "true_markdown_output": "**Vendor Name:** Darshan Engineering Works\n**Account Number:** N/A\n**Invoice Date:** 2023-04-08\n**Due Date:** N/A\n**Service Address:** N/A\n**Amount Due:** N/A\n**Current Charges:** 98384.00\n**Total Tax Amount:** 15007.68\n**Balance Forward:** N/A\n**Line Items:**\n **Datapoint Prompt:** 12 MM PLASTIC RECYCLE SHEET (SIZE 8*4 FT)\n **Amount:** 74764.8\n **Datapoint Prompt:** 18 MM PLASTIC RECYCLE SHEET (SIZE 8*4 FT)\n **Amount:** 11705.6\n **Datapoint Prompt:** 24 MM PLASTIC RECYCLING SHEET (SIZE 3*7 FT)\n **Amount:** 6796.8\n **Datapoint Prompt:** 24 MM PLASTIC RECYCLING SHEET (SIZE - 4? FT)\n **Amount:** 3398.4\n **Datapoint Prompt:** 8 MM PLASTIC RECYCLE SHEET\n **Amount:** 1246.08\n **Datapoint Prompt:** LOADING & TRANSPORT\n **Amount:** 472.0\n **Datapoint Prompt:** Total\n **Amount:** 98384.0"} {"file_name": "images/medical_bill.png", "id": 9, "metadata": "{\"format\": \"MEDICAL_BILL\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"medical_bill.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"provider_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the healthcare provider, hospital, clinic, or medical facility that issued the bill.\\n\\nCOMMON LABELS: Provider name typically appears in the header/logo area at the top of the bill.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the header area with the provider logo.; Within the first 10-20% of page height, centered or left-aligned.; May appear in larger, bold font near the bill title.; Often appears with the facility name or medical practice name.\\n\\nFORMAT: Return the provider name as it appears on the document. Common formats: 'Memorial Hospital', 'Smith Medical Group', 'City Health Clinic', 'Dr. Johnson Family Practice'. Preserve capitalization and abbreviations. Prefer the brand/practice name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'Memorial Hospital System' and 'Memorial Hospital'), prefer the shorter brand name if clear.\\n - Provider names may include medical group designations, hospital systems, or practice names - preserve as shown.\\n - If the provider name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'MEMORIAL HOSPITAL' in large header text -> extract 'MEMORIAL HOSPITAL' or 'Memorial Hospital'\\n \\u2713 Document shows 'Smith Medical Group, P.C.' in header -> extract 'Smith Medical Group' or 'Smith Medical Group, P.C.'\\n \\u2713 Document shows 'CITY HEALTH CLINIC' -> extract 'CITY HEALTH CLINIC' or 'City Health Clinic'\\n\\nAVOID:\\n \\u2717 Do NOT extract mailing addresses or branch locations as the provider name\\n \\u2717 Do NOT extract insurance company names as the provider name\\n \\u2717 Do NOT extract department names (e.g., 'Emergency Department') as the provider name unless that's the only provider identifier\"}, \"patient_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the patient who received the medical services.\\n\\nCOMMON LABELS: 'Patient Name', 'Patient', 'Name', 'Patient:', 'Name:', 'Bill To', 'Account Holder'\\n\\nLOCATION: Top section of the first page, typically in the patient information or billing section.; Often appears near the account number and patient date of birth.; May be in the upper-left or upper-center area.; Look for a labeled field with the patient's name.\\n\\nFORMAT: Return the patient name exactly as it appears on the document. Common formats:\\n - Full name: 'John Doe'\\n - With middle name/initial: 'John Michael Doe' or 'John M. Doe'\\n - Last name first: 'Doe, John'\\nPreserve capitalization, punctuation, and formatting (including middle names/initials, suffixes like Jr., Sr., etc.).\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Some bills show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Names may be in all uppercase on bills - preserve the capitalization.\\n - If name appears in multiple places, prefer the one in the main patient information section.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Patient Name: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Patient: DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Name: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n \\u2713 Text shows 'Patient Name: John M. Doe' -> extract 'John M. Doe'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract guarantor or responsible party names as the patient name (unless they're the same)\\n \\u2717 Do NOT extract insurance subscriber names as the patient name (they may be different)\"}, \"patient_account_number\": {\"type\": \"string\", \"datapoint_prompt\": \"The patient account number or medical record number associated with this bill.\\n\\nCOMMON LABELS: 'Account Number', 'Account No.', 'Account #', 'Acct Number', 'Acct No.', 'Acct #', 'Patient Account', 'Medical Record Number', 'MRN', 'Account', 'Acct'\\n\\nLOCATION: Top section of the first page, typically in the patient information or billing section.; Often appears near the patient name and date of birth.; May be in the upper-left or upper-center area.; Look for a labeled field with a numeric or alphanumeric account identifier.\\n\\nFORMAT: Return the account number exactly as it appears on the document. Common formats:\\n - All digits (e.g., '123456789')\\n - Digits with dashes (e.g., '1234-5678-90')\\n - Alphanumeric (e.g., 'PAT123456', 'MRN-123456')\\nPreserve any formatting, masking characters, or spacing as shown.\\n\\nEDGE CASES:\\n - Account numbers may be masked with asterisks or X's - preserve the masking format if shown.\\n - Multiple account numbers may appear if the bill covers multiple accounts - extract the primary account number (usually the one in the main patient information area).\\n - Account numbers may appear multiple times (header, footer, each page) - they should all match; extract the one from the main patient information area.\\n - Do not confuse with insurance policy numbers, claim numbers, or other identifiers.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Account Number: 123456789' -> extract '123456789'\\n \\u2713 Text shows 'Acct #: 1234-5678-90' -> extract '1234-5678-90'\\n \\u2713 Text shows 'Account: PAT123456' -> extract 'PAT123456'\\n \\u2713 Text shows 'MRN: 123-456-789' -> extract '123-456-789'\\n\\nAVOID:\\n \\u2717 Do NOT extract insurance policy numbers as account numbers\\n \\u2717 Do NOT extract claim numbers or reference numbers as account numbers\\n \\u2717 Do NOT extract medical record numbers from other sections if a labeled account number exists\\n \\u2717 Do NOT extract customer service phone numbers or other numeric identifiers\"}, \"patient_date_of_birth\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The patient's date of birth in YYYY-MM-DD format (if shown on the bill).\\n\\nCOMMON LABELS: 'Date of Birth', 'DOB', 'Birth Date', 'Born', 'Birth Date:', 'DOB:'\\n\\nLOCATION: Top section of the first page, typically in the patient information section.; Often appears near the patient name and account number.; May be in the upper-left or upper-center area.; Look for a labeled date field in the patient information area.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/1990' -> '1990-01-15')\\n - M/D/YYYY (e.g., '1/15/1990' -> '1990-01-15')\\n - MM-DD-YYYY (e.g., '01-15-1990' -> '1990-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 1990' -> '1990-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 1990' -> '1990-01-15')\\nIf year is two digits, use context to determine century. If date of birth is not shown on the bill, return null.\\n\\nEDGE CASES:\\n - Date of birth should be in the past (typically many years ago).\\n - Two-digit years: Use context to determine century (e.g., '01/15/90' likely -> '1990-01-15' for older patients).\\n - Some bills may not show date of birth for privacy reasons - return null if not present.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'DOB: 01/15/1990' -> extract '1990-01-15'\\n \\u2713 Text shows 'Date of Birth: January 15, 1990' -> extract '1990-01-15'\\n \\u2713 Text shows 'DOB: 1-15-90' -> extract '1990-01-15' (assuming older patient)\\n \\u2713 Text shows no date of birth -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract service dates or billing dates as date of birth\\n \\u2717 Do NOT extract dates that are clearly in the future or very recent (those are likely service dates)\"}, \"billing_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date the bill was issued/generated in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Bill Date', 'Billing Date', 'Statement Date', 'Invoice Date', 'Date', 'Bill Date:', 'Statement Date:', 'Date of Bill'\\n\\nLOCATION: Top-right area of the first page, near account number and balance due.; Header area directly in the upper-right corner.; Within the first ~20% of page height and rightmost ~30% of page width.; Look for the date associated with when the bill was generated.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats: MM/DD/YY, M/D/YY, MM/DD/YYYY, M/D/YYYY, 'Mon DD, YYYY' (e.g., Nov 04, 2025), 'DD Mon YYYY'. If the year is two digits (e.g., 25), assume 20YY (e.g., '10/17/25' -> 2025-10-17).\\n\\nEDGE CASES:\\n - Multiple dates on page: 'Bill Date' vs 'Service Date' vs 'Due Date' - choose the billing/statement date.\\n - Two-digit years (10/17/25) - must be expanded to 2025.\\n - Month name formats (Nov 04, 2025) - convert to ISO.\\n - OCR errors that insert extra punctuation or characters - strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'Bill Date: 10/17/25' in the top-right -> extract '2025-10-17'.\\n \\u2713 Document shows 'Statement Date: Nov 4, 2025' in header -> extract '2025-11-04'.\\n \\u2713 Document shows 'Billing Date 09/18/2025' near provider header -> extract '2025-09-18'.\\n\\nAVOID:\\n \\u2717 Do NOT extract service dates or dates of service as the billing date\\n \\u2717 Do NOT extract due dates as the billing date\\n \\u2717 Do NOT extract dates from the service/itemized charges section as the billing date\"}, \"due_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The payment due date in YYYY-MM-DD format (if specified on the bill).\\n\\nCOMMON LABELS: 'Due Date', 'Payment Due Date', 'Please Pay By', 'Pay By', 'Payment Due', 'Due By', 'Due:'\\n\\nLOCATION: Top-right quadrant of the first page, near the balance due amount.; Often appears in or near the 'Amount Due' or 'Balance Due' section.; May be in a payment summary box.; Look for dates labeled as due dates or payment due dates.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats: 'Nov 04, 2025', 'November 4, 2025', '11/04/2025', '11/4/25', '11-04-2025', '11/04/25'. If the year is given as two digits (e.g. '25'), expand to 20YY (->2025). If no due date is specified on the bill, return null.\\n\\nEDGE CASES:\\n - Due date should be after the billing date (typically 15-45 days after).\\n - Two-digit year '25' should be expanded to 2025.\\n - OCR noise: strip non-date tokens before parsing.\\n - Some bills may not specify a due date - return null if not present.\\n\\nEXAMPLES:\\n \\u2713 Text: 'Due Date: Nov 04, 2025' -> Extract: '2025-11-04'\\n \\u2713 Text: 'Payment Due By: 11/04/2025' -> Extract: '2025-11-04'\\n \\u2713 Text: 'Please Pay By: 11/4/25' -> Extract: '2025-11-04'\\n \\u2713 Text shows no due date -> Extract: null\\n\\nAVOID:\\n \\u2717 Text: 'Bill Date: 10/17/25' -> DO NOT extract as due_date (this is billing_date).\\n \\u2717 Do NOT extract service dates as due dates\"}, \"amount_due\": {\"type\": \"number\", \"datapoint_prompt\": \"The total amount due/owed by the patient for this bill.\\n\\nCOMMON LABELS: 'Amount Due', 'Balance Due', 'Total Due', 'Patient Responsibility', 'Amount Owed', 'Balance', 'Total Amount Due', 'Due'\\n\\nLOCATION: Top-right quadrant of the first page, near the billing date and account number.; Often appears prominently in a 'Amount Due' or 'Balance Due' section.; May be in a payment summary box.; Look for the total amount the patient owes.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$150.00' -> 150.00, '$1,234.56' -> 1234.56). If OCR produces '150' normalize to two decimals '150.00'. If the extracted value is missing or illegible, return null.\\n\\nEDGE CASES:\\n - Amount due should be a positive number (patient owes money).\\n - Some bills may show $0.00 if fully paid or covered by insurance - extract 0.00.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n - If multiple amounts appear, prefer the one labeled 'Amount Due' or 'Balance Due' over subtotals or line item amounts.\\n\\nEXAMPLES:\\n \\u2713 'Amount Due: $150.00' -> 150.00\\n \\u2713 'Balance Due: $1,234.56' -> 1234.56\\n \\u2713 'Total Due: $0.00' -> 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract subtotals or line item amounts as the amount due\\n \\u2717 Do NOT extract insurance payment amounts as the amount due\\n \\u2717 Do NOT extract total charges (before insurance) as the amount due\"}, \"insurance_name\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The name of the insurance company or health plan (if insurance information is present on the bill).\\n\\nCOMMON LABELS: 'Insurance', 'Insurance Company', 'Carrier', 'Health Plan', 'Insurance Plan', 'Insurance:', 'Carrier:', 'Plan Name'\\n\\nLOCATION: Typically in an insurance information section, often in the middle or lower portion of the first page.; May appear near other insurance details like policy numbers.; Look for insurance company names in the insurance/billing section.\\n\\nFORMAT: Return the insurance company name exactly as it appears on the document. Common formats: 'Blue Cross Blue Shield', 'Aetna', 'UnitedHealthcare', 'Cigna', 'Medicare', 'Medicaid'. Preserve capitalization and exact wording. If no insurance information is present on the bill, return null.\\n\\nEDGE CASES:\\n - Insurance names may be abbreviated (e.g., 'BCBS' for Blue Cross Blue Shield) - preserve as shown.\\n - Some bills show multiple insurance companies (primary and secondary) - extract the primary insurance name if multiple exist.\\n - If the bill shows 'Self Pay' or 'No Insurance', return null.\\n - Insurance names may appear with plan names (e.g., 'Aetna HMO') - include the plan type if it's part of the name.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Insurance: Blue Cross Blue Shield' -> extract 'Blue Cross Blue Shield'\\n \\u2713 Text shows 'Carrier: Aetna HMO' -> extract 'Aetna HMO'\\n \\u2713 Text shows 'Insurance Company: UnitedHealthcare' -> extract 'UnitedHealthcare'\\n \\u2713 Text shows 'Self Pay' or no insurance information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract provider names as insurance names\\n \\u2717 Do NOT extract plan types alone (e.g., 'HMO', 'PPO') without the insurance company name\\n \\u2717 Do NOT extract policy numbers or group numbers as insurance names\"}, \"insurance_policy_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The insurance policy number or member ID (if insurance information is present on the bill).\\n\\nCOMMON LABELS: 'Policy Number', 'Policy No.', 'Policy #', 'Member ID', 'Member Number', 'Subscriber ID', 'Insurance ID', 'Policy:', 'Member ID:'\\n\\nLOCATION: Typically in an insurance information section, often near the insurance company name.; May appear with other insurance details like group numbers.; Look for policy/member ID numbers in the insurance/billing section.\\n\\nFORMAT: Return the policy number exactly as it appears on the document. Policy numbers may be numeric, alphanumeric, or include dashes. Preserve any formatting, dashes, or spacing as shown. If no insurance information is present, return null.\\n\\nEDGE CASES:\\n - Policy numbers vary by insurance company - preserve the exact format.\\n - Policy numbers may include dashes or spaces (e.g., 'ABC123456789', 'ABC-123-456-789') - preserve as shown.\\n - Some bills show member IDs instead of policy numbers - extract as shown.\\n - If the bill shows 'Self Pay' or no insurance, return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Policy Number: ABC123456789' -> extract 'ABC123456789'\\n \\u2713 Text shows 'Member ID: 123-456-789' -> extract '123-456-789'\\n \\u2713 Text shows 'Policy #: ABC-123-456-789' -> extract 'ABC-123-456-789'\\n \\u2713 Text shows no insurance information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract account numbers as policy numbers\\n \\u2717 Do NOT extract group numbers as policy numbers\\n \\u2717 Do NOT extract claim numbers as policy numbers\"}, \"service_date_from\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The earliest service date (date of service start) if services span multiple dates, or the service date if there's a single date, in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Service Date', 'Date of Service', 'DOS', 'Service Dates', 'From', 'Service From', 'Date From'\\n\\nLOCATION: Typically in the service/itemized charges section or in a service period field.; May appear near the service descriptions or in a date range.; Look for dates associated with when medical services were provided.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If services span a date range, extract the start/from date. If there's a single service date, extract that. If service dates are not shown or are embedded only in line items, return null.\\n\\nEDGE CASES:\\n - Service dates should be before or equal to the billing date.\\n - If services span multiple dates, extract the earliest date.\\n - If only individual service dates appear in line items (no overall service period), return null and let line items contain the dates.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Service Date: 09/15/2025' -> extract '2025-09-15'\\n \\u2713 Text shows 'Service Dates: 09/15/2025 - 09/20/2025' -> extract '2025-09-15'\\n \\u2713 Text shows 'Date of Service: September 15, 2025' -> extract '2025-09-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract billing dates as service dates\\n \\u2717 Do NOT extract due dates as service dates\"}, \"service_date_to\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The latest service date (date of service end) if services span a date range, in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Service Date', 'Date of Service', 'Service Dates', 'To', 'Service To', 'Date To'\\n\\nLOCATION: Typically in the service/itemized charges section or in a service period field.; May appear near the service descriptions or in a date range.; Look for the end date in a date range for services.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). If services span a date range, extract the end/to date. If there's only a single service date (no range), return null. If service dates are not shown as a range, return null.\\n\\nEDGE CASES:\\n - Service end date should be after or equal to the service start date.\\n - If there's only a single service date (no range), return null.\\n - If only individual service dates appear in line items (no overall service period), return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Service Dates: 09/15/2025 - 09/20/2025' -> extract '2025-09-20'\\n \\u2713 Text shows 'Service Date: 09/15/2025' (single date, no range) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract billing dates as service dates\\n \\u2717 Do NOT extract due dates as service dates\"}, \"line_items\": {\"type\": \"array\", \"datapoint_prompt\": \"All individual charges, procedures, services, and items listed on the medical bill. Extract ALL line items in the order they appear.\\n\\nLOCATION STRATEGY:\\n- PRIMARY: Main charges/procedures table, typically the largest section on the bill\\n- Common labels: 'Charges', 'Services', 'Itemized Charges', 'Procedure Details', 'Service Details', 'Charges Detail'\\n- Usually appears: Middle to lower portion of the bill pages\\n- Format: Table with columns for Date, Description/Procedure, Code (CPT/ICD), Amount, etc.\\n\\nEXTRACTION RULES:\\n- Extract ALL line items - do not skip any charges\\n- Preserve chronological order (as they appear on the bill)\\n- Include ALL service types: procedures, lab tests, medications, supplies, room charges, etc.\\n- For each line item, extract: date (if shown), description, amount, and optionally codes\\n- Amount format: Use the charge amount (before insurance adjustments)\\n\\nCOMMON LINE ITEM TYPES:\\n- Procedures: Office visits, surgeries, treatments\\n- Lab Tests: Blood tests, urine tests, imaging studies\\n- Medications: Prescription drugs, IV medications\\n- Supplies: Medical supplies, equipment\\n- Room Charges: Hospital room, facility fees\\n- Other: Professional fees, administrative charges\\n\\nFORMAT: Return an array of line item objects in the order they appear on the bill. Each item should include:\\n- date: Service date in YYYY-MM-DD format (if shown per item)\\n- description: Full service/procedure description as it appears\\n- amount: Numeric charge amount (before insurance)\\n- code: Optional procedure code (CPT) or diagnosis code (ICD) if shown\\n- insurance_adjustment: Optional insurance adjustment/discount amount if shown separately\\n- patient_responsibility: Optional patient responsibility amount if shown separately\\n\\nEDGE CASES:\\n- Multiple services on the same date: Include all of them, preserve order\\n- Codes may be CPT (procedure codes) or ICD (diagnosis codes) - extract as shown\\n- Some bills show charges, adjustments, and patient responsibility separately - include all if shown\\n- Descriptions may be abbreviated or use medical terminology - extract as shown\\n- If amounts appear in multiple columns (charge, adjustment, patient responsibility), extract all relevant amounts\\n\\nEXAMPLES:\\n \\u2713 {date: '2025-09-15', description: 'Office Visit - Established Patient', amount: 150.00, code: '99213'}\\n \\u2713 {date: '2025-09-15', description: 'CBC (Complete Blood Count)', amount: 75.50, code: '85025'}\\n \\u2713 {date: '2025-09-16', description: 'X-Ray - Chest 2 Views', amount: 200.00, code: '71020'}\\n\\nAVOID:\\n \\u2717 Do NOT skip line items even if they seem minor\\n \\u2717 Do NOT extract summary totals as individual line items\\n \\u2717 Do NOT extract insurance payment information as line items\\n \\u2717 Do NOT reorder items - preserve the order as shown on the bill\", \"items\": {\"type\": \"object\", \"properties\": {\"date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"Service date for this line item in YYYY-MM-DD format (if shown per item).\"}, \"description\": {\"type\": \"string\", \"datapoint_prompt\": \"Service/procedure description EXACTLY as it appears on the bill. Include all details: procedure names, test names, medication names, etc. Preserve the exact text as shown.\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Charge amount for this line item as a numeric value. Format: numeric decimal with two decimal places (e.g., 150.00, 75.50). This is typically the amount charged before insurance adjustments.\"}, \"code\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"Procedure code (CPT) or diagnosis code (ICD) if shown for this line item. Preserve the exact code format as shown (e.g., '99213', '85025', 'E11.9').\"}, \"insurance_adjustment\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Insurance adjustment, discount, or negotiated rate reduction amount if shown separately for this line item. Format: numeric decimal with two decimal places. Return null if not shown separately.\"}, \"patient_responsibility\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Patient responsibility amount (copay, deductible, coinsurance) if shown separately for this line item. Format: numeric decimal with two decimal places. Return null if not shown separately.\"}}, \"required\": [\"description\", \"amount\"]}}, \"total_charges\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total charges AFTER discounts and insurance adjustments are applied (the net amount after discounts/adjustments). This is the final total that accounts for any hospital discounts, insurance adjustments, or other reductions.\\n\\nCOMMON LABELS: 'Total Charges', 'Actual Discounted Charges', 'Net Charges', 'Charges After Discount', 'Total After Discount', 'Adjusted Total'\\n\\nLOCATION: Typically at the bottom of the charges/itemized section or in a summary area.; Often appears after discount and insurance adjustment sections.; Look for the final total that includes discounts/adjustments applied.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If this amount is not shown separately, calculate it by:\\n - Starting with the sum of all service/charge line items (e.g., 'ROOM & BOARD', 'PHARMACY', 'LABORATORY')\\n - SUBTRACTING discount line items (e.g., 'Hospital Discount to Patient' with negative amounts)\\n - SUBTRACTING insurance adjustment amounts if shown separately\\n - Result = Net charges after discounts/insurance adjustments\\n\\nCALCULATION RULE:\\n - If a labeled 'Total Charges' or 'Actual Discounted Charges' appears, use that value (this is the net amount after discounts).\\n - If no labeled total exists, calculate: Sum of service line items + Discount amounts (which are negative) = Net total\\n - Example: Service charges $292,643.73 + Hospital Discount -$171,196.61 = $121,447.12 total_charges\\n - EXCLUDE line items like: 'Insurance Payments Received', 'Patient Payments Received' (these are payments, not charges)\\n\\nEDGE CASES:\\n - Total charges should reflect the NET amount after discounts/adjustments are applied.\\n - Some bills show 'Pre-discount Charges' and 'Actual Discounted Charges' separately - use the 'Actual Discounted Charges' value.\\n - Discounts are typically negative amounts in line items - add them to get the net total (e.g., charges + (-discount) = net charges).\\n - If no discounts or adjustments are present, total_charges equals the sum of service line items.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Actual Discounted Charges: $121,447.12' -> extract 121447.12\\n \\u2713 Service charges sum to $292,643.73, 'Hospital Discount to Patient' is -$171,196.61 -> calculate and extract 121447.12 (292643.73 - 171196.61)\\n \\u2713 Text shows 'Total Charges: $1,500.00' with no discounts shown -> extract 1500.00\\n \\u2713 Text shows no separate total charges field and line items are unclear -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract pre-discount charges as total_charges (look for 'Actual Discounted Charges' or calculate net amount)\\n \\u2717 Do NOT extract the amount due as total charges (amount due may include other adjustments)\\n \\u2717 Do NOT extract insurance payment amounts as total charges\"}, \"insurance_payments\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total amount paid or covered by insurance (if shown on the bill).\\n\\nCOMMON LABELS: 'Insurance Payment', 'Insurance Paid', 'Paid by Insurance', 'Insurance Coverage', 'Insurance Adjustment', 'Insurance'\\n\\nLOCATION: Typically in a payment/adjustment summary section, often near the amount due.; May appear after the total charges and before the amount due.; Look for insurance payment or coverage amounts.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If insurance payments are not shown on the bill, return null.\\n\\nEDGE CASES:\\n - Insurance payments may be shown as a total or broken down by line item - extract the total if shown.\\n - Some bills show $0.00 if no insurance or if insurance didn't pay - extract 0.00 in that case.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Insurance Payment: $1,200.00' -> extract 1200.00\\n \\u2713 Text shows 'Paid by Insurance: $500.00' -> extract 500.00\\n \\u2713 Text shows 'Insurance: $0.00' -> extract 0.00\\n \\u2713 Text shows no insurance payment information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract insurance adjustments (discounts) as insurance payments\\n \\u2717 Do NOT extract the amount due as insurance payments\"}}, \"required\": [\"provider_name\", \"patient_name\", \"patient_account_number\", \"billing_date\", \"amount_due\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"service_date_from\", \"end_field\": \"billing_date\", \"max_days\": 365, \"message\": \"Service dates should be within 365 days of billing date\"}, {\"type\": \"date_comparison\", \"field1\": \"billing_date\", \"field2\": \"due_date\", \"comparison\": \"before_or_equal\", \"message\": \"Billing date should be before or equal to due date (if due date is specified)\"}]}}", "true_json_output": "{\"provider_name\": \"APOLLO HOSPITALS\", \"patient_name\": \"Saravana kumar V\", \"patient_account_number\": \"0000246611\", \"patient_date_of_birth\": null, \"billing_date\": \"2013-01-13\", \"due_date\": null, \"amount_due\": 15143.54, \"insurance_name\": null, \"insurance_policy_number\": null, \"service_date_from\": \"2014-01-10\", \"service_date_to\": \"2014-01-13\", \"line_items\": [{\"date\": null, \"description\": \"ROOM RENT\", \"amount\": 4000.0, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": null, \"description\": \"PHARMACY\", \"amount\": 2765.54, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": null, \"description\": \"MEDICAL EQUIPMENT\", \"amount\": 1000.0, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": null, \"description\": \"CONSULTATIONS\", \"amount\": 2400.0, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": null, \"description\": \"CONSUMABLES\", \"amount\": 2118.0, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": null, \"description\": \"INVESTIGATIONS\", \"amount\": 2860.0, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}], \"total_charges\": 15143.54, \"insurance_payments\": null, \"source_filename\": \"medical_bill.pdf\"}", "true_markdown_output": "**Provider Name:** APOLLO HOSPITALS\n**Patient Name:** Saravana kumar V\n**Patient Account Number:** 0000246611\n**Patient Date Of Birth:** N/A\n**Billing Date:** 2013-01-13\n**Due Date:** N/A\n**Amount Due:** 15143.54\n**Insurance Name:** N/A\n**Insurance Policy Number:** N/A\n**Service Date From:** 2014-01-10\n**Service Date To:** 2014-01-13\n**Line Items:**\n **Date:** N/A\n **Description:** ROOM RENT\n **Amount:** 4000.0\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** N/A\n **Description:** PHARMACY\n **Amount:** 2765.54\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** N/A\n **Description:** MEDICAL EQUIPMENT\n **Amount:** 1000.0\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** N/A\n **Description:** CONSULTATIONS\n **Amount:** 2400.0\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** N/A\n **Description:** CONSUMABLES\n **Amount:** 2118.0\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** N/A\n **Description:** INVESTIGATIONS\n **Amount:** 2860.0\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n**Total Charges:** 15143.54\n**Insurance Payments:** N/A"} {"file_name": "images/medical_bill_2.png", "id": 10, "metadata": "{\"format\": \"MEDICAL_BILL\", \"documentQuality\": \"PHOTO\", \"source_filename\": \"medical_bill_2.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"provider_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the healthcare provider, hospital, clinic, or medical facility that issued the bill.\\n\\nCOMMON LABELS: Provider name typically appears in the header/logo area at the top of the bill.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the header area with the provider logo.; Within the first 10-20% of page height, centered or left-aligned.; May appear in larger, bold font near the bill title.; Often appears with the facility name or medical practice name.\\n\\nFORMAT: Return the provider name as it appears on the document. Common formats: 'Memorial Hospital', 'Smith Medical Group', 'City Health Clinic', 'Dr. Johnson Family Practice'. Preserve capitalization and abbreviations. Prefer the brand/practice name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'Memorial Hospital System' and 'Memorial Hospital'), prefer the shorter brand name if clear.\\n - Provider names may include medical group designations, hospital systems, or practice names - preserve as shown.\\n - If the provider name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'MEMORIAL HOSPITAL' in large header text -> extract 'MEMORIAL HOSPITAL' or 'Memorial Hospital'\\n \\u2713 Document shows 'Smith Medical Group, P.C.' in header -> extract 'Smith Medical Group' or 'Smith Medical Group, P.C.'\\n \\u2713 Document shows 'CITY HEALTH CLINIC' -> extract 'CITY HEALTH CLINIC' or 'City Health Clinic'\\n\\nAVOID:\\n \\u2717 Do NOT extract mailing addresses or branch locations as the provider name\\n \\u2717 Do NOT extract insurance company names as the provider name\\n \\u2717 Do NOT extract department names (e.g., 'Emergency Department') as the provider name unless that's the only provider identifier\"}, \"patient_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the patient who received the medical services.\\n\\nCOMMON LABELS: 'Patient Name', 'Patient', 'Name', 'Patient:', 'Name:', 'Bill To', 'Account Holder'\\n\\nLOCATION: Top section of the first page, typically in the patient information or billing section.; Often appears near the account number and patient date of birth.; May be in the upper-left or upper-center area.; Look for a labeled field with the patient's name.\\n\\nFORMAT: Return the patient name exactly as it appears on the document. Common formats:\\n - Full name: 'John Doe'\\n - With middle name/initial: 'John Michael Doe' or 'John M. Doe'\\n - Last name first: 'Doe, John'\\nPreserve capitalization, punctuation, and formatting (including middle names/initials, suffixes like Jr., Sr., etc.).\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Some bills show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Names may be in all uppercase on bills - preserve the capitalization.\\n - If name appears in multiple places, prefer the one in the main patient information section.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Patient Name: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Patient: DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Name: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n \\u2713 Text shows 'Patient Name: John M. Doe' -> extract 'John M. Doe'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract guarantor or responsible party names as the patient name (unless they're the same)\\n \\u2717 Do NOT extract insurance subscriber names as the patient name (they may be different)\"}, \"patient_account_number\": {\"type\": \"string\", \"datapoint_prompt\": \"The patient account number or medical record number associated with this bill.\\n\\nCOMMON LABELS: 'Account Number', 'Account No.', 'Account #', 'Acct Number', 'Acct No.', 'Acct #', 'Patient Account', 'Medical Record Number', 'MRN', 'Account', 'Acct'\\n\\nLOCATION: Top section of the first page, typically in the patient information or billing section.; Often appears near the patient name and date of birth.; May be in the upper-left or upper-center area.; Look for a labeled field with a numeric or alphanumeric account identifier.\\n\\nFORMAT: Return the account number exactly as it appears on the document. Common formats:\\n - All digits (e.g., '123456789')\\n - Digits with dashes (e.g., '1234-5678-90')\\n - Alphanumeric (e.g., 'PAT123456', 'MRN-123456')\\nPreserve any formatting, masking characters, or spacing as shown.\\n\\nEDGE CASES:\\n - Account numbers may be masked with asterisks or X's - preserve the masking format if shown.\\n - Multiple account numbers may appear if the bill covers multiple accounts - extract the primary account number (usually the one in the main patient information area).\\n - Account numbers may appear multiple times (header, footer, each page) - they should all match; extract the one from the main patient information area.\\n - Do not confuse with insurance policy numbers, claim numbers, or other identifiers.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Account Number: 123456789' -> extract '123456789'\\n \\u2713 Text shows 'Acct #: 1234-5678-90' -> extract '1234-5678-90'\\n \\u2713 Text shows 'Account: PAT123456' -> extract 'PAT123456'\\n \\u2713 Text shows 'MRN: 123-456-789' -> extract '123-456-789'\\n\\nAVOID:\\n \\u2717 Do NOT extract insurance policy numbers as account numbers\\n \\u2717 Do NOT extract claim numbers or reference numbers as account numbers\\n \\u2717 Do NOT extract medical record numbers from other sections if a labeled account number exists\\n \\u2717 Do NOT extract customer service phone numbers or other numeric identifiers\"}, \"patient_date_of_birth\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The patient's date of birth in YYYY-MM-DD format (if shown on the bill).\\n\\nCOMMON LABELS: 'Date of Birth', 'DOB', 'Birth Date', 'Born', 'Birth Date:', 'DOB:'\\n\\nLOCATION: Top section of the first page, typically in the patient information section.; Often appears near the patient name and account number.; May be in the upper-left or upper-center area.; Look for a labeled date field in the patient information area.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/1990' -> '1990-01-15')\\n - M/D/YYYY (e.g., '1/15/1990' -> '1990-01-15')\\n - MM-DD-YYYY (e.g., '01-15-1990' -> '1990-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 1990' -> '1990-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 1990' -> '1990-01-15')\\nIf year is two digits, use context to determine century. If date of birth is not shown on the bill, return null.\\n\\nEDGE CASES:\\n - Date of birth should be in the past (typically many years ago).\\n - Two-digit years: Use context to determine century (e.g., '01/15/90' likely -> '1990-01-15' for older patients).\\n - Some bills may not show date of birth for privacy reasons - return null if not present.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'DOB: 01/15/1990' -> extract '1990-01-15'\\n \\u2713 Text shows 'Date of Birth: January 15, 1990' -> extract '1990-01-15'\\n \\u2713 Text shows 'DOB: 1-15-90' -> extract '1990-01-15' (assuming older patient)\\n \\u2713 Text shows no date of birth -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract service dates or billing dates as date of birth\\n \\u2717 Do NOT extract dates that are clearly in the future or very recent (those are likely service dates)\"}, \"billing_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date the bill was issued/generated in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Bill Date', 'Billing Date', 'Statement Date', 'Invoice Date', 'Date', 'Bill Date:', 'Statement Date:', 'Date of Bill'\\n\\nLOCATION: Top-right area of the first page, near account number and balance due.; Header area directly in the upper-right corner.; Within the first ~20% of page height and rightmost ~30% of page width.; Look for the date associated with when the bill was generated.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats: MM/DD/YY, M/D/YY, MM/DD/YYYY, M/D/YYYY, 'Mon DD, YYYY' (e.g., Nov 04, 2025), 'DD Mon YYYY'. If the year is two digits (e.g., 25), assume 20YY (e.g., '10/17/25' -> 2025-10-17).\\n\\nEDGE CASES:\\n - Multiple dates on page: 'Bill Date' vs 'Service Date' vs 'Due Date' - choose the billing/statement date.\\n - Two-digit years (10/17/25) - must be expanded to 2025.\\n - Month name formats (Nov 04, 2025) - convert to ISO.\\n - OCR errors that insert extra punctuation or characters - strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'Bill Date: 10/17/25' in the top-right -> extract '2025-10-17'.\\n \\u2713 Document shows 'Statement Date: Nov 4, 2025' in header -> extract '2025-11-04'.\\n \\u2713 Document shows 'Billing Date 09/18/2025' near provider header -> extract '2025-09-18'.\\n\\nAVOID:\\n \\u2717 Do NOT extract service dates or dates of service as the billing date\\n \\u2717 Do NOT extract due dates as the billing date\\n \\u2717 Do NOT extract dates from the service/itemized charges section as the billing date\"}, \"due_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The payment due date in YYYY-MM-DD format (if specified on the bill).\\n\\nCOMMON LABELS: 'Due Date', 'Payment Due Date', 'Please Pay By', 'Pay By', 'Payment Due', 'Due By', 'Due:'\\n\\nLOCATION: Top-right quadrant of the first page, near the balance due amount.; Often appears in or near the 'Amount Due' or 'Balance Due' section.; May be in a payment summary box.; Look for dates labeled as due dates or payment due dates.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats: 'Nov 04, 2025', 'November 4, 2025', '11/04/2025', '11/4/25', '11-04-2025', '11/04/25'. If the year is given as two digits (e.g. '25'), expand to 20YY (->2025). If no due date is specified on the bill, return null.\\n\\nEDGE CASES:\\n - Due date should be after the billing date (typically 15-45 days after).\\n - Two-digit year '25' should be expanded to 2025.\\n - OCR noise: strip non-date tokens before parsing.\\n - Some bills may not specify a due date - return null if not present.\\n\\nEXAMPLES:\\n \\u2713 Text: 'Due Date: Nov 04, 2025' -> Extract: '2025-11-04'\\n \\u2713 Text: 'Payment Due By: 11/04/2025' -> Extract: '2025-11-04'\\n \\u2713 Text: 'Please Pay By: 11/4/25' -> Extract: '2025-11-04'\\n \\u2713 Text shows no due date -> Extract: null\\n\\nAVOID:\\n \\u2717 Text: 'Bill Date: 10/17/25' -> DO NOT extract as due_date (this is billing_date).\\n \\u2717 Do NOT extract service dates as due dates\"}, \"amount_due\": {\"type\": \"number\", \"datapoint_prompt\": \"The total amount due/owed by the patient for this bill.\\n\\nCOMMON LABELS: 'Amount Due', 'Balance Due', 'Total Due', 'Patient Responsibility', 'Amount Owed', 'Balance', 'Total Amount Due', 'Due'\\n\\nLOCATION: Top-right quadrant of the first page, near the billing date and account number.; Often appears prominently in a 'Amount Due' or 'Balance Due' section.; May be in a payment summary box.; Look for the total amount the patient owes.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$150.00' -> 150.00, '$1,234.56' -> 1234.56). If OCR produces '150' normalize to two decimals '150.00'. If the extracted value is missing or illegible, return null.\\n\\nEDGE CASES:\\n - Amount due should be a positive number (patient owes money).\\n - Some bills may show $0.00 if fully paid or covered by insurance - extract 0.00.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n - If multiple amounts appear, prefer the one labeled 'Amount Due' or 'Balance Due' over subtotals or line item amounts.\\n\\nEXAMPLES:\\n \\u2713 'Amount Due: $150.00' -> 150.00\\n \\u2713 'Balance Due: $1,234.56' -> 1234.56\\n \\u2713 'Total Due: $0.00' -> 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract subtotals or line item amounts as the amount due\\n \\u2717 Do NOT extract insurance payment amounts as the amount due\\n \\u2717 Do NOT extract total charges (before insurance) as the amount due\"}, \"insurance_name\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The name of the insurance company or health plan (if insurance information is present on the bill).\\n\\nCOMMON LABELS: 'Insurance', 'Insurance Company', 'Carrier', 'Health Plan', 'Insurance Plan', 'Insurance:', 'Carrier:', 'Plan Name'\\n\\nLOCATION: Typically in an insurance information section, often in the middle or lower portion of the first page.; May appear near other insurance details like policy numbers.; Look for insurance company names in the insurance/billing section.\\n\\nFORMAT: Return the insurance company name exactly as it appears on the document. Common formats: 'Blue Cross Blue Shield', 'Aetna', 'UnitedHealthcare', 'Cigna', 'Medicare', 'Medicaid'. Preserve capitalization and exact wording. If no insurance information is present on the bill, return null.\\n\\nEDGE CASES:\\n - Insurance names may be abbreviated (e.g., 'BCBS' for Blue Cross Blue Shield) - preserve as shown.\\n - Some bills show multiple insurance companies (primary and secondary) - extract the primary insurance name if multiple exist.\\n - If the bill shows 'Self Pay' or 'No Insurance', return null.\\n - Insurance names may appear with plan names (e.g., 'Aetna HMO') - include the plan type if it's part of the name.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Insurance: Blue Cross Blue Shield' -> extract 'Blue Cross Blue Shield'\\n \\u2713 Text shows 'Carrier: Aetna HMO' -> extract 'Aetna HMO'\\n \\u2713 Text shows 'Insurance Company: UnitedHealthcare' -> extract 'UnitedHealthcare'\\n \\u2713 Text shows 'Self Pay' or no insurance information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract provider names as insurance names\\n \\u2717 Do NOT extract plan types alone (e.g., 'HMO', 'PPO') without the insurance company name\\n \\u2717 Do NOT extract policy numbers or group numbers as insurance names\"}, \"insurance_policy_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The insurance policy number or member ID (if insurance information is present on the bill).\\n\\nCOMMON LABELS: 'Policy Number', 'Policy No.', 'Policy #', 'Member ID', 'Member Number', 'Subscriber ID', 'Insurance ID', 'Policy:', 'Member ID:'\\n\\nLOCATION: Typically in an insurance information section, often near the insurance company name.; May appear with other insurance details like group numbers.; Look for policy/member ID numbers in the insurance/billing section.\\n\\nFORMAT: Return the policy number exactly as it appears on the document. Policy numbers may be numeric, alphanumeric, or include dashes. Preserve any formatting, dashes, or spacing as shown. If no insurance information is present, return null.\\n\\nEDGE CASES:\\n - Policy numbers vary by insurance company - preserve the exact format.\\n - Policy numbers may include dashes or spaces (e.g., 'ABC123456789', 'ABC-123-456-789') - preserve as shown.\\n - Some bills show member IDs instead of policy numbers - extract as shown.\\n - If the bill shows 'Self Pay' or no insurance, return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Policy Number: ABC123456789' -> extract 'ABC123456789'\\n \\u2713 Text shows 'Member ID: 123-456-789' -> extract '123-456-789'\\n \\u2713 Text shows 'Policy #: ABC-123-456-789' -> extract 'ABC-123-456-789'\\n \\u2713 Text shows no insurance information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract account numbers as policy numbers\\n \\u2717 Do NOT extract group numbers as policy numbers\\n \\u2717 Do NOT extract claim numbers as policy numbers\"}, \"service_date_from\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The earliest service date (date of service start) if services span multiple dates, or the service date if there's a single date, in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Service Date', 'Date of Service', 'DOS', 'Service Dates', 'From', 'Service From', 'Date From'\\n\\nLOCATION: Typically in the service/itemized charges section or in a service period field.; May appear near the service descriptions or in a date range.; Look for dates associated with when medical services were provided.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If services span a date range, extract the start/from date. If there's a single service date, extract that. If service dates are not shown or are embedded only in line items, return null.\\n\\nEDGE CASES:\\n - Service dates should be before or equal to the billing date.\\n - If services span multiple dates, extract the earliest date.\\n - If only individual service dates appear in line items (no overall service period), return null and let line items contain the dates.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Service Date: 09/15/2025' -> extract '2025-09-15'\\n \\u2713 Text shows 'Service Dates: 09/15/2025 - 09/20/2025' -> extract '2025-09-15'\\n \\u2713 Text shows 'Date of Service: September 15, 2025' -> extract '2025-09-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract billing dates as service dates\\n \\u2717 Do NOT extract due dates as service dates\"}, \"service_date_to\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The latest service date (date of service end) if services span a date range, in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Service Date', 'Date of Service', 'Service Dates', 'To', 'Service To', 'Date To'\\n\\nLOCATION: Typically in the service/itemized charges section or in a service period field.; May appear near the service descriptions or in a date range.; Look for the end date in a date range for services.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). If services span a date range, extract the end/to date. If there's only a single service date (no range), return null. If service dates are not shown as a range, return null.\\n\\nEDGE CASES:\\n - Service end date should be after or equal to the service start date.\\n - If there's only a single service date (no range), return null.\\n - If only individual service dates appear in line items (no overall service period), return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Service Dates: 09/15/2025 - 09/20/2025' -> extract '2025-09-20'\\n \\u2713 Text shows 'Service Date: 09/15/2025' (single date, no range) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract billing dates as service dates\\n \\u2717 Do NOT extract due dates as service dates\"}, \"line_items\": {\"type\": \"array\", \"datapoint_prompt\": \"All individual charges, procedures, services, and items listed on the medical bill. Extract ALL line items in the order they appear.\\n\\nLOCATION STRATEGY:\\n- PRIMARY: Main charges/procedures table, typically the largest section on the bill\\n- Common labels: 'Charges', 'Services', 'Itemized Charges', 'Procedure Details', 'Service Details', 'Charges Detail'\\n- Usually appears: Middle to lower portion of the bill pages\\n- Format: Table with columns for Date, Description/Procedure, Code (CPT/ICD), Amount, etc.\\n\\nEXTRACTION RULES:\\n- Extract ALL line items - do not skip any charges\\n- Preserve chronological order (as they appear on the bill)\\n- Include ALL service types: procedures, lab tests, medications, supplies, room charges, etc.\\n- For each line item, extract: date (if shown), description, amount, and optionally codes\\n- Amount format: Use the charge amount (before insurance adjustments)\\n\\nCOMMON LINE ITEM TYPES:\\n- Procedures: Office visits, surgeries, treatments\\n- Lab Tests: Blood tests, urine tests, imaging studies\\n- Medications: Prescription drugs, IV medications\\n- Supplies: Medical supplies, equipment\\n- Room Charges: Hospital room, facility fees\\n- Other: Professional fees, administrative charges\\n\\nFORMAT: Return an array of line item objects in the order they appear on the bill. Each item should include:\\n- date: Service date in YYYY-MM-DD format (if shown per item)\\n- description: Full service/procedure description as it appears\\n- amount: Numeric charge amount (before insurance)\\n- code: Optional procedure code (CPT) or diagnosis code (ICD) if shown\\n- insurance_adjustment: Optional insurance adjustment/discount amount if shown separately\\n- patient_responsibility: Optional patient responsibility amount if shown separately\\n\\nEDGE CASES:\\n- Multiple services on the same date: Include all of them, preserve order\\n- Codes may be CPT (procedure codes) or ICD (diagnosis codes) - extract as shown\\n- Some bills show charges, adjustments, and patient responsibility separately - include all if shown\\n- Descriptions may be abbreviated or use medical terminology - extract as shown\\n- If amounts appear in multiple columns (charge, adjustment, patient responsibility), extract all relevant amounts\\n\\nEXAMPLES:\\n \\u2713 {date: '2025-09-15', description: 'Office Visit - Established Patient', amount: 150.00, code: '99213'}\\n \\u2713 {date: '2025-09-15', description: 'CBC (Complete Blood Count)', amount: 75.50, code: '85025'}\\n \\u2713 {date: '2025-09-16', description: 'X-Ray - Chest 2 Views', amount: 200.00, code: '71020'}\\n\\nAVOID:\\n \\u2717 Do NOT skip line items even if they seem minor\\n \\u2717 Do NOT extract summary totals as individual line items\\n \\u2717 Do NOT extract insurance payment information as line items\\n \\u2717 Do NOT reorder items - preserve the order as shown on the bill\", \"items\": {\"type\": \"object\", \"properties\": {\"date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"Service date for this line item in YYYY-MM-DD format (if shown per item).\"}, \"description\": {\"type\": \"string\", \"datapoint_prompt\": \"Service/procedure description EXACTLY as it appears on the bill. Include all details: procedure names, test names, medication names, etc. Preserve the exact text as shown.\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Charge amount for this line item as a numeric value. Format: numeric decimal with two decimal places (e.g., 150.00, 75.50). This is typically the amount charged before insurance adjustments.\"}, \"code\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"Procedure code (CPT) or diagnosis code (ICD) if shown for this line item. Preserve the exact code format as shown (e.g., '99213', '85025', 'E11.9').\"}, \"insurance_adjustment\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Insurance adjustment, discount, or negotiated rate reduction amount if shown separately for this line item. Format: numeric decimal with two decimal places. Return null if not shown separately.\"}, \"patient_responsibility\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Patient responsibility amount (copay, deductible, coinsurance) if shown separately for this line item. Format: numeric decimal with two decimal places. Return null if not shown separately.\"}}, \"required\": [\"description\", \"amount\"]}}, \"total_charges\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total charges AFTER discounts and insurance adjustments are applied (the net amount after discounts/adjustments). This is the final total that accounts for any hospital discounts, insurance adjustments, or other reductions.\\n\\nCOMMON LABELS: 'Total Charges', 'Actual Discounted Charges', 'Net Charges', 'Charges After Discount', 'Total After Discount', 'Adjusted Total'\\n\\nLOCATION: Typically at the bottom of the charges/itemized section or in a summary area.; Often appears after discount and insurance adjustment sections.; Look for the final total that includes discounts/adjustments applied.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If this amount is not shown separately, calculate it by:\\n - Starting with the sum of all service/charge line items (e.g., 'ROOM & BOARD', 'PHARMACY', 'LABORATORY')\\n - SUBTRACTING discount line items (e.g., 'Hospital Discount to Patient' with negative amounts)\\n - SUBTRACTING insurance adjustment amounts if shown separately\\n - Result = Net charges after discounts/insurance adjustments\\n\\nCALCULATION RULE:\\n - If a labeled 'Total Charges' or 'Actual Discounted Charges' appears, use that value (this is the net amount after discounts).\\n - If no labeled total exists, calculate: Sum of service line items + Discount amounts (which are negative) = Net total\\n - Example: Service charges $292,643.73 + Hospital Discount -$171,196.61 = $121,447.12 total_charges\\n - EXCLUDE line items like: 'Insurance Payments Received', 'Patient Payments Received' (these are payments, not charges)\\n\\nEDGE CASES:\\n - Total charges should reflect the NET amount after discounts/adjustments are applied.\\n - Some bills show 'Pre-discount Charges' and 'Actual Discounted Charges' separately - use the 'Actual Discounted Charges' value.\\n - Discounts are typically negative amounts in line items - add them to get the net total (e.g., charges + (-discount) = net charges).\\n - If no discounts or adjustments are present, total_charges equals the sum of service line items.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Actual Discounted Charges: $121,447.12' -> extract 121447.12\\n \\u2713 Service charges sum to $292,643.73, 'Hospital Discount to Patient' is -$171,196.61 -> calculate and extract 121447.12 (292643.73 - 171196.61)\\n \\u2713 Text shows 'Total Charges: $1,500.00' with no discounts shown -> extract 1500.00\\n \\u2713 Text shows no separate total charges field and line items are unclear -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract pre-discount charges as total_charges (look for 'Actual Discounted Charges' or calculate net amount)\\n \\u2717 Do NOT extract the amount due as total charges (amount due may include other adjustments)\\n \\u2717 Do NOT extract insurance payment amounts as total charges\"}, \"insurance_payments\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total amount paid or covered by insurance (if shown on the bill).\\n\\nCOMMON LABELS: 'Insurance Payment', 'Insurance Paid', 'Paid by Insurance', 'Insurance Coverage', 'Insurance Adjustment', 'Insurance'\\n\\nLOCATION: Typically in a payment/adjustment summary section, often near the amount due.; May appear after the total charges and before the amount due.; Look for insurance payment or coverage amounts.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If insurance payments are not shown on the bill, return null.\\n\\nEDGE CASES:\\n - Insurance payments may be shown as a total or broken down by line item - extract the total if shown.\\n - Some bills show $0.00 if no insurance or if insurance didn't pay - extract 0.00 in that case.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Insurance Payment: $1,200.00' -> extract 1200.00\\n \\u2713 Text shows 'Paid by Insurance: $500.00' -> extract 500.00\\n \\u2713 Text shows 'Insurance: $0.00' -> extract 0.00\\n \\u2713 Text shows no insurance payment information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract insurance adjustments (discounts) as insurance payments\\n \\u2717 Do NOT extract the amount due as insurance payments\"}}, \"required\": [\"provider_name\", \"patient_name\", \"patient_account_number\", \"billing_date\", \"amount_due\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"service_date_from\", \"end_field\": \"billing_date\", \"max_days\": 365, \"message\": \"Service dates should be within 365 days of billing date\"}, {\"type\": \"date_comparison\", \"field1\": \"billing_date\", \"field2\": \"due_date\", \"comparison\": \"before_or_equal\", \"message\": \"Billing date should be before or equal to due date (if due date is specified)\"}]}}", "true_json_output": "{\"provider_name\": \"CEDARS SINAI\", \"patient_name\": null, \"patient_account_number\": null, \"patient_date_of_birth\": null, \"billing_date\": null, \"due_date\": null, \"amount_due\": null, \"insurance_name\": \"UNITED HEALTHCARE\", \"insurance_policy_number\": null, \"service_date_from\": \"2013-11-25\", \"service_date_to\": null, \"line_items\": [{\"date\": \"2013-11-25\", \"description\": \"ROOM & BOARD - SEMI-PRIVATE T\", \"amount\": 72624.0, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"PHARMACY - GENERAL CLASSIFICA\", \"amount\": 11152.32, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"MEDICAL/SURGICAL SUPPLIES AND\", \"amount\": 11115.53, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"LABORATORY - GENERAL CLASSIFI\", \"amount\": 5358.41, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"RADIOLOGY - DIAGNOSTIC - GENE\", \"amount\": 8294.16, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"CT SCAN - GENERAL CLASSIFICAT\", \"amount\": 14481.65, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"OPERATING ROOM SERVICES - GEN\", \"amount\": 65333.5, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"ANESTHESIA - GENERAL CLASSIFI\", \"amount\": 31049.61, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"PHYSICAL THERAPY - GENERAL CL\", \"amount\": 1139.25, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"OCCUPATIONAL THERAPY - GENERA\", \"amount\": 762.9, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"MAGNETIC RESONANCE TECHNOLOGY\", \"amount\": 36089.15, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"RECOVERY ROOM - GENERAL CLASS\", \"amount\": 19604.18, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"EKG/ECG (ELECTROCARDIOGRAM)-\", \"amount\": 816.29, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"OTHER DIAGNOSTIC SERVICES - G\", \"amount\": 14822.78, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"Hospital Discount to Patient\", \"amount\": -171196.61, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"Insurance Payments Received\", \"amount\": 0.0, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"Patient Payments Received\", \"amount\": 0.0, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}, {\"date\": \"2013-11-25\", \"description\": \"Actual Discounted Charges Pending with Insurance\", \"amount\": 121447.12, \"code\": null, \"insurance_adjustment\": null, \"patient_responsibility\": null}], \"total_charges\": 121447.12, \"insurance_payments\": 0.0, \"source_filename\": \"medical_bill_2.pdf\"}", "true_markdown_output": "**Provider Name:** CEDARS SINAI\n**Patient Name:** N/A\n**Patient Account Number:** N/A\n**Patient Date Of Birth:** N/A\n**Billing Date:** N/A\n**Due Date:** N/A\n**Amount Due:** N/A\n**Insurance Name:** UNITED HEALTHCARE\n**Insurance Policy Number:** N/A\n**Service Date From:** 2013-11-25\n**Service Date To:** N/A\n**Line Items:**\n **Date:** 2013-11-25\n **Description:** ROOM & BOARD - SEMI-PRIVATE T\n **Amount:** 72624.0\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** PHARMACY - GENERAL CLASSIFICA\n **Amount:** 11152.32\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** MEDICAL/SURGICAL SUPPLIES AND\n **Amount:** 11115.53\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** LABORATORY - GENERAL CLASSIFI\n **Amount:** 5358.41\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** RADIOLOGY - DIAGNOSTIC - GENE\n **Amount:** 8294.16\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** CT SCAN - GENERAL CLASSIFICAT\n **Amount:** 14481.65\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** OPERATING ROOM SERVICES - GEN\n **Amount:** 65333.5\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** ANESTHESIA - GENERAL CLASSIFI\n **Amount:** 31049.61\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** PHYSICAL THERAPY - GENERAL CL\n **Amount:** 1139.25\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** OCCUPATIONAL THERAPY - GENERA\n **Amount:** 762.9\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** MAGNETIC RESONANCE TECHNOLOGY\n **Amount:** 36089.15\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** RECOVERY ROOM - GENERAL CLASS\n **Amount:** 19604.18\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** EKG/ECG (ELECTROCARDIOGRAM)-\n **Amount:** 816.29\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** OTHER DIAGNOSTIC SERVICES - G\n **Amount:** 14822.78\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** Hospital Discount to Patient\n **Amount:** -171196.61\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** Insurance Payments Received\n **Amount:** 0.0\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** Patient Payments Received\n **Amount:** 0.0\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n **Date:** 2013-11-25\n **Description:** Actual Discounted Charges Pending with Insurance\n **Amount:** 121447.12\n **Code:** N/A\n **Insurance Adjustment:** N/A\n **Patient Responsibility:** N/A\n**Total Charges:** 121447.12\n**Insurance Payments:** 0.0"} {"file_name": "images/offer_letter.png", "id": 11, "metadata": "{\"format\": \"OFFER_LETTER\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"offer_letter.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"company_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the company making the job offer.\\n\\nCOMMON LABELS: Company name typically appears in the letterhead, header, or at the beginning of the offer letter.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the letterhead or header area.; Within the first 10-20% of page height, centered or left-aligned.; May appear with the company logo.; Often appears in the letterhead or at the beginning of the letter.\\n\\nFORMAT: Return the company name as it appears on the document. Common formats: 'ABC Corporation', 'XYZ Industries Inc.', 'ABC Company'. Preserve capitalization and abbreviations. Prefer the brand/company name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'ABC Corporation, Inc.' and 'ABC Corporation'), prefer the more complete version if clear.\\n - Company names may include legal designations - preserve as shown.\\n - If the company name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'ABC CORPORATION' in letterhead -> extract 'ABC CORPORATION' or 'ABC Corporation'\\n \\u2713 Document shows 'XYZ Industries Inc.' in header -> extract 'XYZ Industries Inc.'\\n \\u2713 Document shows 'ABC COMPANY' -> extract 'ABC COMPANY' or 'ABC Company'\\n\\nAVOID:\\n \\u2717 Do NOT extract department names or division names as the company name\\n \\u2717 Do NOT extract recruiter names or hiring manager names as the company name\"}, \"candidate_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the candidate/recipient who is receiving the job offer.\\n\\nCRITICAL - EXTRACTION PRIORITY:\\n1. PRIMARY LOCATION: Extract from the 'Dear [Name]' salutation line at the beginning of the letter (this is the MOST RELIABLE source).\\n2. SECONDARY: If full name appears in the recipient address block (e.g., 'To: John Doe' or address line), use that if the 'Dear' line only has partial name.\\n3. TERTIARY: If name appears in 'To:' field in formal header, extract from there.\\n\\nCOMMON LABELS: Candidate name typically appears in the 'Dear [Name]' salutation or greeting of the letter (e.g., 'Dear John Doe', 'Dear Mr. Doe', 'Dear Craig Enders').\\n\\nLOCATION: PRIMARY: The 'Dear [Name]' salutation line near the beginning of the letter, typically in the first paragraph after the letterhead/date.; SECONDARY: Recipient address block or 'To:' field if present.; Look for names starting with 'Dear' followed by the name.\\n\\nFORMAT: Return the candidate name exactly as it appears in the 'Dear' line. Common formats:\\n - Full name: 'Dear John Doe,' -> extract 'John Doe'\\n - With title: 'Dear Mr. John Doe,' -> extract 'Mr. John Doe' or 'John Doe'\\n - Full name in Dear, different spelling in address: Prefer the name from the 'Dear' line (e.g., 'Dear Craig Enders,' -> extract 'Craig Enders' even if address shows 'Craig Endert')\\nPreserve capitalization and formatting as it appears in the 'Dear' line. If the 'Dear' line has a full name, use that; if it only has title+last name, check address block for full name.\\n\\nEDGE CASES:\\n - Names in 'Dear [Name]' line: Extract the name portion after 'Dear' and before the comma (e.g., 'Dear Craig Enders,' -> extract 'Craig Enders').\\n - If 'Dear' line shows full name but address block shows different spelling/variant: Prefer the 'Dear' line version (it's the primary source for recipient name).\\n - If only title and last name appear in 'Dear' line (e.g., 'Dear Mr. Doe'), extract as shown or look for full name in address block.\\n - Some letters may use first name only in 'Dear' line - extract as shown if that's all that's available, but prefer full name from address if available.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Dear Craig Enders,' -> extract 'Craig Enders' (from Dear line)\\n \\u2713 Text shows 'Dear John Doe,' -> extract 'John Doe'\\n \\u2713 Text shows 'Dear Mr. John Doe,' -> extract 'Mr. John Doe' or 'John Doe'\\n \\u2713 Text shows 'Dear Ms. Smith,' in salutation and 'Jane Smith' in address -> extract 'Jane Smith' (full name from address preferred over title+last name)\\n\\nAVOID:\\n \\u2717 Do NOT extract hiring manager names or recruiter names as the candidate name\\n \\u2717 Do NOT extract company names as the candidate name\\n \\u2717 Do NOT skip the name if it appears in the 'Dear' line - this is the PRIMARY source\"}, \"position_title\": {\"type\": \"string\", \"datapoint_prompt\": \"The job title or position being offered.\\n\\nCOMMON LABELS: 'Position', 'Job Title', 'Title', 'Role', 'Position Title', 'Job Offer', 'We are pleased to offer you the position of', 'We would like to offer you the position'\\n\\nLOCATION: Typically in the body of the letter, often in the first or second paragraph.; May appear near the beginning after the greeting.; Often appears in phrases like 'We are pleased to offer you the position of [Title]' or 'You have been selected for the position of [Title]'.; Look for job titles in the main body of the letter.\\n\\nFORMAT: Return the position title exactly as it appears on the document. Common formats: 'Software Engineer', 'Senior Manager', 'Sales Representative', 'Product Manager'. Preserve capitalization and exact wording. Include any level indicators (Junior, Senior, Lead, etc.) if present.\\n\\nEDGE CASES:\\n - Position titles may include level indicators (e.g., 'Senior Software Engineer', 'Junior Developer') - include them.\\n - Position titles may include department or team information (e.g., 'Software Engineer - Backend Team') - include as shown.\\n - Some letters may list multiple positions or alternatives - extract the primary position being offered.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'We are pleased to offer you the position of Software Engineer' -> extract 'Software Engineer'\\n \\u2713 Text shows 'Position: Senior Product Manager' -> extract 'Senior Product Manager'\\n \\u2713 Text shows 'You have been selected for the role of Sales Representative' -> extract 'Sales Representative'\\n\\nAVOID:\\n \\u2717 Do NOT extract department names alone as position titles (e.g., 'Engineering' when the title is 'Software Engineer')\\n \\u2717 Do NOT extract location information as part of the position title\\n \\u2717 Do NOT extract compensation information as part of the position title\"}, \"start_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The proposed start date or employment start date in YYYY-MM-DD format (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Start Date', 'Employment Start Date', 'Your start date will be', 'You will begin employment on', 'Expected Start Date', 'Proposed Start Date', 'Start Date:', 'Employment begins'\\n\\nLOCATION: Typically in the body of the letter, often in a paragraph discussing employment terms or in a dedicated terms section.; May appear near compensation or other employment details.; Look for start dates in the main body or terms section.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2025' -> '2025-01-15')\\n - M/D/YYYY (e.g., '1/15/2025' -> '2025-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2025' -> '2025-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2025' -> '2025-01-15')\\nIf year is two digits, expand appropriately. If start date is not specified, return null.\\n\\nEDGE CASES:\\n - Start dates may be approximate (e.g., 'on or about January 15, 2025') - extract the date portion.\\n - Some letters specify a start date range or say 'TBD' (to be determined) - return null if no specific date is given.\\n - Start dates are typically in the future relative to the offer date.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Your start date will be January 15, 2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'Start Date: 01/15/2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'You will begin employment on or about January 15, 2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'Start Date: TBD' or no start date specified -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract offer letter dates as start dates\\n \\u2717 Do NOT extract interview dates or other dates as start dates\"}, \"salary_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The annual salary amount being offered (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Salary', 'Annual Salary', 'Base Salary', 'Starting Salary', 'Compensation', 'Your salary will be', 'We are offering a salary of'\\n\\nLOCATION: Typically in the body of the letter, often in a compensation or terms section.; May appear near other compensation details like benefits.; Look for salary amounts in compensation-related paragraphs.\\n\\nFORMAT: Return a numeric value with two decimal places, no currency symbol and no thousands separators (e.g., '$75,000' -> 75000.00, '$100,000.00' -> 100000.00). Handle annual salary amounts. If salary is not specified, return null.\\n\\nEDGE CASES:\\n - Salary amounts are typically annual - extract the annual amount.\\n - Some letters may show salary in different formats (e.g., '$75K', '$75,000 per year') - convert to numeric.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n - If salary is mentioned but not as a specific number (e.g., 'competitive salary'), return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Annual Salary: $75,000' -> extract 75000.00\\n \\u2713 Text shows 'Your salary will be $100,000 per year' -> extract 100000.00\\n \\u2713 Text shows 'Base Salary: $75K' -> extract 75000.00\\n \\u2713 Text shows 'Competitive salary' (no amount) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract hourly rates as annual salary (unless clearly stated as annual equivalent)\\n \\u2717 Do NOT extract bonus amounts as salary amounts\\n \\u2717 Do NOT extract total compensation (including bonuses/equity) as salary amount unless specifically labeled as salary\"}, \"salary_frequency\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The frequency of salary payments (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Paid', 'Pay Frequency', 'Payment Schedule', 'Salary will be paid', 'You will be paid'\\n\\nLOCATION: Typically near the salary amount in the compensation section.; May appear in the same paragraph as salary information.; Look for payment frequency information near salary details.\\n\\nFORMAT: Return the frequency as it appears or in a normalized form. Common values: 'Annual', 'Monthly', 'Bi-weekly', 'Biweekly', 'Weekly', 'Semi-monthly', 'Semimonthly'. Preserve as shown or normalize to common formats. If payment frequency is not specified, return null.\\n\\nEDGE CASES:\\n - Payment frequencies may be stated explicitly (e.g., 'paid monthly', 'paid bi-weekly') or implied by salary format.\\n - Some letters don't specify payment frequency - return null if not mentioned.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'paid monthly' -> extract 'Monthly'\\n \\u2713 Text shows 'bi-weekly payments' -> extract 'Bi-weekly' or 'Biweekly'\\n \\u2713 Text shows 'salary will be paid annually' -> extract 'Annual'\\n\\nAVOID:\\n \\u2717 Do NOT assume payment frequency if not stated\\n \\u2717 Do NOT extract salary amounts as payment frequency\"}, \"offer_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date the offer letter was written or dated (if shown on the letter).\\n\\nCOMMON LABELS: 'Date', 'Dated', 'Date:', 'Letter Date', 'Offer Date'\\n\\nLOCATION: Typically in the letterhead or at the top of the letter, often near the company name or address.; May appear at the beginning of the letter before the greeting.; Often appears in the letterhead area.; Look for dates in the header or letterhead area.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If offer date is not shown, return null.\\n\\nEDGE CASES:\\n - Offer dates are typically the date the letter was written.\\n - Some letters may not show a date - return null if not present.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Date: January 10, 2025' -> extract '2025-01-10'\\n \\u2713 Text shows 'Dated: 01/10/2025' -> extract '2025-01-10'\\n\\nAVOID:\\n \\u2717 Do NOT extract start dates as offer dates\\n \\u2717 Do NOT extract response deadline dates as offer dates\"}, \"response_deadline\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The deadline by which the candidate must respond to the offer (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Response Deadline', 'Please respond by', 'We need your response by', 'Deadline', 'Please let us know by', 'We look forward to hearing from you by'\\n\\nLOCATION: Typically near the end of the letter, often in the closing paragraphs.; May appear in a dedicated section about next steps.; Look for response deadlines in the closing or next steps section.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If response deadline is not specified, return null.\\n\\nEDGE CASES:\\n - Response deadlines are typically a few days to a couple of weeks after the offer date.\\n - Some letters don't specify a deadline - return null if not mentioned.\\n - Deadlines may be stated as 'within X days' rather than a specific date - return null if no specific date is given.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Please respond by January 20, 2025' -> extract '2025-01-20'\\n \\u2713 Text shows 'We need your response by 01/20/2025' -> extract '2025-01-20'\\n \\u2713 Text shows 'Please respond within 7 days' (no specific date) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract start dates as response deadlines\\n \\u2717 Do NOT extract offer dates as response deadlines\"}, \"work_location\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The work location, office location, or work arrangement (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Location', 'Work Location', 'Office Location', 'Position Location', 'Work Arrangement', 'Remote', 'Hybrid', 'In-Office', 'You will work'\\n\\nLOCATION: Typically in the body of the letter, often near position details or employment terms.; May appear in a dedicated location or work arrangement section.; Look for location information in the main body or terms section.\\n\\nFORMAT: Return the work location as it appears on the document. Common formats:\\n - City, State: 'San Francisco, CA'\\n - Full address: '123 Main St, San Francisco, CA 94102'\\n - Work arrangement: 'Remote', 'Hybrid', 'In-Office'\\n - Combination: 'Remote (San Francisco, CA)'\\nPreserve the format as shown. If work location is not specified, return null.\\n\\nEDGE CASES:\\n - Work locations may be physical addresses, cities, or work arrangements (remote/hybrid).\\n - Some letters specify multiple locations or 'various locations' - extract as shown.\\n - Work arrangements (remote, hybrid) may be combined with location information.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Location: San Francisco, CA' -> extract 'San Francisco, CA'\\n \\u2713 Text shows 'Work Location: 123 Main St, San Francisco, CA 94102' -> extract '123 Main St, San Francisco, CA 94102'\\n \\u2713 Text shows 'This is a remote position' -> extract 'Remote'\\n \\u2713 Text shows 'Hybrid work arrangement (San Francisco, CA)' -> extract 'Hybrid work arrangement (San Francisco, CA)'\\n\\nAVOID:\\n \\u2717 Do NOT extract company headquarters address as work location unless specifically stated as the work location\\n \\u2717 Do NOT extract mailing addresses as work locations\"}, \"hiring_manager_name\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The name of the hiring manager or person signing the offer letter (if shown).\\n\\nCOMMON LABELS: Name typically appears in the signature area at the end of the letter.\\n\\nLOCATION: Typically at the end of the letter in the signature area.; Often appears above or below the signature line.; May appear with a title (e.g., 'Hiring Manager', 'VP of Engineering').; Look for names in the signature/closing area.\\n\\nFORMAT: Return the name exactly as it appears. Common formats: 'John Doe', 'John M. Doe'. Preserve capitalization and formatting. If hiring manager name is not shown, return null.\\n\\nEDGE CASES:\\n - Names may appear with titles - you may include the title if it's part of how the name is presented.\\n - Some letters may have printed names in the signature area - extract from there.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'John Doe' in signature area -> extract 'John Doe'\\n \\u2713 Text shows 'John Doe, Hiring Manager' -> extract 'John Doe' or 'John Doe, Hiring Manager'\\n\\nAVOID:\\n \\u2717 Do NOT extract candidate names as hiring manager names\\n \\u2717 Do NOT extract company names as hiring manager names\"}}, \"required\": [\"company_name\", \"candidate_name\", \"position_title\"], \"validation\": {\"cross_field\": [{\"type\": \"date_comparison\", \"field1\": \"offer_date\", \"field2\": \"start_date\", \"comparison\": \"before_or_equal\", \"message\": \"Offer date should be before or equal to start date (offers are made before employment begins)\"}, {\"type\": \"date_comparison\", \"field1\": \"offer_date\", \"field2\": \"response_deadline\", \"comparison\": \"before_or_equal\", \"message\": \"Offer date should be before or equal to response deadline (deadlines are set after the offer is made)\"}]}}", "true_json_output": "{\"company_name\": \"SBC Systems\", \"candidate_name\": null, \"position_title\": \"Financial Analyst\", \"start_date\": \"2012-05-06\", \"salary_amount\": 50000.0, \"salary_frequency\": null, \"offer_date\": \"2013-04-23\", \"response_deadline\": null, \"work_location\": null, \"hiring_manager_name\": \"Andrew Melvin\", \"source_filename\": \"offer_letter.pdf\"}", "true_markdown_output": "**Company Name:** SBC Systems\n**Candidate Name:** N/A\n**Position Title:** Financial Analyst\n**Start Date:** 2012-05-06\n**Salary Amount:** 50000.0\n**Salary Frequency:** N/A\n**Offer Date:** 2013-04-23\n**Response Deadline:** N/A\n**Work Location:** N/A\n**Hiring Manager Name:** Andrew Melvin"} {"file_name": "images/offer_letter_2_1.png", "id": 12, "metadata": "{\"format\": \"OFFER_LETTER\", \"documentQuality\": \"PHOTO\", \"source_filename\": \"offer_letter_2_1.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"company_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the company making the job offer.\\n\\nCOMMON LABELS: Company name typically appears in the letterhead, header, or at the beginning of the offer letter.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the letterhead or header area.; Within the first 10-20% of page height, centered or left-aligned.; May appear with the company logo.; Often appears in the letterhead or at the beginning of the letter.\\n\\nFORMAT: Return the company name as it appears on the document. Common formats: 'ABC Corporation', 'XYZ Industries Inc.', 'ABC Company'. Preserve capitalization and abbreviations. Prefer the brand/company name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'ABC Corporation, Inc.' and 'ABC Corporation'), prefer the more complete version if clear.\\n - Company names may include legal designations - preserve as shown.\\n - If the company name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'ABC CORPORATION' in letterhead -> extract 'ABC CORPORATION' or 'ABC Corporation'\\n \\u2713 Document shows 'XYZ Industries Inc.' in header -> extract 'XYZ Industries Inc.'\\n \\u2713 Document shows 'ABC COMPANY' -> extract 'ABC COMPANY' or 'ABC Company'\\n\\nAVOID:\\n \\u2717 Do NOT extract department names or division names as the company name\\n \\u2717 Do NOT extract recruiter names or hiring manager names as the company name\"}, \"candidate_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the candidate/recipient who is receiving the job offer.\\n\\nCRITICAL - EXTRACTION PRIORITY:\\n1. PRIMARY LOCATION: Extract from the 'Dear [Name]' salutation line at the beginning of the letter (this is the MOST RELIABLE source).\\n2. SECONDARY: If full name appears in the recipient address block (e.g., 'To: John Doe' or address line), use that if the 'Dear' line only has partial name.\\n3. TERTIARY: If name appears in 'To:' field in formal header, extract from there.\\n\\nCOMMON LABELS: Candidate name typically appears in the 'Dear [Name]' salutation or greeting of the letter (e.g., 'Dear John Doe', 'Dear Mr. Doe', 'Dear Craig Enders').\\n\\nLOCATION: PRIMARY: The 'Dear [Name]' salutation line near the beginning of the letter, typically in the first paragraph after the letterhead/date.; SECONDARY: Recipient address block or 'To:' field if present.; Look for names starting with 'Dear' followed by the name.\\n\\nFORMAT: Return the candidate name exactly as it appears in the 'Dear' line. Common formats:\\n - Full name: 'Dear John Doe,' -> extract 'John Doe'\\n - With title: 'Dear Mr. John Doe,' -> extract 'Mr. John Doe' or 'John Doe'\\n - Full name in Dear, different spelling in address: Prefer the name from the 'Dear' line (e.g., 'Dear Craig Enders,' -> extract 'Craig Enders' even if address shows 'Craig Endert')\\nPreserve capitalization and formatting as it appears in the 'Dear' line. If the 'Dear' line has a full name, use that; if it only has title+last name, check address block for full name.\\n\\nEDGE CASES:\\n - Names in 'Dear [Name]' line: Extract the name portion after 'Dear' and before the comma (e.g., 'Dear Craig Enders,' -> extract 'Craig Enders').\\n - If 'Dear' line shows full name but address block shows different spelling/variant: Prefer the 'Dear' line version (it's the primary source for recipient name).\\n - If only title and last name appear in 'Dear' line (e.g., 'Dear Mr. Doe'), extract as shown or look for full name in address block.\\n - Some letters may use first name only in 'Dear' line - extract as shown if that's all that's available, but prefer full name from address if available.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Dear Craig Enders,' -> extract 'Craig Enders' (from Dear line)\\n \\u2713 Text shows 'Dear John Doe,' -> extract 'John Doe'\\n \\u2713 Text shows 'Dear Mr. John Doe,' -> extract 'Mr. John Doe' or 'John Doe'\\n \\u2713 Text shows 'Dear Ms. Smith,' in salutation and 'Jane Smith' in address -> extract 'Jane Smith' (full name from address preferred over title+last name)\\n\\nAVOID:\\n \\u2717 Do NOT extract hiring manager names or recruiter names as the candidate name\\n \\u2717 Do NOT extract company names as the candidate name\\n \\u2717 Do NOT skip the name if it appears in the 'Dear' line - this is the PRIMARY source\"}, \"position_title\": {\"type\": \"string\", \"datapoint_prompt\": \"The job title or position being offered.\\n\\nCOMMON LABELS: 'Position', 'Job Title', 'Title', 'Role', 'Position Title', 'Job Offer', 'We are pleased to offer you the position of', 'We would like to offer you the position'\\n\\nLOCATION: Typically in the body of the letter, often in the first or second paragraph.; May appear near the beginning after the greeting.; Often appears in phrases like 'We are pleased to offer you the position of [Title]' or 'You have been selected for the position of [Title]'.; Look for job titles in the main body of the letter.\\n\\nFORMAT: Return the position title exactly as it appears on the document. Common formats: 'Software Engineer', 'Senior Manager', 'Sales Representative', 'Product Manager'. Preserve capitalization and exact wording. Include any level indicators (Junior, Senior, Lead, etc.) if present.\\n\\nEDGE CASES:\\n - Position titles may include level indicators (e.g., 'Senior Software Engineer', 'Junior Developer') - include them.\\n - Position titles may include department or team information (e.g., 'Software Engineer - Backend Team') - include as shown.\\n - Some letters may list multiple positions or alternatives - extract the primary position being offered.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'We are pleased to offer you the position of Software Engineer' -> extract 'Software Engineer'\\n \\u2713 Text shows 'Position: Senior Product Manager' -> extract 'Senior Product Manager'\\n \\u2713 Text shows 'You have been selected for the role of Sales Representative' -> extract 'Sales Representative'\\n\\nAVOID:\\n \\u2717 Do NOT extract department names alone as position titles (e.g., 'Engineering' when the title is 'Software Engineer')\\n \\u2717 Do NOT extract location information as part of the position title\\n \\u2717 Do NOT extract compensation information as part of the position title\"}, \"start_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The proposed start date or employment start date in YYYY-MM-DD format (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Start Date', 'Employment Start Date', 'Your start date will be', 'You will begin employment on', 'Expected Start Date', 'Proposed Start Date', 'Start Date:', 'Employment begins'\\n\\nLOCATION: Typically in the body of the letter, often in a paragraph discussing employment terms or in a dedicated terms section.; May appear near compensation or other employment details.; Look for start dates in the main body or terms section.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2025' -> '2025-01-15')\\n - M/D/YYYY (e.g., '1/15/2025' -> '2025-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2025' -> '2025-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2025' -> '2025-01-15')\\nIf year is two digits, expand appropriately. If start date is not specified, return null.\\n\\nEDGE CASES:\\n - Start dates may be approximate (e.g., 'on or about January 15, 2025') - extract the date portion.\\n - Some letters specify a start date range or say 'TBD' (to be determined) - return null if no specific date is given.\\n - Start dates are typically in the future relative to the offer date.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Your start date will be January 15, 2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'Start Date: 01/15/2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'You will begin employment on or about January 15, 2025' -> extract '2025-01-15'\\n \\u2713 Text shows 'Start Date: TBD' or no start date specified -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract offer letter dates as start dates\\n \\u2717 Do NOT extract interview dates or other dates as start dates\"}, \"salary_amount\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The annual salary amount being offered (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Salary', 'Annual Salary', 'Base Salary', 'Starting Salary', 'Compensation', 'Your salary will be', 'We are offering a salary of'\\n\\nLOCATION: Typically in the body of the letter, often in a compensation or terms section.; May appear near other compensation details like benefits.; Look for salary amounts in compensation-related paragraphs.\\n\\nFORMAT: Return a numeric value with two decimal places, no currency symbol and no thousands separators (e.g., '$75,000' -> 75000.00, '$100,000.00' -> 100000.00). Handle annual salary amounts. If salary is not specified, return null.\\n\\nEDGE CASES:\\n - Salary amounts are typically annual - extract the annual amount.\\n - Some letters may show salary in different formats (e.g., '$75K', '$75,000 per year') - convert to numeric.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n - If salary is mentioned but not as a specific number (e.g., 'competitive salary'), return null.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Annual Salary: $75,000' -> extract 75000.00\\n \\u2713 Text shows 'Your salary will be $100,000 per year' -> extract 100000.00\\n \\u2713 Text shows 'Base Salary: $75K' -> extract 75000.00\\n \\u2713 Text shows 'Competitive salary' (no amount) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract hourly rates as annual salary (unless clearly stated as annual equivalent)\\n \\u2717 Do NOT extract bonus amounts as salary amounts\\n \\u2717 Do NOT extract total compensation (including bonuses/equity) as salary amount unless specifically labeled as salary\"}, \"salary_frequency\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The frequency of salary payments (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Paid', 'Pay Frequency', 'Payment Schedule', 'Salary will be paid', 'You will be paid'\\n\\nLOCATION: Typically near the salary amount in the compensation section.; May appear in the same paragraph as salary information.; Look for payment frequency information near salary details.\\n\\nFORMAT: Return the frequency as it appears or in a normalized form. Common values: 'Annual', 'Monthly', 'Bi-weekly', 'Biweekly', 'Weekly', 'Semi-monthly', 'Semimonthly'. Preserve as shown or normalize to common formats. If payment frequency is not specified, return null.\\n\\nEDGE CASES:\\n - Payment frequencies may be stated explicitly (e.g., 'paid monthly', 'paid bi-weekly') or implied by salary format.\\n - Some letters don't specify payment frequency - return null if not mentioned.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'paid monthly' -> extract 'Monthly'\\n \\u2713 Text shows 'bi-weekly payments' -> extract 'Bi-weekly' or 'Biweekly'\\n \\u2713 Text shows 'salary will be paid annually' -> extract 'Annual'\\n\\nAVOID:\\n \\u2717 Do NOT assume payment frequency if not stated\\n \\u2717 Do NOT extract salary amounts as payment frequency\"}, \"offer_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date the offer letter was written or dated (if shown on the letter).\\n\\nCOMMON LABELS: 'Date', 'Dated', 'Date:', 'Letter Date', 'Offer Date'\\n\\nLOCATION: Typically in the letterhead or at the top of the letter, often near the company name or address.; May appear at the beginning of the letter before the greeting.; Often appears in the letterhead area.; Look for dates in the header or letterhead area.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If offer date is not shown, return null.\\n\\nEDGE CASES:\\n - Offer dates are typically the date the letter was written.\\n - Some letters may not show a date - return null if not present.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Date: January 10, 2025' -> extract '2025-01-10'\\n \\u2713 Text shows 'Dated: 01/10/2025' -> extract '2025-01-10'\\n\\nAVOID:\\n \\u2717 Do NOT extract start dates as offer dates\\n \\u2717 Do NOT extract response deadline dates as offer dates\"}, \"response_deadline\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The deadline by which the candidate must respond to the offer (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Response Deadline', 'Please respond by', 'We need your response by', 'Deadline', 'Please let us know by', 'We look forward to hearing from you by'\\n\\nLOCATION: Typically near the end of the letter, often in the closing paragraphs.; May appear in a dedicated section about next steps.; Look for response deadlines in the closing or next steps section.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If response deadline is not specified, return null.\\n\\nEDGE CASES:\\n - Response deadlines are typically a few days to a couple of weeks after the offer date.\\n - Some letters don't specify a deadline - return null if not mentioned.\\n - Deadlines may be stated as 'within X days' rather than a specific date - return null if no specific date is given.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Please respond by January 20, 2025' -> extract '2025-01-20'\\n \\u2713 Text shows 'We need your response by 01/20/2025' -> extract '2025-01-20'\\n \\u2713 Text shows 'Please respond within 7 days' (no specific date) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract start dates as response deadlines\\n \\u2717 Do NOT extract offer dates as response deadlines\"}, \"work_location\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The work location, office location, or work arrangement (if specified in the offer letter).\\n\\nCOMMON LABELS: 'Location', 'Work Location', 'Office Location', 'Position Location', 'Work Arrangement', 'Remote', 'Hybrid', 'In-Office', 'You will work'\\n\\nLOCATION: Typically in the body of the letter, often near position details or employment terms.; May appear in a dedicated location or work arrangement section.; Look for location information in the main body or terms section.\\n\\nFORMAT: Return the work location as it appears on the document. Common formats:\\n - City, State: 'San Francisco, CA'\\n - Full address: '123 Main St, San Francisco, CA 94102'\\n - Work arrangement: 'Remote', 'Hybrid', 'In-Office'\\n - Combination: 'Remote (San Francisco, CA)'\\nPreserve the format as shown. If work location is not specified, return null.\\n\\nEDGE CASES:\\n - Work locations may be physical addresses, cities, or work arrangements (remote/hybrid).\\n - Some letters specify multiple locations or 'various locations' - extract as shown.\\n - Work arrangements (remote, hybrid) may be combined with location information.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Location: San Francisco, CA' -> extract 'San Francisco, CA'\\n \\u2713 Text shows 'Work Location: 123 Main St, San Francisco, CA 94102' -> extract '123 Main St, San Francisco, CA 94102'\\n \\u2713 Text shows 'This is a remote position' -> extract 'Remote'\\n \\u2713 Text shows 'Hybrid work arrangement (San Francisco, CA)' -> extract 'Hybrid work arrangement (San Francisco, CA)'\\n\\nAVOID:\\n \\u2717 Do NOT extract company headquarters address as work location unless specifically stated as the work location\\n \\u2717 Do NOT extract mailing addresses as work locations\"}, \"hiring_manager_name\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The name of the hiring manager or person signing the offer letter (if shown).\\n\\nCOMMON LABELS: Name typically appears in the signature area at the end of the letter.\\n\\nLOCATION: Typically at the end of the letter in the signature area.; Often appears above or below the signature line.; May appear with a title (e.g., 'Hiring Manager', 'VP of Engineering').; Look for names in the signature/closing area.\\n\\nFORMAT: Return the name exactly as it appears. Common formats: 'John Doe', 'John M. Doe'. Preserve capitalization and formatting. If hiring manager name is not shown, return null.\\n\\nEDGE CASES:\\n - Names may appear with titles - you may include the title if it's part of how the name is presented.\\n - Some letters may have printed names in the signature area - extract from there.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'John Doe' in signature area -> extract 'John Doe'\\n \\u2713 Text shows 'John Doe, Hiring Manager' -> extract 'John Doe' or 'John Doe, Hiring Manager'\\n\\nAVOID:\\n \\u2717 Do NOT extract candidate names as hiring manager names\\n \\u2717 Do NOT extract company names as hiring manager names\"}}, \"required\": [\"company_name\", \"candidate_name\", \"position_title\"], \"validation\": {\"cross_field\": [{\"type\": \"date_comparison\", \"field1\": \"offer_date\", \"field2\": \"start_date\", \"comparison\": \"before_or_equal\", \"message\": \"Offer date should be before or equal to start date (offers are made before employment begins)\"}, {\"type\": \"date_comparison\", \"field1\": \"offer_date\", \"field2\": \"response_deadline\", \"comparison\": \"before_or_equal\", \"message\": \"Offer date should be before or equal to response deadline (deadlines are set after the offer is made)\"}]}}", "true_json_output": "{\"company_name\": \"Arnold Associates\", \"candidate_name\": \"Ms. Lakia Lee\", \"position_title\": \"Financial Analyst\", \"start_date\": \"2010-06-08\", \"salary_amount\": 37500.0, \"salary_frequency\": null, \"offer_date\": \"2010-06-01\", \"response_deadline\": null, \"work_location\": null, \"hiring_manager_name\": \"Manuel Santiago\", \"source_filename\": \"offer_letter_2_1.pdf\"}", "true_markdown_output": "**Company Name:** Arnold Associates\n**Candidate Name:** Ms. Lakia Lee\n**Position Title:** Financial Analyst\n**Start Date:** 2010-06-08\n**Salary Amount:** 37500.0\n**Salary Frequency:** N/A\n**Offer Date:** 2010-06-01\n**Response Deadline:** N/A\n**Work Location:** N/A\n**Hiring Manager Name:** Manuel Santiago"} {"file_name": "images/payslip.png", "id": 13, "metadata": "{\"format\": \"PAYSLIP\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"payslip.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"employer_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the employer or company that issued the payslip.\\n\\nCOMMON LABELS: Employer name typically appears in the header/logo area at the top of the payslip.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the header area with the company logo.; Within the first 10-20% of page height, centered or left-aligned.; May appear in larger, bold font near the payslip title.; Often appears with the company name or business name.\\n\\nFORMAT: Return the employer name as it appears on the document. Common formats: 'ABC Corporation', 'Smith Manufacturing', 'City Public Schools', 'Healthcare System Inc.'. Preserve capitalization and abbreviations. Prefer the brand/company name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'ABC Corporation, Inc.' and 'ABC Corporation'), prefer the shorter brand name if clear.\\n - Employer names may include business designations, corporate structures, or department names - preserve as shown but prefer the main company name.\\n - If the employer name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'ABC CORPORATION' in large header text -> extract 'ABC CORPORATION' or 'ABC Corporation'\\n \\u2713 Document shows 'Smith Manufacturing, LLC' in header -> extract 'Smith Manufacturing' or 'Smith Manufacturing, LLC'\\n \\u2713 Document shows 'CITY PUBLIC SCHOOLS' -> extract 'CITY PUBLIC SCHOOLS' or 'City Public Schools'\\n\\nAVOID:\\n \\u2717 Do NOT extract mailing addresses or branch locations as the employer name\\n \\u2717 Do NOT extract department names (e.g., 'Human Resources Department') as the employer name unless that's the only identifier\\n \\u2717 Do NOT extract payroll service provider names as the employer name\"}, \"employee_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the employee who received the pay.\\n\\nCOMMON LABELS: 'Employee Name', 'Employee', 'Name', 'Employee:', 'Name:', 'Pay To', 'Payee'\\n\\nLOCATION: Top section of the first page, typically in the employee information section.; Often appears near the employee ID and other employee details.; May be in the upper-left or upper-center area.; Look for a labeled field with the employee's name.\\n\\nFORMAT: Return the employee name exactly as it appears on the document. Common formats:\\n - Full name: 'John Doe'\\n - With middle name/initial: 'John Michael Doe' or 'John M. Doe'\\n - Last name first: 'Doe, John'\\nPreserve capitalization, punctuation, and formatting (including middle names/initials, suffixes like Jr., Sr., etc.).\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Some payslips show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Names may be in all uppercase on payslips - preserve the capitalization.\\n - If name appears in multiple places, prefer the one in the main employee information section.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Employee Name: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Employee: DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Name: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n \\u2713 Text shows 'Employee Name: John M. Doe' -> extract 'John M. Doe'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract employer names as employee names\\n \\u2717 Do NOT extract department names or job titles as employee names\"}, \"employee_id\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The employee ID number or employee number assigned by the employer.\\n\\nCOMMON LABELS: 'Employee ID', 'Employee Number', 'Emp ID', 'Emp No.', 'Employee #', 'ID', 'Employee ID:', 'ID Number'\\n\\nLOCATION: Top section of the first page, typically in the employee information section.; Often appears near the employee name and other employee details.; May be in the upper-left or upper-center area.; Look for a labeled field with an employee identifier.\\n\\nFORMAT: Return the employee ID exactly as it appears on the document. Employee IDs may be numeric, alphanumeric, or include dashes. Preserve any formatting, dashes, or spacing as shown. If no employee ID is shown, return null.\\n\\nEDGE CASES:\\n - Employee IDs vary by employer - preserve the exact format.\\n - Employee IDs may include dashes or spaces (e.g., '12345', 'EMP-12345', '123 456') - preserve as shown.\\n - Some payslips may not show employee IDs - return null if not present.\\n - Do not confuse with Social Security numbers (SSN) or other identifiers.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Employee ID: 12345' -> extract '12345'\\n \\u2713 Text shows 'Emp ID: EMP-12345' -> extract 'EMP-12345'\\n \\u2713 Text shows 'Employee #: 123 456' -> extract '123 456'\\n \\u2713 Text shows no employee ID -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract Social Security numbers as employee IDs\\n \\u2717 Do NOT extract payroll numbers or check numbers as employee IDs\\n \\u2717 Do NOT extract account numbers or other identifiers as employee IDs\"}, \"pay_period_start\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The start date of the pay period in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Pay Period', 'Period', 'From', 'From Date', 'Pay Period From', 'Period Start', 'Pay Period Start', 'Start Date'\\n\\nLOCATION: Typically in the pay period information section, often near the pay date.; May appear in the upper portion of the payslip.; Often appears as a date range (e.g., 'Pay Period: 01/01/2024 - 01/15/2024').; Look for labels like 'Pay Period', 'From', or date ranges.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/01/2024' -> '2024-01-01')\\n - M/D/YYYY (e.g., '1/1/2024' -> '2024-01-01')\\n - MM-DD-YYYY (e.g., '01-01-2024' -> '2024-01-01')\\n - Month DD, YYYY (e.g., 'January 1, 2024' -> '2024-01-01')\\n - Mon DD, YYYY (e.g., 'Jan 1, 2024' -> '2024-01-01')\\n - Month YYYY or Mon YYYY (e.g., 'November 2015' or 'Nov 2015' -> '2015-11-01' - use first day of month)\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits (e.g., '24'), assume 20YY (e.g., '01/01/24' -> '2024-01-01').\\n\\nEDGE CASES:\\n - Pay period may be shown as a range: '01/01/2024 - 01/15/2024'. Extract the FIRST date (start date).\\n - If only month and year are shown (e.g., 'November 2015', 'Nov 2015'), use the FIRST day of that month (e.g., '2015-11-01').\\n - If only a single date is shown labeled 'Pay Period', this may be the end date - look for context or date ranges to determine.\\n - Two-digit years: Expand '24' to '2024', '99' to '1999', etc. (treat < 50 as 20XX, >= 50 as 19XX).\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Pay Period: 01/01/2024 - 01/15/2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'From: January 1, 2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'Period: November 2015' -> extract '2015-11-01' (first day of month)\\n \\u2713 Text shows 'Period: Nov 2015' -> extract '2015-11-01' (first day of month)\\n \\u2713 Text shows 'Period: 1/1/24 to 1/15/24' -> extract '2024-01-01'\\n\\nAVOID:\\n \\u2717 Do NOT extract the end date of the pay period as the start date\\n \\u2717 Do NOT extract the pay date as the pay period start date\\n \\u2717 Do NOT extract dates from earnings/deductions sections as the pay period start date\"}, \"pay_period_end\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The end date of the pay period in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Pay Period', 'Period', 'To', 'To Date', 'Pay Period To', 'Period End', 'Pay Period End', 'End Date'\\n\\nLOCATION: Typically in the pay period information section, often near the pay date.; May appear in the upper portion of the payslip.; Often appears as a date range (e.g., 'Pay Period: 01/01/2024 - 01/15/2024').; Look for labels like 'Pay Period', 'To', or date ranges.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/15/2024' -> '2024-01-15')\\n - M/D/YYYY (e.g., '1/15/2024' -> '2024-01-15')\\n - MM-DD-YYYY (e.g., '01-15-2024' -> '2024-01-15')\\n - Month DD, YYYY (e.g., 'January 15, 2024' -> '2024-01-15')\\n - Mon DD, YYYY (e.g., 'Jan 15, 2024' -> '2024-01-15')\\n - Month YYYY or Mon YYYY (e.g., 'November 2015' or 'Nov 2015' -> '2015-11-30' - use last day of month)\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits (e.g., '24'), assume 20YY (e.g., '01/15/24' -> '2024-01-15').\\n\\nEDGE CASES:\\n - Pay period may be shown as a range: '01/01/2024 - 01/15/2024'. Extract the SECOND date (end date).\\n - If only month and year are shown (e.g., 'November 2015', 'Nov 2015'), use the LAST day of that month (e.g., '2015-11-30').\\n - If only a single date is shown labeled 'Pay Period', this may be the end date.\\n - The end date should be AFTER the start date (pay_period_start).\\n - Two-digit years: Expand '24' to '2024', '99' to '1999', etc. (treat < 50 as 20XX, >= 50 as 19XX).\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Pay Period: 01/01/2024 - 01/15/2024' -> extract '2024-01-15'\\n \\u2713 Text shows 'To: January 15, 2024' -> extract '2024-01-15'\\n \\u2713 Text shows 'Period: November 2015' -> extract '2015-11-30' (last day of month)\\n \\u2713 Text shows 'Period: Nov 2015' -> extract '2015-11-30' (last day of month)\\n \\u2713 Text shows 'End Date: 1/15/24' -> extract '2024-01-15'\\n\\nAVOID:\\n \\u2717 Do NOT extract the start date of the pay period as the end date\\n \\u2717 Do NOT extract the pay date as the pay period end date\\n \\u2717 Do NOT extract dates from earnings/deductions sections as the pay period end date\"}, \"pay_date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"The date when the employee was paid (paycheck date) in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Pay Date', 'Date Paid', 'Check Date', 'Paycheck Date', 'Payment Date', 'Date', 'Pay Date:', 'Date Paid:'\\n\\nLOCATION: Typically in the pay period information section, often near the pay period dates.; May appear in the upper portion of the payslip.; Usually appears prominently as it's the date the payment was issued.; Look for dates labeled as pay date or check date.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize these common input formats:\\n - MM/DD/YYYY (e.g., '01/20/2024' -> '2024-01-20')\\n - M/D/YYYY (e.g., '1/20/2024' -> '2024-01-20')\\n - MM-DD-YYYY (e.g., '01-20-2024' -> '2024-01-20')\\n - Month DD, YYYY (e.g., 'January 20, 2024' -> '2024-01-20')\\n - Mon DD, YYYY (e.g., 'Jan 20, 2024' -> '2024-01-20')\\n - YYYY-MM-DD (already in correct format)\\nIf year is two digits (e.g., '24'), assume 20YY (e.g., '01/20/24' -> '2024-01-20').\\n\\nEDGE CASES:\\n - Pay date should be on or after the pay period end date (typically a few days after).\\n - Two-digit years: Expand based on context.\\n - OCR errors: Strip non-digit noise around date tokens before parsing.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Pay Date: 01/20/2024' -> extract '2024-01-20'\\n \\u2713 Text shows 'Date Paid: January 20, 2024' -> extract '2024-01-20'\\n \\u2713 Text shows 'Check Date: 1/20/24' -> extract '2024-01-20'\\n\\nAVOID:\\n \\u2717 Do NOT extract pay period dates as the pay date\\n \\u2717 Do NOT extract dates from earnings/deductions sections as the pay date\"}, \"gross_pay\": {\"type\": \"number\", \"datapoint_prompt\": \"The total gross pay (earnings before deductions) for this pay period.\\n\\nCOMMON LABELS: 'Gross Pay', 'Gross', 'Total Gross', 'Gross Earnings', 'Gross Wages', 'Total Earnings', 'Earnings'\\n\\nLOCATION: Typically in an earnings or summary section, often near the top or middle of the payslip.; Usually appears prominently as it's a key amount.; May be in a 'Current' or 'This Period' column.; Look for the total gross pay amount before deductions.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$2,500.00' -> 2500.00, '$500.00' -> 500.00). If OCR produces '2500' normalize to two decimals '2500.00'. If the extracted value is missing or illegible, return null.\\n\\nEDGE CASES:\\n - Gross pay should be a positive number.\\n - Gross pay should equal the sum of all earnings line items (within rounding tolerance).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n - If multiple amounts appear, prefer the one labeled 'Gross Pay' or 'Total Gross' over individual earnings line items.\\n\\nEXAMPLES:\\n \\u2713 'Gross Pay: $2,500.00' -> 2500.00\\n \\u2713 'Total Gross: $1,500.00' -> 1500.00\\n \\u2713 'Gross Earnings: $500.00' -> 500.00\\n\\nAVOID:\\n \\u2717 Do NOT extract net pay as gross pay\\n \\u2717 Do NOT extract individual earnings line item amounts as gross pay\\n \\u2717 Do NOT extract year-to-date gross pay as the current period gross pay\"}, \"total_deductions\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total of all deductions for this pay period (if shown separately on the payslip).\\n\\nCOMMON LABELS: 'Total Deductions', 'Deductions', 'Total Ded', 'Deductions Total', 'Total Withholdings'\\n\\nLOCATION: Typically in a deductions or summary section, often in the middle of the payslip.; Usually appears after gross pay and before net pay.; May be in a 'Current' or 'This Period' column.; Look for the total deductions amount.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If total deductions are not shown separately (only individual deduction line items are shown), return null. If no deductions exist, return 0.00.\\n\\nEDGE CASES:\\n - Total deductions should equal the sum of all deduction line items (within rounding tolerance).\\n - Some payslips don't show this separately - only show individual deduction line items - return null in that case.\\n - If no deductions exist, return 0.00 (not null).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Total Deductions: $500.00' -> extract 500.00\\n \\u2713 Text shows 'Deductions: $250.00' -> extract 250.00\\n \\u2713 Text shows 'Total Deductions: $0.00' -> extract 0.00\\n \\u2713 Text shows no total deductions field (only line items) -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract net pay as total deductions\\n \\u2717 Do NOT extract individual deduction line item amounts as total deductions\\n \\u2717 Do NOT extract year-to-date deductions as the current period total deductions\"}, \"net_pay\": {\"type\": \"number\", \"datapoint_prompt\": \"The net pay (take-home pay after all deductions) for this pay period.\\n\\nCOMMON LABELS: 'Net Pay', 'Net', 'Take Home', 'Net Pay Amount', 'Pay This Period', 'Net Amount', 'Final Pay'\\n\\nLOCATION: Typically prominently displayed, often at the bottom of the earnings/deductions section or in a summary box.; Usually appears in larger or bold text as it's the final amount.; May be in a 'Current' or 'This Period' column.; Look for the net pay or take-home amount.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$2,000.00' -> 2000.00, '$500.00' -> 500.00). If OCR produces '2000' normalize to two decimals '2000.00'. If the extracted value is missing or illegible, return null.\\n\\nEDGE CASES:\\n - Net pay should be less than or equal to gross pay (net = gross - deductions).\\n - Net pay should equal gross pay minus total deductions (within rounding tolerance).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters). Normalize 'o' or 'O' to '0' only when context strongly suggests digits.\\n - If multiple amounts appear, prefer the one labeled 'Net Pay' or 'Take Home' over calculated values.\\n\\nEXAMPLES:\\n \\u2713 'Net Pay: $2,000.00' -> 2000.00\\n \\u2713 'Take Home: $1,500.00' -> 1500.00\\n \\u2713 'Net: $500.00' -> 500.00\\n\\nAVOID:\\n \\u2717 Do NOT extract gross pay as net pay\\n \\u2717 Do NOT extract individual earnings or deduction amounts as net pay\\n \\u2717 Do NOT extract year-to-date net pay as the current period net pay\"}, \"earnings\": {\"type\": \"array\", \"datapoint_prompt\": \"All earnings/income line items for this pay period. Extract ALL earnings in the order they appear.\\n\\nLOCATION STRATEGY:\\n- PRIMARY: Earnings section, typically labeled 'Earnings', 'Current Earnings', 'This Period'\\n- Usually appears: Upper to middle portion of the payslip\\n- Format: Table or list with descriptions and amounts\\n\\nEXTRACTION RULES:\\n- Extract ALL earnings - do not skip any earnings items\\n- Preserve order (as they appear on the payslip)\\n- Include ALL earnings types: regular pay, overtime, bonuses, commissions, etc.\\n- For each earnings item, extract: description, hours (if shown), rate (if shown), amount\\n\\nCOMMON EARNINGS TYPES:\\n- Regular Pay: Regular hours, salary\\n- Overtime: Overtime hours, OT pay\\n- Holiday Pay: Holiday hours, holiday pay\\n- Bonuses: Performance bonuses, signing bonuses\\n- Commissions: Sales commissions\\n- Other: Shift differential, on-call pay, etc.\\n\\nFORMAT: Return an array of earnings objects in the order they appear. Each item should include:\\n- description: Earnings type/description as it appears\\n- hours: Optional hours worked if shown\\n- rate: Optional hourly rate if shown\\n- amount: Numeric earnings amount\\n\\nEDGE CASES:\\n- Multiple earnings types: Include all of them, preserve order\\n- Hours and rates may not be shown for salaried employees - include if available\\n- Descriptions may be abbreviated - extract as shown\\n- Some payslips show year-to-date earnings separately - extract only current period earnings\\n\\nEXAMPLES:\\n \\u2713 {description: 'Regular Pay', hours: 80.0, rate: 25.00, amount: 2000.00}\\n \\u2713 {description: 'Overtime', hours: 10.0, rate: 37.50, amount: 375.00}\\n \\u2713 {description: 'Bonus', amount: 500.00}\\n\\nAVOID:\\n \\u2717 Do NOT skip earnings items even if they seem minor\\n \\u2717 Do NOT extract year-to-date earnings as current period earnings\\n \\u2717 Do NOT extract gross pay total as an earnings line item\\n \\u2717 Do NOT reorder items - preserve the order as shown on the payslip\", \"items\": {\"type\": \"object\", \"properties\": {\"description\": {\"type\": \"string\", \"datapoint_prompt\": \"Earnings type/description EXACTLY as it appears on the payslip. Include all details: 'Regular Pay', 'Overtime', 'Bonus', etc. Preserve the exact text as shown.\"}, \"hours\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Hours worked for this earnings type if shown. Format: numeric decimal (e.g., 80.0, 10.5). Return null if hours are not shown for this earnings type.\"}, \"rate\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Hourly rate or pay rate for this earnings type if shown. Format: numeric decimal with two decimal places (e.g., 25.00, 37.50). Return null if rate is not shown for this earnings type.\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Earnings amount for this line item as a numeric value. Format: numeric decimal with two decimal places (e.g., 2000.00, 375.00).\"}}, \"required\": [\"description\", \"amount\"]}}, \"deductions\": {\"type\": \"array\", \"datapoint_prompt\": \"All deductions line items for this pay period. Extract ALL deductions in the order they appear.\\n\\nLOCATION STRATEGY:\\n- PRIMARY: Deductions section, typically labeled 'Deductions', 'Withholdings', 'Current Deductions', 'This Period'\\n- Usually appears: Middle portion of the payslip, after earnings\\n- Format: Table or list with descriptions and amounts\\n\\nEXTRACTION RULES:\\n- Extract ALL deductions - do not skip any deduction items\\n- Preserve order (as they appear on the payslip)\\n- Include ALL deduction types: taxes, insurance, retirement, etc.\\n- For each deduction item, extract: description and amount\\n\\nCOMMON DEDUCTION TYPES:\\n- Federal Tax: Federal income tax, FIT\\n- State Tax: State income tax, SIT\\n- Local Tax: Local income tax, city tax\\n- Social Security: FICA, Social Security tax, SS\\n- Medicare: Medicare tax\\n- Health Insurance: Medical, health, dental, vision insurance\\n- Retirement: 401(k), pension, retirement contributions\\n- Other: Life insurance, disability, union dues, etc.\\n\\nFORMAT: Return an array of deduction objects in the order they appear. Each item should include:\\n- description: Deduction type/description as it appears\\n- amount: Numeric deduction amount (typically a positive number representing the amount withheld)\\n\\nEDGE CASES:\\n- Multiple deduction types: Include all of them, preserve order\\n- Deduction amounts are typically positive numbers (amount withheld)\\n- Descriptions may be abbreviated - extract as shown\\n- Some payslips show year-to-date deductions separately - extract only current period deductions\\n- If no deductions exist, return an empty array\\n\\nEXAMPLES:\\n \\u2713 {description: 'Federal Tax', amount: 300.00}\\n \\u2713 {description: 'State Tax', amount: 100.00}\\n \\u2713 {description: 'Health Insurance', amount: 150.00}\\n \\u2713 {description: '401(k)', amount: 200.00}\\n\\nAVOID:\\n \\u2717 Do NOT skip deduction items even if they seem minor\\n \\u2717 Do NOT extract year-to-date deductions as current period deductions\\n \\u2717 Do NOT extract total deductions as a deduction line item\\n \\u2717 Do NOT reorder items - preserve the order as shown on the payslip\", \"items\": {\"type\": \"object\", \"properties\": {\"description\": {\"type\": \"string\", \"datapoint_prompt\": \"Deduction type/description EXACTLY as it appears on the payslip. Include all details: 'Federal Tax', 'Health Insurance', '401(k)', etc. Preserve the exact text as shown.\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Deduction amount for this line item as a numeric value. Format: numeric decimal with two decimal places (e.g., 300.00, 150.00). This is typically a positive number representing the amount withheld.\"}}, \"required\": [\"description\", \"amount\"]}}, \"year_to_date_gross\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The year-to-date (YTD) gross pay total (if shown on the payslip).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - YTD columns, summary sections, earnings sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nEXTRACTION STRATEGY (in order of preference):\\n1. If an explicitly labeled 'YTD Gross', 'Year to Date Gross', 'YTD Earnings', or 'YTD Gross Pay' field exists, extract that value.\\n2. If no explicit label exists but a YTD column is present with individual earnings YTD values, calculate by summing all positive wage/earnings YTD amounts (items marked as 'Wages' or positive earnings types like Base Pay, Overtime, Holiday Pay, Bonuses, etc.).\\n3. If neither explicit label nor YTD column exists, return null.\\n\\nCOMMON LABELS: 'YTD Gross', 'Year to Date Gross', 'YTD Earnings', 'YTD Gross Pay', 'Year to Date'\\n\\nLOCATION: Typically in a year-to-date (YTD) column, often to the right of current period amounts.; May appear in the earnings or summary section.; Look for YTD totals in a separate column or as a calculated sum of YTD earnings line items.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$23,099.80' -> 23099.80). If YTD gross is not shown or cannot be calculated from the payslip, return null.\\n\\nCALCULATION RULES (when summing YTD column values):\\n- Sum all positive earnings/wages YTD amounts (Base Pay, Regular Pay, Overtime, Holiday Pay, Bonuses, Commissions, etc.).\\n- Do NOT include deduction YTD amounts (taxes, insurance, etc.) in the gross calculation.\\n- Do NOT include negative amounts or amounts marked as deductions/taxes.\\n- Only include amounts clearly marked as earnings/wages in the YTD column.\\n\\nEDGE CASES:\\n - YTD amounts are cumulative totals for the calendar year.\\n - Some payslips show explicit YTD totals - prefer those over calculations.\\n - Some payslips only show YTD column with line items - calculate by summing wage/earnings YTD values.\\n - Some payslips don't show YTD information at all - return null if not present.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'YTD Gross: $30,000.00' -> extract 30000.00\\n \\u2713 Text shows 'Year to Date Gross: $25,000.00' -> extract 25000.00\\n \\u2713 YTD column shows: Base Hourly YTD: $10,912.00, Holiday Pay YTD: $3,945.50, Long Service Leave YTD: $7,392.00, Overtime YTD: $33.00, Sick Pay YTD: $440.00, Holiday Leave Loading YTD: $377.30 -> calculate and extract 23099.80\\n \\u2713 Text shows no YTD information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract current period gross pay as YTD gross pay\\n \\u2717 Do NOT extract net pay as YTD gross pay\\n \\u2717 Do NOT include deduction/tax YTD amounts in the calculation\"}, \"year_to_date_net\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The year-to-date (YTD) net pay total (if shown on the payslip).\\n\\nCRITICAL - COMPLETE EXTRACTION: Search ALL sections of the document - YTD columns, summary sections, all pages. Extract this field if it appears ANYWHERE on the document.\\n\\nEXTRACTION STRATEGY (in order of preference):\\n1. If an explicitly labeled 'YTD Net', 'Year to Date Net', 'YTD Net Pay', or 'YTD Take Home' field exists, extract that value.\\n2. If no explicit label exists but YTD gross and YTD deductions can be determined from the YTD column, calculate as: YTD Net = YTD Gross - YTD Deductions (sum of all tax/withholding/deduction YTD amounts).\\n3. If neither explicit label nor sufficient YTD column data exists, return null.\\n\\nCOMMON LABELS: 'YTD Net', 'Year to Date Net', 'YTD Net Pay', 'YTD Take Home'\\n\\nLOCATION: Typically in a year-to-date (YTD) column, often to the right of current period amounts.; May appear in the summary section.; Look for YTD totals in a separate column or as a calculated value.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$18,239.80' -> 18239.80). If YTD net is not shown or cannot be calculated from the payslip, return null.\\n\\nCALCULATION RULES (when calculating from YTD column):\\n- YTD Net = YTD Gross - YTD Deductions\\n- YTD Deductions = Sum of all tax/withholding/deduction YTD amounts (e.g., PAYG Withholding, Federal Tax, State Tax, Social Security, Medicare, etc.).\\n- Only include amounts clearly marked as deductions/taxes/withholdings in the YTD column.\\n- Use absolute values for deductions (if shown as negative, convert to positive for calculation).\\n\\nEDGE CASES:\\n - YTD amounts are cumulative totals for the calendar year.\\n - Some payslips show explicit YTD net totals - prefer those over calculations.\\n - Some payslips only show YTD column with line items - calculate using YTD Gross minus YTD Deductions.\\n - Some payslips don't show YTD information at all - return null if not present.\\n - YTD net should be less than or equal to YTD gross.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'YTD Net: $24,000.00' -> extract 24000.00\\n \\u2713 Text shows 'Year to Date Net: $20,000.00' -> extract 20000.00\\n \\u2713 YTD Gross: $23,099.80, YTD PAYG Withholding: $4,860.00 -> calculate YTD Net: 23099.80 - 4860.00 = 18239.80\\n \\u2713 Text shows no YTD information -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract current period net pay as YTD net pay\\n \\u2717 Do NOT extract gross pay as YTD net pay\\n \\u2717 Do NOT include earnings YTD amounts in the deduction calculation\"}}, \"required\": [\"employer_name\", \"employee_name\", \"pay_period_start\", \"pay_period_end\", \"pay_date\", \"gross_pay\", \"net_pay\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"pay_period_start\", \"end_field\": \"pay_period_end\", \"max_days\": 31, \"message\": \"Pay period should be within 31 days (typically 7, 14, or 30 days)\"}, {\"type\": \"date_comparison\", \"field1\": \"pay_period_end\", \"field2\": \"pay_date\", \"comparison\": \"before_or_equal\", \"message\": \"Pay period end date should be before or equal to pay date (pay is typically issued after the pay period ends)\"}, {\"type\": \"approximate_match\", \"fields\": [\"gross_pay\", \"total_deductions\", \"net_pay\"], \"tolerance\": 0.01, \"message\": \"Net pay should approximately equal: Gross Pay - Total Deductions (within $0.01 rounding tolerance)\"}]}}", "true_json_output": "{\"employer_name\": \"Sadhana Infotech\", \"employee_name\": \"SANDHYA\", \"employee_id\": \"16\", \"pay_period_start\": \"2019-02-01\", \"pay_period_end\": \"2019-02-28\", \"pay_date\": null, \"gross_pay\": 40000.0, \"total_deductions\": 7122.0, \"net_pay\": 32878.0, \"earnings\": [{\"description\": \"BASIC\", \"hours\": null, \"rate\": 20000.0, \"amount\": 20000.0}, {\"description\": \"DA\", \"hours\": null, \"rate\": 4000.0, \"amount\": 4000.0}, {\"description\": \"HRA\", \"hours\": null, \"rate\": 9600.0, \"amount\": 9600.0}, {\"description\": \"CONV\", \"hours\": null, \"rate\": 800.0, \"amount\": 800.0}, {\"description\": \"SPL ALLOW\", \"hours\": null, \"rate\": 5600.0, \"amount\": 5600.0}], \"deductions\": [{\"description\": \"PF\", \"amount\": 2880.0}, {\"description\": \"PT\", \"amount\": 200.0}, {\"description\": \"TDS\", \"amount\": 4042.0}], \"year_to_date_gross\": null, \"year_to_date_net\": null, \"source_filename\": \"payslip.pdf\"}", "true_markdown_output": "**Employer Name:** Sadhana Infotech\n**Employee Name:** SANDHYA\n**Employee Id:** 16\n**Pay Period Start:** 2019-02-01\n**Pay Period End:** 2019-02-28\n**Pay Date:** N/A\n**Gross Pay:** 40000.0\n**Total Deductions:** 7122.0\n**Net Pay:** 32878.0\n**Earnings:**\n **Description:** BASIC\n **Hours:** N/A\n **Rate:** 20000.0\n **Amount:** 20000.0\n **Description:** DA\n **Hours:** N/A\n **Rate:** 4000.0\n **Amount:** 4000.0\n **Description:** HRA\n **Hours:** N/A\n **Rate:** 9600.0\n **Amount:** 9600.0\n **Description:** CONV\n **Hours:** N/A\n **Rate:** 800.0\n **Amount:** 800.0\n **Description:** SPL ALLOW\n **Hours:** N/A\n **Rate:** 5600.0\n **Amount:** 5600.0\n**Deductions:**\n **Description:** PF\n **Amount:** 2880.0\n **Description:** PT\n **Amount:** 200.0\n **Description:** TDS\n **Amount:** 4042.0\n**Year To Date Gross:** N/A\n**Year To Date Net:** N/A"} {"file_name": "images/statement_1.png", "id": 14, "metadata": "{\"format\": \"STATEMENT\", \"documentQuality\": \"LOW_QUALITY\", \"source_filename\": \"statement_1.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"institution_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the financial institution, company, or organization that issued the statement.\\n\\nCOMMON LABELS: Institution name typically appears prominently in the header/logo area at the top of the statement.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the header area with the institution logo.; Within the first 10-20% of page height, centered or left-aligned.; May appear in larger, bold font near the statement title.; Often appears with the institution logo or branding.\\n\\nFORMAT: Return the institution name as it appears on the document. Common formats: 'Bank of America', 'Chase Bank', 'ABC Credit Union', 'XYZ Investment Company'. Preserve capitalization and abbreviations. Prefer the brand/institution name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'Bank of America, N.A.' and 'Bank of America'), prefer the shorter brand name if clear.\\n - Institution names may include legal designations (N.A., Inc., LLC) - preserve as shown or extract the core brand name.\\n - If the institution name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'BANK OF AMERICA' in large header text -> extract 'BANK OF AMERICA' or 'Bank of America'\\n \\u2713 Document shows 'Chase Bank' in header -> extract 'Chase Bank'\\n \\u2713 Document shows 'ABC CREDIT UNION' -> extract 'ABC CREDIT UNION' or 'ABC Credit Union'\\n\\nAVOID:\\n \\u2717 Do NOT extract account holder names as the institution name\\n \\u2717 Do NOT extract branch names or location names as the institution name\\n \\u2717 Do NOT extract department names as the institution name\"}, \"statement_type\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The type of statement (e.g., 'Account Statement', 'Credit Card Statement', 'Investment Statement', 'Loan Statement', 'Savings Statement').\\n\\nCOMMON LABELS: Statement type typically appears in the document title or header (e.g., 'Account Statement', 'Monthly Statement', 'Credit Card Statement').\\n\\nLOCATION: Typically in the document title or header area, often near the institution name.; May appear prominently at the top of the first page.; Look for statement type designations in the title or header.\\n\\nFORMAT: Return the statement type as it appears or in a normalized form. Common values: 'Account Statement', 'Credit Card Statement', 'Investment Statement', 'Loan Statement', 'Savings Statement', 'Checking Statement', 'Monthly Statement'. Preserve the format as shown. If statement type is not clearly identifiable, return null.\\n\\nEDGE CASES:\\n - Statement types may be part of the document title (e.g., 'Monthly Account Statement') - extract the type designation.\\n - Some statements don't explicitly label the type - return null if unclear.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Monthly Account Statement' -> extract 'Account Statement' or 'Monthly Account Statement'\\n \\u2713 Text shows 'Credit Card Statement' -> extract 'Credit Card Statement'\\n \\u2713 Text shows no clear statement type -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract account types as statement types (e.g., 'Checking' when the statement type is 'Account Statement')\"}, \"account_holder_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the account holder or account owner.\\n\\nCOMMON LABELS: 'Account Holder', 'Name', 'Account Name', 'Customer Name', 'Account Owner', 'Primary Account Holder', 'Name:', 'Account Holder:'\\n\\nLOCATION: Top section of the first page, typically in the account information or customer information section.; Often appears near the account number and statement period.; Usually in the upper-left or upper-center area.; Look for account holder names in the account information area.\\n\\nFORMAT: Return the account holder name exactly as it appears on the document. Common formats:\\n - Full name: 'John Doe'\\n - With middle name/initial: 'John Michael Doe' or 'John M. Doe'\\n - Last name first: 'Doe, John'\\n - Business/entity names: 'ABC Corporation'\\nPreserve capitalization, punctuation, and formatting. Include suffixes (Jr., Sr., etc.) if present.\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Some statements show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Names may be in all uppercase on statements - preserve the capitalization.\\n - Business/entity names may include legal designations - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Account Holder: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Name: DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Customer Name: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract institution names as account holder names\"}, \"account_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The account number or account identifier associated with this statement.\\n\\nCOMMON LABELS: 'Account Number', 'Account No.', 'Account #', 'Acct Number', 'Acct No.', 'Acct #', 'Account', 'Acct'\\n\\nLOCATION: Top section of the first page, typically in the account information section.; Often appears near the account holder name and statement period.; May be in the upper-left or upper-center area.; Look for account numbers in the account information area.\\n\\nFORMAT: Return the account number exactly as it appears on the document. Account numbers may be numeric, alphanumeric, or include dashes/spaces. Preserve any formatting, masking characters (asterisks, X's), or spacing as shown. If account number is not shown (some statements mask it for security), return null.\\n\\nEDGE CASES:\\n - Account numbers may be masked for security (e.g., '****1234', 'XXXX5678') - preserve the masking format if shown.\\n - Account numbers may include dashes or spaces - preserve as shown.\\n - Some statements show only the last 4 digits - extract as shown.\\n - Do not confuse with other identifiers like routing numbers, reference numbers, or statement numbers.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Account Number: 123456789' -> extract '123456789'\\n \\u2713 Text shows 'Acct #: 1234-5678-90' -> extract '1234-5678-90'\\n \\u2713 Text shows 'Account: ****1234' -> extract '****1234'\\n\\nAVOID:\\n \\u2717 Do NOT extract routing numbers or other identifiers as account numbers\\n \\u2717 Do NOT extract statement numbers or reference numbers as account numbers\"}, \"statement_period_start\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The start date of the statement period in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Statement Period', 'Period', 'From', 'From Date', 'Statement Date From', 'Period From', 'Period Start'\\n\\nLOCATION: Top section of the first page, typically in the account information or statement period section.; Often appears as a date range (e.g., 'Statement Period: 01/01/2024 - 01/31/2024').; May be in the upper portion of the page.; Look for date ranges or period start dates.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If statement period is shown as a range, extract the start/from date. If statement period start is not shown, return null.\\n\\nEDGE CASES:\\n - Statement periods may be shown as date ranges - extract the first date (start date).\\n - Some statements show only month and year (e.g., 'January 2024') - use the first day of that month (e.g., '2024-01-01').\\n - Two-digit years: Expand appropriately.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Statement Period: 01/01/2024 - 01/31/2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'From: January 1, 2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'Period: January 2024' -> extract '2024-01-01'\\n\\nAVOID:\\n \\u2717 Do NOT extract statement end dates as start dates\\n \\u2717 Do NOT extract statement generation dates as period start dates\"}, \"statement_period_end\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The end date of the statement period in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Statement Period', 'Period', 'To', 'To Date', 'Statement Date To', 'Period To', 'Period End', 'Through'\\n\\nLOCATION: Top section of the first page, typically in the account information or statement period section.; Often appears as a date range (e.g., 'Statement Period: 01/01/2024 - 01/31/2024').; May be in the upper portion of the page.; Look for date ranges or period end dates.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If statement period is shown as a date range, extract the end/to date. If statement period end is not shown, return null.\\n\\nEDGE CASES:\\n - Statement periods may be shown as date ranges - extract the second date (end date).\\n - Some statements show only month and year (e.g., 'January 2024') - use the last day of that month (e.g., '2024-01-31').\\n - The end date should be after or equal to the start date.\\n - Two-digit years: Expand appropriately.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Statement Period: 01/01/2024 - 01/31/2024' -> extract '2024-01-31'\\n \\u2713 Text shows 'To: January 31, 2024' -> extract '2024-01-31'\\n \\u2713 Text shows 'Period: January 2024' -> extract '2024-01-31'\\n\\nAVOID:\\n \\u2717 Do NOT extract statement start dates as end dates\\n \\u2717 Do NOT extract statement generation dates as period end dates\"}, \"statement_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the statement was generated or issued in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Statement Date', 'Date', 'Date of Statement', 'Generated', 'Issue Date', 'As of'\\n\\nLOCATION: Typically in the account information section, often near the statement period.; May appear in the header area or near the account number.; Look for statement generation or issue dates.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If statement date is not shown, return null.\\n\\nEDGE CASES:\\n - Statement date is typically on or after the statement period end date.\\n - Some statements use 'As of' dates - extract as shown if that's the statement date.\\n - Two-digit years: Expand appropriately.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Statement Date: February 5, 2024' -> extract '2024-02-05'\\n \\u2713 Text shows 'Date: 02/05/2024' -> extract '2024-02-05'\\n \\u2713 Text shows 'As of: January 31, 2024' -> extract '2024-01-31'\\n\\nAVOID:\\n \\u2717 Do NOT extract statement period dates as statement generation dates\\n \\u2717 Do NOT extract transaction dates as statement dates\"}, \"opening_balance\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The account balance at the beginning of the statement period (if shown).\\n\\nCOMMON LABELS: 'Beginning Balance', 'Opening Balance', 'Starting Balance', 'Previous Balance', 'Balance Forward', 'Balance Brought Forward'\\n\\nLOCATION: Typically in a balance summary section, often near the statement period dates.; May appear in the account summary or balance information area.; Look for opening/beginning balances in summary sections.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. Negative balances should be represented with a leading minus sign. If opening balance is not shown, return null.\\n\\nEDGE CASES:\\n - Opening balances may be positive or negative - preserve the sign.\\n - Zero balances: Return 0.00 (not null).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Beginning Balance: $1,000.00' -> extract 1000.00\\n \\u2713 Text shows 'Opening Balance: ($500.00)' -> extract -500.00\\n \\u2713 Text shows 'Balance Forward: 0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract closing balances as opening balances\\n \\u2717 Do NOT extract available balances as opening balances\"}, \"closing_balance\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The account balance at the end of the statement period (if shown).\\n\\nCOMMON LABELS: 'Ending Balance', 'Closing Balance', 'Final Balance', 'Current Balance', 'Statement Balance', 'Balance', 'Balance as of'\\n\\nLOCATION: Typically in a balance summary section, often near the statement period end date.; May appear prominently in the account summary area.; Look for ending/closing balances in summary sections.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. Negative balances should be represented with a leading minus sign. If closing balance is not shown, return null.\\n\\nEDGE CASES:\\n - Closing balances may be positive or negative - preserve the sign.\\n - Zero balances: Return 0.00 (not null).\\n - Closing balance should equal: Opening Balance + Credits - Debits (within rounding tolerance).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Ending Balance: $1,500.00' -> extract 1500.00\\n \\u2713 Text shows 'Closing Balance: ($200.00)' -> extract -200.00\\n \\u2713 Text shows 'Current Balance: 0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract opening balances as closing balances\\n \\u2717 Do NOT extract available balances as closing balances (available balance may differ due to pending transactions)\"}, \"total_credits\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total amount of credits (deposits, payments, etc.) during the statement period (if shown separately).\\n\\nCOMMON LABELS: 'Total Credits', 'Total Deposits', 'Credits', 'Deposits', 'Total Additions', 'Payments Received'\\n\\nLOCATION: Typically in a summary section, often near balance information.; May appear in an account summary or activity summary area.; Look for credit/deposit totals in summary sections.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If total credits are not shown separately, return null.\\n\\nEDGE CASES:\\n - Total credits should equal the sum of all credit transactions (within rounding tolerance).\\n - Some statements don't show this separately - return null if not present.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Total Credits: $2,000.00' -> extract 2000.00\\n \\u2713 Text shows 'Deposits: $1,500.00' -> extract 1500.00\\n\\nAVOID:\\n \\u2717 Do NOT extract individual transaction amounts as total credits\\n \\u2717 Do NOT extract closing balances as total credits\"}, \"total_debits\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total amount of debits (withdrawals, charges, etc.) during the statement period (if shown separately).\\n\\nCOMMON LABELS: 'Total Debits', 'Total Withdrawals', 'Debits', 'Withdrawals', 'Total Charges', 'Payments Made'\\n\\nLOCATION: Typically in a summary section, often near balance information.; May appear in an account summary or activity summary area.; Look for debit/withdrawal totals in summary sections.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If total debits are not shown separately, return null.\\n\\nEDGE CASES:\\n - Total debits should equal the sum of all debit transactions (within rounding tolerance).\\n - Some statements don't show this separately - return null if not present.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Total Debits: $500.00' -> extract 500.00\\n \\u2713 Text shows 'Withdrawals: $750.00' -> extract 750.00\\n\\nAVOID:\\n \\u2717 Do NOT extract individual transaction amounts as total debits\\n \\u2717 Do NOT extract closing balances as total debits\"}, \"account_address\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The address associated with the account (if shown on the statement).\\n\\nCOMMON LABELS: 'Address', 'Mailing Address', 'Account Address', 'Customer Address', 'Billing Address'\\n\\nLOCATION: Typically in the account information section, often near the account holder name.; May appear in a customer information area.; Look for addresses in the account information section.\\n\\nFORMAT: Return the complete address as it appears on the document. Common formats: '123 Main St, City, State ZIP' or multi-line addresses. Preserve the format as shown, or join multi-line addresses with commas. If account address is not shown, return null.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Some statements show only city and state - extract as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Address: 123 Main St, Anytown, CA 12345' -> extract '123 Main St, Anytown, CA 12345'\\n \\u2713 Text shows 'Mailing Address:\\\\n123 Main Street\\\\nAnytown, CA 12345' -> extract '123 Main Street, Anytown, CA 12345'\\n\\nAVOID:\\n \\u2717 Do NOT extract institution addresses as account addresses\\n \\u2717 Do NOT extract branch addresses as account addresses\"}, \"transactions\": {\"type\": \"array\", \"datapoint_prompt\": \"All individual transactions (deposits, withdrawals, transfers, payments, etc.) listed on the bank statement during the statement period. Extract ALL transactions in chronological order.\\n\\nLOCATION STRATEGY:\\n- PRIMARY: Main transaction table/list, typically the largest section on the statement\\n- Common labels: 'Transactions', 'Account Activity', 'Activity', 'Transaction Details', 'Transaction History', 'Deposits and Withdrawals'\\n- Usually appears: Middle to lower portion of statement pages\\n- Format: Table with columns for Date, Description, Amount, Balance, etc.\\n\\nEXTRACTION RULES:\\n- Extract ALL transactions - do not skip any transactions\\n- Preserve chronological order (as they appear on the statement, typically by date)\\n- Include ALL transaction types: deposits, withdrawals, transfers, checks, fees, interest, etc.\\n- For each transaction, extract: date, description, amount (positive for credits/deposits, negative for debits/withdrawals), and optionally balance\\n\\nCOMMON TRANSACTION TYPES:\\n- Deposits: Direct deposits, transfers in, cash deposits\\n- Withdrawals: ATM withdrawals, transfers out, cash withdrawals\\n- Checks: Check payments (may show check numbers)\\n- Fees: Service charges, maintenance fees, overdraft fees\\n- Interest: Interest earned, interest paid\\n- Payments: Bill payments, automatic payments\\n- Other: Adjustments, reversals, etc.\\n\\nFORMAT: Return an array of transaction objects in chronological order (as they appear on the statement). Each item should include:\\n- date: Transaction date in YYYY-MM-DD format\\n- description: Transaction description/payee as it appears (e.g., 'DEPOSIT', 'ATM WITHDRAWAL', 'CHECK #123', 'PAYMENT TO ABC COMPANY')\\n- amount: Numeric amount (positive for credits/deposits, negative for debits/withdrawals)\\n- balance: Optional running balance after this transaction if shown\\n\\nEDGE CASES:\\n- Multiple transactions on the same date: Include all of them, preserve order\\n- Amount format: Deposits/credits should be positive, withdrawals/debits should be negative\\n- Descriptions may be abbreviated or use codes - extract as shown\\n- Some statements show running balances, some don't - include balance if available\\n- Check numbers may be part of description (e.g., 'CHECK #123') - preserve in description\\n- If transactions span multiple pages, extract all pages in order\\n\\nEXAMPLES:\\n \\u2713 {date: '2024-01-15', description: 'DEPOSIT', amount: 1000.00, balance: 5000.00}\\n \\u2713 {date: '2024-01-16', description: 'ATM WITHDRAWAL', amount: -100.00, balance: 4900.00}\\n \\u2713 {date: '2024-01-17', description: 'CHECK #123', amount: -250.00, balance: 4650.00}\\n \\u2713 {date: '2024-01-18', description: 'PAYMENT TO ABC COMPANY', amount: -150.00}\\n\\nAVOID:\\n \\u2717 Do NOT skip transactions even if they seem minor\\n \\u2717 Do NOT extract summary totals as individual transactions\\n \\u2717 Do NOT extract opening/closing balances as transactions\\n \\u2717 Do NOT reorder items - preserve the chronological order as shown on the statement\", \"items\": {\"type\": \"object\", \"properties\": {\"date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"Transaction date in YYYY-MM-DD format\"}, \"description\": {\"type\": \"string\", \"datapoint_prompt\": \"Transaction description/payee EXACTLY as it appears on the statement. Include all details: payee names, transaction types, check numbers, etc. Preserve the exact text as shown.\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Transaction amount as a numeric value. Format: positive number for credits/deposits, negative number for debits/withdrawals (e.g., 1000.00 for deposit, -100.00 for withdrawal). Format: numeric decimal with two decimal places.\"}, \"balance\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Running balance after this transaction if shown on the statement. Format: numeric decimal with two decimal places. Return null if balance is not shown per transaction.\"}}, \"required\": [\"date\", \"description\", \"amount\"]}}}, \"required\": [\"institution_name\", \"account_holder_name\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"statement_period_start\", \"end_field\": \"statement_period_end\", \"max_days\": 93, \"message\": \"Statement period should be within 93 days (approximately 3 months)\"}, {\"type\": \"date_comparison\", \"field1\": \"statement_period_end\", \"field2\": \"statement_date\", \"comparison\": \"before_or_equal\", \"message\": \"Statement period end date should be before or equal to statement date (statements are generated after the period ends)\"}, {\"type\": \"approximate_match\", \"fields\": [\"opening_balance\", \"total_credits\", \"total_debits\", \"closing_balance\"], \"tolerance\": 0.01, \"message\": \"Closing balance should approximately equal: Opening Balance + Total Credits - Total Debits (within $0.01 rounding tolerance)\"}]}}", "true_json_output": "{\"institution_name\": \"Commerce Bank\", \"statement_type\": \"Bank Statement\", \"account_holder_name\": \"Jane Customer\", \"account_number\": \"000009752\", \"statement_period_start\": \"2003-05-03\", \"statement_period_end\": \"2003-06-05\", \"statement_date\": \"2003-06-05\", \"opening_balance\": 7126.11, \"closing_balance\": 10521.19, \"total_credits\": 3615.08, \"total_debits\": null, \"account_address\": \"1234 Anywhere Dr., Small Town, MO 12345-6789\", \"transactions\": [{\"date\": \"2003-05-15\", \"description\": \"Deposit (Ref Nbr 130012345)\", \"amount\": 3615.08, \"balance\": null}, {\"date\": \"2003-05-19\", \"description\": \"ATM Withdrawal / 1000 Walnut St M119 / Kansas City MO 00005678\", \"amount\": -20.0, \"balance\": null}, {\"date\": \"2003-05-12\", \"description\": \"Check 1001 (Reference Number 00012576589)\", \"amount\": -75.0, \"balance\": null}, {\"date\": \"2003-05-18\", \"description\": \"Check 1002 (Reference Number 00036547854)\", \"amount\": -30.0, \"balance\": null}, {\"date\": \"2003-05-24\", \"description\": \"Check 1003 (Reference Number 00094613547)\", \"amount\": -200.0, \"balance\": null}], \"source_filename\": \"statement_1.pdf\"}", "true_markdown_output": "**Institution Name:** Commerce Bank\n**Statement Type:** Bank Statement\n**Account Holder Name:** Jane Customer\n**Account Number:** 000009752\n**Statement Period Start:** 2003-05-03\n**Statement Period End:** 2003-06-05\n**Statement Date:** 2003-06-05\n**Opening Balance:** 7126.11\n**Closing Balance:** 10521.19\n**Total Credits:** 3615.08\n**Total Debits:** N/A\n**Account Address:** 1234 Anywhere Dr., Small Town, MO 12345-6789\n**Transactions:**\n **Date:** 2003-05-15\n **Description:** Deposit (Ref Nbr 130012345)\n **Amount:** 3615.08\n **Balance:** N/A\n **Date:** 2003-05-19\n **Description:** ATM Withdrawal / 1000 Walnut St M119 / Kansas City MO 00005678\n **Amount:** -20.0\n **Balance:** N/A\n **Date:** 2003-05-12\n **Description:** Check 1001 (Reference Number 00012576589)\n **Amount:** -75.0\n **Balance:** N/A\n **Date:** 2003-05-18\n **Description:** Check 1002 (Reference Number 00036547854)\n **Amount:** -30.0\n **Balance:** N/A\n **Date:** 2003-05-24\n **Description:** Check 1003 (Reference Number 00094613547)\n **Amount:** -200.0\n **Balance:** N/A"} {"file_name": "images/statement_2.png", "id": 15, "metadata": "{\"format\": \"STATEMENT\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"statement_2.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"institution_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the financial institution, company, or organization that issued the statement.\\n\\nCOMMON LABELS: Institution name typically appears prominently in the header/logo area at the top of the statement.\\n\\nLOCATION: Top-center or top-left of the first page, typically in the header area with the institution logo.; Within the first 10-20% of page height, centered or left-aligned.; May appear in larger, bold font near the statement title.; Often appears with the institution logo or branding.\\n\\nFORMAT: Return the institution name as it appears on the document. Common formats: 'Bank of America', 'Chase Bank', 'ABC Credit Union', 'XYZ Investment Company'. Preserve capitalization and abbreviations. Prefer the brand/institution name over the full legal entity name if both appear.\\n\\nEDGE CASES:\\n - If multiple variations appear (e.g., 'Bank of America, N.A.' and 'Bank of America'), prefer the shorter brand name if clear.\\n - Institution names may include legal designations (N.A., Inc., LLC) - preserve as shown or extract the core brand name.\\n - If the institution name appears with a logo only (no text), this field may be difficult to extract from text alone - return the clearest text representation if available.\\n\\nEXAMPLES:\\n \\u2713 Document shows 'BANK OF AMERICA' in large header text -> extract 'BANK OF AMERICA' or 'Bank of America'\\n \\u2713 Document shows 'Chase Bank' in header -> extract 'Chase Bank'\\n \\u2713 Document shows 'ABC CREDIT UNION' -> extract 'ABC CREDIT UNION' or 'ABC Credit Union'\\n\\nAVOID:\\n \\u2717 Do NOT extract account holder names as the institution name\\n \\u2717 Do NOT extract branch names or location names as the institution name\\n \\u2717 Do NOT extract department names as the institution name\"}, \"statement_type\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The type of statement (e.g., 'Account Statement', 'Credit Card Statement', 'Investment Statement', 'Loan Statement', 'Savings Statement').\\n\\nCOMMON LABELS: Statement type typically appears in the document title or header (e.g., 'Account Statement', 'Monthly Statement', 'Credit Card Statement').\\n\\nLOCATION: Typically in the document title or header area, often near the institution name.; May appear prominently at the top of the first page.; Look for statement type designations in the title or header.\\n\\nFORMAT: Return the statement type as it appears or in a normalized form. Common values: 'Account Statement', 'Credit Card Statement', 'Investment Statement', 'Loan Statement', 'Savings Statement', 'Checking Statement', 'Monthly Statement'. Preserve the format as shown. If statement type is not clearly identifiable, return null.\\n\\nEDGE CASES:\\n - Statement types may be part of the document title (e.g., 'Monthly Account Statement') - extract the type designation.\\n - Some statements don't explicitly label the type - return null if unclear.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Monthly Account Statement' -> extract 'Account Statement' or 'Monthly Account Statement'\\n \\u2713 Text shows 'Credit Card Statement' -> extract 'Credit Card Statement'\\n \\u2713 Text shows no clear statement type -> extract null\\n\\nAVOID:\\n \\u2717 Do NOT extract account types as statement types (e.g., 'Checking' when the statement type is 'Account Statement')\"}, \"account_holder_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the account holder or account owner.\\n\\nCOMMON LABELS: 'Account Holder', 'Name', 'Account Name', 'Customer Name', 'Account Owner', 'Primary Account Holder', 'Name:', 'Account Holder:'\\n\\nLOCATION: Top section of the first page, typically in the account information or customer information section.; Often appears near the account number and statement period.; Usually in the upper-left or upper-center area.; Look for account holder names in the account information area.\\n\\nFORMAT: Return the account holder name exactly as it appears on the document. Common formats:\\n - Full name: 'John Doe'\\n - With middle name/initial: 'John Michael Doe' or 'John M. Doe'\\n - Last name first: 'Doe, John'\\n - Business/entity names: 'ABC Corporation'\\nPreserve capitalization, punctuation, and formatting. Include suffixes (Jr., Sr., etc.) if present.\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may include suffixes (Jr., Sr., II, III) - include them if present.\\n - Some statements show last name first (e.g., 'DOE, JOHN') - preserve the format as shown.\\n - Names may be in all uppercase on statements - preserve the capitalization.\\n - Business/entity names may include legal designations - preserve as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Account Holder: John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'Name: DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'Customer Name: Jane Smith Jr.' -> extract 'Jane Smith Jr.'\\n\\nAVOID:\\n \\u2717 Do NOT extract only first name or only last name - extract the complete name\\n \\u2717 Do NOT extract institution names as account holder names\"}, \"account_number\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The account number or account identifier associated with this statement.\\n\\nCOMMON LABELS: 'Account Number', 'Account No.', 'Account #', 'Acct Number', 'Acct No.', 'Acct #', 'Account', 'Acct'\\n\\nLOCATION: Top section of the first page, typically in the account information section.; Often appears near the account holder name and statement period.; May be in the upper-left or upper-center area.; Look for account numbers in the account information area.\\n\\nFORMAT: Return the account number exactly as it appears on the document. Account numbers may be numeric, alphanumeric, or include dashes/spaces. Preserve any formatting, masking characters (asterisks, X's), or spacing as shown. If account number is not shown (some statements mask it for security), return null.\\n\\nEDGE CASES:\\n - Account numbers may be masked for security (e.g., '****1234', 'XXXX5678') - preserve the masking format if shown.\\n - Account numbers may include dashes or spaces - preserve as shown.\\n - Some statements show only the last 4 digits - extract as shown.\\n - Do not confuse with other identifiers like routing numbers, reference numbers, or statement numbers.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Account Number: 123456789' -> extract '123456789'\\n \\u2713 Text shows 'Acct #: 1234-5678-90' -> extract '1234-5678-90'\\n \\u2713 Text shows 'Account: ****1234' -> extract '****1234'\\n\\nAVOID:\\n \\u2717 Do NOT extract routing numbers or other identifiers as account numbers\\n \\u2717 Do NOT extract statement numbers or reference numbers as account numbers\"}, \"statement_period_start\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The start date of the statement period in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Statement Period', 'Period', 'From', 'From Date', 'Statement Date From', 'Period From', 'Period Start'\\n\\nLOCATION: Top section of the first page, typically in the account information or statement period section.; Often appears as a date range (e.g., 'Statement Period: 01/01/2024 - 01/31/2024').; May be in the upper portion of the page.; Look for date ranges or period start dates.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If statement period is shown as a range, extract the start/from date. If statement period start is not shown, return null.\\n\\nEDGE CASES:\\n - Statement periods may be shown as date ranges - extract the first date (start date).\\n - Some statements show only month and year (e.g., 'January 2024') - use the first day of that month (e.g., '2024-01-01').\\n - Two-digit years: Expand appropriately.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Statement Period: 01/01/2024 - 01/31/2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'From: January 1, 2024' -> extract '2024-01-01'\\n \\u2713 Text shows 'Period: January 2024' -> extract '2024-01-01'\\n\\nAVOID:\\n \\u2717 Do NOT extract statement end dates as start dates\\n \\u2717 Do NOT extract statement generation dates as period start dates\"}, \"statement_period_end\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The end date of the statement period in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Statement Period', 'Period', 'To', 'To Date', 'Statement Date To', 'Period To', 'Period End', 'Through'\\n\\nLOCATION: Top section of the first page, typically in the account information or statement period section.; Often appears as a date range (e.g., 'Statement Period: 01/01/2024 - 01/31/2024').; May be in the upper portion of the page.; Look for date ranges or period end dates.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If statement period is shown as a date range, extract the end/to date. If statement period end is not shown, return null.\\n\\nEDGE CASES:\\n - Statement periods may be shown as date ranges - extract the second date (end date).\\n - Some statements show only month and year (e.g., 'January 2024') - use the last day of that month (e.g., '2024-01-31').\\n - The end date should be after or equal to the start date.\\n - Two-digit years: Expand appropriately.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Statement Period: 01/01/2024 - 01/31/2024' -> extract '2024-01-31'\\n \\u2713 Text shows 'To: January 31, 2024' -> extract '2024-01-31'\\n \\u2713 Text shows 'Period: January 2024' -> extract '2024-01-31'\\n\\nAVOID:\\n \\u2717 Do NOT extract statement start dates as end dates\\n \\u2717 Do NOT extract statement generation dates as period end dates\"}, \"statement_date\": {\"type\": [\"string\", \"null\"], \"format\": \"date\", \"datapoint_prompt\": \"The date when the statement was generated or issued in YYYY-MM-DD format.\\n\\nCOMMON LABELS: 'Statement Date', 'Date', 'Date of Statement', 'Generated', 'Issue Date', 'As of'\\n\\nLOCATION: Typically in the account information section, often near the statement period.; May appear in the header area or near the account number.; Look for statement generation or issue dates.\\n\\nFORMAT: Return date in ISO format YYYY-MM-DD (4-digit year). Normalize common input formats. If statement date is not shown, return null.\\n\\nEDGE CASES:\\n - Statement date is typically on or after the statement period end date.\\n - Some statements use 'As of' dates - extract as shown if that's the statement date.\\n - Two-digit years: Expand appropriately.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Statement Date: February 5, 2024' -> extract '2024-02-05'\\n \\u2713 Text shows 'Date: 02/05/2024' -> extract '2024-02-05'\\n \\u2713 Text shows 'As of: January 31, 2024' -> extract '2024-01-31'\\n\\nAVOID:\\n \\u2717 Do NOT extract statement period dates as statement generation dates\\n \\u2717 Do NOT extract transaction dates as statement dates\"}, \"opening_balance\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The account balance at the beginning of the statement period (if shown).\\n\\nCOMMON LABELS: 'Beginning Balance', 'Opening Balance', 'Starting Balance', 'Previous Balance', 'Balance Forward', 'Balance Brought Forward'\\n\\nLOCATION: Typically in a balance summary section, often near the statement period dates.; May appear in the account summary or balance information area.; Look for opening/beginning balances in summary sections.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. Negative balances should be represented with a leading minus sign. If opening balance is not shown, return null.\\n\\nEDGE CASES:\\n - Opening balances may be positive or negative - preserve the sign.\\n - Zero balances: Return 0.00 (not null).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Beginning Balance: $1,000.00' -> extract 1000.00\\n \\u2713 Text shows 'Opening Balance: ($500.00)' -> extract -500.00\\n \\u2713 Text shows 'Balance Forward: 0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract closing balances as opening balances\\n \\u2717 Do NOT extract available balances as opening balances\"}, \"closing_balance\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The account balance at the end of the statement period (if shown).\\n\\nCOMMON LABELS: 'Ending Balance', 'Closing Balance', 'Final Balance', 'Current Balance', 'Statement Balance', 'Balance', 'Balance as of'\\n\\nLOCATION: Typically in a balance summary section, often near the statement period end date.; May appear prominently in the account summary area.; Look for ending/closing balances in summary sections.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. Negative balances should be represented with a leading minus sign. If closing balance is not shown, return null.\\n\\nEDGE CASES:\\n - Closing balances may be positive or negative - preserve the sign.\\n - Zero balances: Return 0.00 (not null).\\n - Closing balance should equal: Opening Balance + Credits - Debits (within rounding tolerance).\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Ending Balance: $1,500.00' -> extract 1500.00\\n \\u2713 Text shows 'Closing Balance: ($200.00)' -> extract -200.00\\n \\u2713 Text shows 'Current Balance: 0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract opening balances as closing balances\\n \\u2717 Do NOT extract available balances as closing balances (available balance may differ due to pending transactions)\"}, \"total_credits\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total amount of credits (deposits, payments, etc.) during the statement period (if shown separately).\\n\\nCOMMON LABELS: 'Total Credits', 'Total Deposits', 'Credits', 'Deposits', 'Total Additions', 'Payments Received'\\n\\nLOCATION: Typically in a summary section, often near balance information.; May appear in an account summary or activity summary area.; Look for credit/deposit totals in summary sections.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If total credits are not shown separately, return null.\\n\\nEDGE CASES:\\n - Total credits should equal the sum of all credit transactions (within rounding tolerance).\\n - Some statements don't show this separately - return null if not present.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Total Credits: $2,000.00' -> extract 2000.00\\n \\u2713 Text shows 'Deposits: $1,500.00' -> extract 1500.00\\n\\nAVOID:\\n \\u2717 Do NOT extract individual transaction amounts as total credits\\n \\u2717 Do NOT extract closing balances as total credits\"}, \"total_debits\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"The total amount of debits (withdrawals, charges, etc.) during the statement period (if shown separately).\\n\\nCOMMON LABELS: 'Total Debits', 'Total Withdrawals', 'Debits', 'Withdrawals', 'Total Charges', 'Payments Made'\\n\\nLOCATION: Typically in a summary section, often near balance information.; May appear in an account summary or activity summary area.; Look for debit/withdrawal totals in summary sections.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If total debits are not shown separately, return null.\\n\\nEDGE CASES:\\n - Total debits should equal the sum of all debit transactions (within rounding tolerance).\\n - Some statements don't show this separately - return null if not present.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Total Debits: $500.00' -> extract 500.00\\n \\u2713 Text shows 'Withdrawals: $750.00' -> extract 750.00\\n\\nAVOID:\\n \\u2717 Do NOT extract individual transaction amounts as total debits\\n \\u2717 Do NOT extract closing balances as total debits\"}, \"account_address\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The address associated with the account (if shown on the statement).\\n\\nCOMMON LABELS: 'Address', 'Mailing Address', 'Account Address', 'Customer Address', 'Billing Address'\\n\\nLOCATION: Typically in the account information section, often near the account holder name.; May appear in a customer information area.; Look for addresses in the account information section.\\n\\nFORMAT: Return the complete address as it appears on the document. Common formats: '123 Main St, City, State ZIP' or multi-line addresses. Preserve the format as shown, or join multi-line addresses with commas. If account address is not shown, return null.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Some statements show only city and state - extract as shown.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'Address: 123 Main St, Anytown, CA 12345' -> extract '123 Main St, Anytown, CA 12345'\\n \\u2713 Text shows 'Mailing Address:\\\\n123 Main Street\\\\nAnytown, CA 12345' -> extract '123 Main Street, Anytown, CA 12345'\\n\\nAVOID:\\n \\u2717 Do NOT extract institution addresses as account addresses\\n \\u2717 Do NOT extract branch addresses as account addresses\"}, \"transactions\": {\"type\": \"array\", \"datapoint_prompt\": \"All individual transactions (deposits, withdrawals, transfers, payments, etc.) listed on the bank statement during the statement period. Extract ALL transactions in chronological order.\\n\\nLOCATION STRATEGY:\\n- PRIMARY: Main transaction table/list, typically the largest section on the statement\\n- Common labels: 'Transactions', 'Account Activity', 'Activity', 'Transaction Details', 'Transaction History', 'Deposits and Withdrawals'\\n- Usually appears: Middle to lower portion of statement pages\\n- Format: Table with columns for Date, Description, Amount, Balance, etc.\\n\\nEXTRACTION RULES:\\n- Extract ALL transactions - do not skip any transactions\\n- Preserve chronological order (as they appear on the statement, typically by date)\\n- Include ALL transaction types: deposits, withdrawals, transfers, checks, fees, interest, etc.\\n- For each transaction, extract: date, description, amount (positive for credits/deposits, negative for debits/withdrawals), and optionally balance\\n\\nCOMMON TRANSACTION TYPES:\\n- Deposits: Direct deposits, transfers in, cash deposits\\n- Withdrawals: ATM withdrawals, transfers out, cash withdrawals\\n- Checks: Check payments (may show check numbers)\\n- Fees: Service charges, maintenance fees, overdraft fees\\n- Interest: Interest earned, interest paid\\n- Payments: Bill payments, automatic payments\\n- Other: Adjustments, reversals, etc.\\n\\nFORMAT: Return an array of transaction objects in chronological order (as they appear on the statement). Each item should include:\\n- date: Transaction date in YYYY-MM-DD format\\n- description: Transaction description/payee as it appears (e.g., 'DEPOSIT', 'ATM WITHDRAWAL', 'CHECK #123', 'PAYMENT TO ABC COMPANY')\\n- amount: Numeric amount (positive for credits/deposits, negative for debits/withdrawals)\\n- balance: Optional running balance after this transaction if shown\\n\\nEDGE CASES:\\n- Multiple transactions on the same date: Include all of them, preserve order\\n- Amount format: Deposits/credits should be positive, withdrawals/debits should be negative\\n- Descriptions may be abbreviated or use codes - extract as shown\\n- Some statements show running balances, some don't - include balance if available\\n- Check numbers may be part of description (e.g., 'CHECK #123') - preserve in description\\n- If transactions span multiple pages, extract all pages in order\\n\\nEXAMPLES:\\n \\u2713 {date: '2024-01-15', description: 'DEPOSIT', amount: 1000.00, balance: 5000.00}\\n \\u2713 {date: '2024-01-16', description: 'ATM WITHDRAWAL', amount: -100.00, balance: 4900.00}\\n \\u2713 {date: '2024-01-17', description: 'CHECK #123', amount: -250.00, balance: 4650.00}\\n \\u2713 {date: '2024-01-18', description: 'PAYMENT TO ABC COMPANY', amount: -150.00}\\n\\nAVOID:\\n \\u2717 Do NOT skip transactions even if they seem minor\\n \\u2717 Do NOT extract summary totals as individual transactions\\n \\u2717 Do NOT extract opening/closing balances as transactions\\n \\u2717 Do NOT reorder items - preserve the chronological order as shown on the statement\", \"items\": {\"type\": \"object\", \"properties\": {\"date\": {\"type\": \"string\", \"format\": \"date\", \"datapoint_prompt\": \"Transaction date in YYYY-MM-DD format\"}, \"description\": {\"type\": \"string\", \"datapoint_prompt\": \"Transaction description/payee EXACTLY as it appears on the statement. Include all details: payee names, transaction types, check numbers, etc. Preserve the exact text as shown.\"}, \"amount\": {\"type\": \"number\", \"datapoint_prompt\": \"Transaction amount as a numeric value. Format: positive number for credits/deposits, negative number for debits/withdrawals (e.g., 1000.00 for deposit, -100.00 for withdrawal). Format: numeric decimal with two decimal places.\"}, \"balance\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Running balance after this transaction if shown on the statement. Format: numeric decimal with two decimal places. Return null if balance is not shown per transaction.\"}}, \"required\": [\"date\", \"description\", \"amount\"]}}}, \"required\": [\"institution_name\", \"account_holder_name\"], \"validation\": {\"cross_field\": [{\"type\": \"date_range\", \"start_field\": \"statement_period_start\", \"end_field\": \"statement_period_end\", \"max_days\": 93, \"message\": \"Statement period should be within 93 days (approximately 3 months)\"}, {\"type\": \"date_comparison\", \"field1\": \"statement_period_end\", \"field2\": \"statement_date\", \"comparison\": \"before_or_equal\", \"message\": \"Statement period end date should be before or equal to statement date (statements are generated after the period ends)\"}, {\"type\": \"approximate_match\", \"fields\": [\"opening_balance\", \"total_credits\", \"total_debits\", \"closing_balance\"], \"tolerance\": 0.01, \"message\": \"Closing balance should approximately equal: Opening Balance + Total Credits - Total Debits (within $0.01 rounding tolerance)\"}]}}", "true_json_output": "{\"institution_name\": \"BANK\", \"statement_type\": \"Account Statement\", \"account_holder_name\": null, \"account_number\": \"98765432\", \"statement_period_start\": null, \"statement_period_end\": null, \"statement_date\": null, \"opening_balance\": null, \"closing_balance\": 1339.05, \"total_credits\": 1281.36, \"total_debits\": 1515.77, \"account_address\": null, \"transactions\": [{\"date\": \"4/3\", \"description\": \"Deposit\", \"amount\": 15.0, \"balance\": null}, {\"date\": \"4/15\", \"description\": \"Automatic Deposit\", \"amount\": 1266.36, \"balance\": null}, {\"date\": \"4/1\", \"description\": \"Check 200\", \"amount\": 1200.5, \"balance\": null}, {\"date\": \"4/28\", \"description\": \"Automatic payment - Car Company\", \"amount\": 178.0, \"balance\": null}, {\"date\": \"4/16\", \"description\": \"Cash\", \"amount\": 100.0, \"balance\": null}, {\"date\": \"4/25\", \"description\": \"Debit- Grocery Store\", \"amount\": 37.27, \"balance\": null}], \"source_filename\": \"statement_2.pdf\"}", "true_markdown_output": "**Institution Name:** BANK\n**Statement Type:** Account Statement\n**Account Holder Name:** N/A\n**Account Number:** 98765432\n**Statement Period Start:** N/A\n**Statement Period End:** N/A\n**Statement Date:** N/A\n**Opening Balance:** N/A\n**Closing Balance:** 1339.05\n**Total Credits:** 1281.36\n**Total Debits:** 1515.77\n**Account Address:** N/A\n**Transactions:**\n **Date:** 4/3\n **Description:** Deposit\n **Amount:** 15.0\n **Balance:** N/A\n **Date:** 4/15\n **Description:** Automatic Deposit\n **Amount:** 1266.36\n **Balance:** N/A\n **Date:** 4/1\n **Description:** Check 200\n **Amount:** 1200.5\n **Balance:** N/A\n **Date:** 4/28\n **Description:** Automatic payment - Car Company\n **Amount:** 178.0\n **Balance:** N/A\n **Date:** 4/16\n **Description:** Cash\n **Amount:** 100.0\n **Balance:** N/A\n **Date:** 4/25\n **Description:** Debit- Grocery Store\n **Amount:** 37.27\n **Balance:** N/A"} {"file_name": "images/w_2_1.png", "id": 16, "metadata": "{\"format\": \"W2\", \"documentQuality\": \"CLEAN\", \"source_filename\": \"w_2_1.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"employer_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the employer (company/business that issued the W-2 form).\\n\\nCOMMON LABELS: Employer name appears in Box 'b' or in the employer information section of the W-2 form.\\n\\nLOCATION: Typically in Box 'b' labeled 'Employer's name, address, and ZIP code' on the W-2 form.; Usually in the upper-left portion of the form, in the employer information section.; Look for the employer name in the employer information area (Box b).\\n\\nFORMAT: Return the employer name as it appears on the W-2 form. Common formats: 'ABC Corporation', 'XYZ Industries Inc.', 'ABC Company'. Preserve capitalization and abbreviations. Include legal designations (Inc., Corp., LLC) if they're part of the employer name.\\n\\nEDGE CASES:\\n - Employer names may include legal designations - preserve as shown.\\n - Employer names may appear with addresses - extract only the employer name (company name), not the address.\\n\\nEXAMPLES:\\n \\u2713 Box b shows 'ABC CORPORATION' -> extract 'ABC CORPORATION' or 'ABC Corporation'\\n \\u2713 Box b shows 'XYZ Industries Inc.' -> extract 'XYZ Industries Inc.'\\n\\nAVOID:\\n \\u2717 Do NOT extract employer addresses as part of the employer name\\n \\u2717 Do NOT extract employee names as employer names\\n \\u2717 Do NOT extract EIN numbers or other identifiers as employer names\"}, \"employer_ein\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The Employer Identification Number (EIN) - the employer's federal tax ID number.\\n\\nCOMMON LABELS: 'EIN', 'Employer identification number', appears in Box 'b' area or employer information section.\\n\\nLOCATION: Typically in the employer information section, often near the employer name.; May appear in Box 'b' area or in the employer identification field.; Look for EIN numbers in the employer information area.\\n\\nFORMAT: Return the EIN exactly as it appears. EINs are typically formatted as XX-XXXXXXX (two digits, dash, seven digits). Preserve any formatting, dashes, or spacing as shown. If EIN is not shown, return null.\\n\\nEDGE CASES:\\n - EINs may be formatted with or without dashes - preserve as shown.\\n - EINs are 9-digit numbers, typically shown as XX-XXXXXXX.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'EIN: 12-3456789' -> extract '12-3456789'\\n \\u2713 Text shows '12-3456789' -> extract '12-3456789'\\n\\nAVOID:\\n \\u2717 Do NOT extract employee SSN as EIN\\n \\u2717 Do NOT extract other tax IDs as EIN\"}, \"employee_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the employee (the person who received the W-2 form).\\n\\nCOMMON LABELS: Employee name appears in the employee information section, typically labeled or in Box 'e' area.\\n\\nLOCATION: Typically in the employee information section, usually in the left portion of the W-2 form.; Often appears in Box 'e' area or employee name field.; Look for employee names in the employee information area.\\n\\nFORMAT: Return the employee name exactly as it appears on the W-2 form. Common formats: 'John Doe', 'John M. Doe', 'Doe, John'. Preserve capitalization and formatting. Include middle names/initials if present.\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may be shown last name first (e.g., 'Doe, John') - preserve the format as shown.\\n - Names may be in all uppercase on W-2 forms - preserve the capitalization.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'John M. Doe' -> extract 'John M. Doe'\\n\\nAVOID:\\n \\u2717 Do NOT extract employer names as employee names\\n \\u2717 Do NOT extract only last name when full name is provided\"}, \"employee_ssn\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The employee's Social Security Number (SSN).\\n\\nCOMMON LABELS: 'SSN', 'Social Security Number', appears in Box 'a' or employee information section.\\n\\nLOCATION: Typically in Box 'a' labeled 'Employee's social security number' on the W-2 form.; Usually in the employee information section, often near the employee name.; Look for SSN in Box 'a' or employee information area.\\n\\nFORMAT: Return the SSN exactly as it appears. SSNs are typically formatted as XXX-XX-XXXX (three digits, dash, two digits, dash, four digits). Preserve any formatting, dashes, or spacing as shown. If SSN is masked or not shown (for privacy), return null.\\n\\nEDGE CASES:\\n - SSNs may be formatted with or without dashes - preserve as shown.\\n - SSNs are 9-digit numbers, typically shown as XXX-XX-XXXX.\\n - Some forms may mask SSNs (e.g., 'XXX-XX-1234') - extract as shown or return null if fully masked.\\n\\nEXAMPLES:\\n \\u2713 Box a shows '123-45-6789' -> extract '123-45-6789'\\n \\u2713 Text shows 'SSN: 123-45-6789' -> extract '123-45-6789'\\n\\nAVOID:\\n \\u2717 Do NOT extract employer EIN as employee SSN\\n \\u2717 Do NOT extract other identifiers as SSN\"}, \"employee_address\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The employee's address (if shown on the W-2 form).\\n\\nCOMMON LABELS: Employee address appears in the employee information section, typically in Box 'f' or employee address field.\\n\\nLOCATION: Typically in Box 'f' labeled 'Employee's address and ZIP code' or in the employee information section.; Usually in the employee information area, often below the employee name.; Look for employee addresses in the employee information area.\\n\\nFORMAT: Return the complete address as it appears on the W-2 form. Common formats: '123 Main St, City, State ZIP' or multi-line addresses. Preserve the format as shown, or join multi-line addresses with commas. If employee address is not shown, return null.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Addresses may include apartment numbers or unit numbers - include if present.\\n\\nEXAMPLES:\\n \\u2713 Box f shows '123 Main St, Anytown, CA 12345' -> extract '123 Main St, Anytown, CA 12345'\\n \\u2713 Text shows multi-line address -> join with commas\\n\\nAVOID:\\n \\u2717 Do NOT extract employer addresses as employee addresses\\n \\u2717 Do NOT extract city/state/zip only when full address is shown\"}, \"tax_year\": {\"type\": \"string\", \"datapoint_prompt\": \"The tax year for which the W-2 form was issued.\\n\\nCOMMON LABELS: Tax year appears prominently on the W-2 form, typically labeled 'For calendar year' or shown in the form title/header.\\n\\nLOCATION: Typically in the form header or title area, often labeled 'For calendar year [YEAR]' or 'Tax Year [YEAR]'.; May appear prominently at the top of the form.; Look for tax year designations in the header or title area.\\n\\nFORMAT: Return the tax year as a 4-digit year (e.g., '2024', '2023'). If the year is shown as two digits, expand to 4 digits (e.g., '24' -> '2024'). Preserve as a string.\\n\\nEDGE CASES:\\n - Tax years are calendar years (e.g., 2024, 2023).\\n - Two-digit years: Expand to 4 digits (e.g., '24' -> '2024').\\n\\nEXAMPLES:\\n \\u2713 Text shows 'For calendar year 2024' -> extract '2024'\\n \\u2713 Text shows 'Tax Year: 2023' -> extract '2023'\\n \\u2713 Text shows '2024' in header -> extract '2024'\\n\\nAVOID:\\n \\u2717 Do NOT extract form copy numbers or other numbers as tax year\\n \\u2717 Do NOT extract dates (like issue dates) as tax year\"}, \"wages_tips_other_compensation\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Wages, tips, and other compensation (Box 1 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Wages, tips, other compensation', appears in Box '1' on the W-2 form.\\n\\nLOCATION: Box '1' on the W-2 form, labeled 'Wages, tips, other compensation'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 1 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$50,000.00' -> 50000.00). If the amount is not shown or Box 1 is empty, return null.\\n\\nEDGE CASES:\\n - This is the total wages/tips/other compensation before deductions.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Box 1 shows '$50,000.00' -> extract 50000.00\\n \\u2713 Box 1 shows '50000.00' -> extract 50000.00\\n \\u2713 Box 1 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract other box amounts as Box 1 amount\\n \\u2717 Do NOT extract federal tax withheld as wages\"}, \"federal_income_tax_withheld\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Federal income tax withheld (Box 2 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Federal income tax withheld', appears in Box '2' on the W-2 form.\\n\\nLOCATION: Box '2' on the W-2 form, labeled 'Federal income tax withheld'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 2 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 2 is empty, return null.\\n\\nEDGE CASES:\\n - This is the amount of federal income tax withheld from wages.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 2 shows '$5,000.00' -> extract 5000.00\\n \\u2713 Box 2 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract state tax withheld as federal tax withheld\\n \\u2717 Do NOT extract Social Security tax as federal income tax\"}, \"social_security_wages\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Social Security wages (Box 3 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Social security wages', appears in Box '3' on the W-2 form.\\n\\nLOCATION: Box '3' on the W-2 form, labeled 'Social security wages'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 3 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 3 is empty, return null.\\n\\nEDGE CASES:\\n - This is wages subject to Social Security tax (may differ from Box 1 if wages exceed the Social Security wage base).\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 3 shows '$50,000.00' -> extract 50000.00\\n \\u2713 Box 3 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract Box 1 wages as Social Security wages (they may differ)\\n \\u2717 Do NOT extract Social Security tax withheld as Social Security wages\"}, \"social_security_tax_withheld\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Social Security tax withheld (Box 4 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Social security tax withheld', appears in Box '4' on the W-2 form.\\n\\nLOCATION: Box '4' on the W-2 form, labeled 'Social security tax withheld'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 4 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 4 is empty, return null.\\n\\nEDGE CASES:\\n - This is the amount of Social Security tax (FICA) withheld.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 4 shows '$3,100.00' -> extract 3100.00\\n \\u2713 Box 4 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract Medicare tax as Social Security tax\\n \\u2717 Do NOT extract Social Security wages as Social Security tax\"}, \"medicare_wages\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Medicare wages and tips (Box 5 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Medicare wages and tips', appears in Box '5' on the W-2 form.\\n\\nLOCATION: Box '5' on the W-2 form, labeled 'Medicare wages and tips'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 5 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 5 is empty, return null.\\n\\nEDGE CASES:\\n - This is wages subject to Medicare tax (typically the same as Box 1, but may differ in some cases).\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 5 shows '$50,000.00' -> extract 50000.00\\n \\u2713 Box 5 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract Medicare tax withheld as Medicare wages\\n \\u2717 Do NOT extract other box amounts as Medicare wages\"}, \"medicare_tax_withheld\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Medicare tax withheld (Box 6 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Medicare tax withheld', appears in Box '6' on the W-2 form.\\n\\nLOCATION: Box '6' on the W-2 form, labeled 'Medicare tax withheld'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 6 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 6 is empty, return null.\\n\\nEDGE CASES:\\n - This is the amount of Medicare tax withheld.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 6 shows '$725.00' -> extract 725.00\\n \\u2713 Box 6 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract Social Security tax as Medicare tax\\n \\u2717 Do NOT extract Medicare wages as Medicare tax\"}, \"state\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The state for which state wages/taxes are reported (if applicable, appears in Box 15 area).\\n\\nCOMMON LABELS: State appears in Box '15' area on the W-2 form, labeled 'State'.\\n\\nLOCATION: Box '15' area on the W-2 form, in the state and local tax information section.; Usually in the right portion of the form, in the state/local tax boxes area.; Look for state information in Box 15 area.\\n\\nFORMAT: Return the state abbreviation or name exactly as it appears (e.g., 'CA', 'NY', 'California', 'New York'). Preserve the format as shown. If state information is not shown (employee worked in a state with no state income tax), return null.\\n\\nEDGE CASES:\\n - State may be shown as abbreviation (CA, NY) or full name (California, New York) - preserve as shown.\\n - Some employees work in multiple states - if only one state is shown, extract that; if multiple states, extract the primary state or return null if unclear.\\n\\nEXAMPLES:\\n \\u2713 Box 15 shows 'CA' -> extract 'CA'\\n \\u2713 Box 15 shows 'California' -> extract 'California'\\n\\nAVOID:\\n \\u2717 Do NOT extract employer state as employee work state\\n \\u2717 Do NOT extract state tax amounts as state names\"}, \"state_wages\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"State wages, tips, etc. (Box 16 amount on the W-2 form, if applicable).\\n\\nCOMMON LABELS: 'State wages, tips, etc.', appears in Box '16' on the W-2 form.\\n\\nLOCATION: Box '16' on the W-2 form, labeled 'State wages, tips, etc.'.; Usually in the right portion of the form, in the state/local tax boxes area.; Look for Box 16 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 16 is empty (employee worked in a state with no state income tax), return null.\\n\\nEDGE CASES:\\n - This is wages subject to state income tax.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Some employees work in states with no state income tax - return null if not applicable.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 16 shows '$50,000.00' -> extract 50000.00\\n \\u2713 Box 16 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract state tax withheld as state wages\\n \\u2717 Do NOT extract federal wages as state wages\"}, \"state_income_tax_withheld\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"State income tax withheld (Box 17 amount on the W-2 form, if applicable).\\n\\nCOMMON LABELS: 'State income tax', appears in Box '17' on the W-2 form.\\n\\nLOCATION: Box '17' on the W-2 form, labeled 'State income tax'.; Usually in the right portion of the form, in the state/local tax boxes area.; Look for Box 17 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 17 is empty (employee worked in a state with no state income tax), return null.\\n\\nEDGE CASES:\\n - This is the amount of state income tax withheld.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Some employees work in states with no state income tax - return null if not applicable.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 17 shows '$2,000.00' -> extract 2000.00\\n \\u2713 Box 17 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract federal tax withheld as state tax withheld\\n \\u2717 Do NOT extract local tax as state tax\"}, \"employer_address\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The employer's address (if shown separately from the employer name in Box b).\\n\\nCOMMON LABELS: Employer address appears in Box 'b' area labeled 'Employer's name, address, and ZIP code' on the W-2 form.\\n\\nLOCATION: Box 'b' area on the W-2 form, in the employer information section.; Usually in the upper-left portion of the form.; Look for employer address in Box b area (below or after the employer name).\\n\\nFORMAT: Return the complete address as it appears on the W-2 form. Common formats: '123 Main St, City, State ZIP' or multi-line addresses. Preserve the format as shown, or join multi-line addresses with commas. If employer address is not shown separately (only name is shown), return null.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Employer address appears in the same Box b area as the employer name - extract the address portion only.\\n\\nEXAMPLES:\\n \\u2713 Box b shows address below employer name -> extract the address\\n \\u2713 Text shows multi-line address -> join with commas\\n\\nAVOID:\\n \\u2717 Do NOT extract employer name as part of the address\\n \\u2717 Do NOT extract employee address as employer address\"}}, \"required\": [\"employer_name\", \"employee_name\", \"tax_year\", \"wages_tips_other_compensation\"], \"validation\": {\"cross_field\": [{\"type\": \"approximate_match\", \"fields\": [\"social_security_wages\", \"wages_tips_other_compensation\"], \"tolerance\": 168600, \"message\": \"Social Security wages (Box 3) should approximately equal wages (Box 1) unless wages exceed the Social Security wage base limit (currently $168,600)\"}, {\"type\": \"approximate_match\", \"fields\": [\"medicare_wages\", \"wages_tips_other_compensation\"], \"tolerance\": 0.01, \"message\": \"Medicare wages (Box 5) should approximately equal wages (Box 1) in most cases\"}]}}", "true_json_output": "{\"employer_name\": \"UNITED PARCEL SERVICE INC\", \"employer_ein\": \"36-2407381\", \"employee_name\": \"TYRONE L ARMSTRONG\", \"employee_ssn\": null, \"employee_address\": \"6018 NORTH CLINTON LANE, KANSAS CITY, MO 64119\", \"tax_year\": \"2023\", \"wages_tips_other_compensation\": 1443.85, \"federal_income_tax_withheld\": 12.3, \"social_security_wages\": 1443.85, \"social_security_tax_withheld\": 89.52, \"medicare_wages\": 1443.85, \"medicare_tax_withheld\": 20.94, \"state\": \"MO\", \"state_wages\": 1443.85, \"state_income_tax_withheld\": 35.0, \"employer_address\": \"55 GLENLAKE PWKY NE, ATLANTA, GA 30328\", \"source_filename\": \"w_2_1.pdf\"}", "true_markdown_output": "**Employer Name:** UNITED PARCEL SERVICE INC\n**Employer Ein:** 36-2407381\n**Employee Name:** TYRONE L ARMSTRONG\n**Employee Ssn:** N/A\n**Employee Address:** 6018 NORTH CLINTON LANE, KANSAS CITY, MO 64119\n**Tax Year:** 2023\n**Wages Tips Other Compensation:** 1443.85\n**Federal Income Tax Withheld:** 12.3\n**Social Security Wages:** 1443.85\n**Social Security Tax Withheld:** 89.52\n**Medicare Wages:** 1443.85\n**Medicare Tax Withheld:** 20.94\n**State:** MO\n**State Wages:** 1443.85\n**State Income Tax Withheld:** 35.0\n**Employer Address:** 55 GLENLAKE PWKY NE, ATLANTA, GA 30328"} {"file_name": "images/w_2_2.png", "id": 17, "metadata": "{\"format\": \"W2\", \"documentQuality\": \"PHOTO\", \"source_filename\": \"w_2_2.pdf\"}", "json_schema": "{\"type\": \"object\", \"properties\": {\"employer_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the employer (company/business that issued the W-2 form).\\n\\nCOMMON LABELS: Employer name appears in Box 'b' or in the employer information section of the W-2 form.\\n\\nLOCATION: Typically in Box 'b' labeled 'Employer's name, address, and ZIP code' on the W-2 form.; Usually in the upper-left portion of the form, in the employer information section.; Look for the employer name in the employer information area (Box b).\\n\\nFORMAT: Return the employer name as it appears on the W-2 form. Common formats: 'ABC Corporation', 'XYZ Industries Inc.', 'ABC Company'. Preserve capitalization and abbreviations. Include legal designations (Inc., Corp., LLC) if they're part of the employer name.\\n\\nEDGE CASES:\\n - Employer names may include legal designations - preserve as shown.\\n - Employer names may appear with addresses - extract only the employer name (company name), not the address.\\n\\nEXAMPLES:\\n \\u2713 Box b shows 'ABC CORPORATION' -> extract 'ABC CORPORATION' or 'ABC Corporation'\\n \\u2713 Box b shows 'XYZ Industries Inc.' -> extract 'XYZ Industries Inc.'\\n\\nAVOID:\\n \\u2717 Do NOT extract employer addresses as part of the employer name\\n \\u2717 Do NOT extract employee names as employer names\\n \\u2717 Do NOT extract EIN numbers or other identifiers as employer names\"}, \"employer_ein\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The Employer Identification Number (EIN) - the employer's federal tax ID number.\\n\\nCOMMON LABELS: 'EIN', 'Employer identification number', appears in Box 'b' area or employer information section.\\n\\nLOCATION: Typically in the employer information section, often near the employer name.; May appear in Box 'b' area or in the employer identification field.; Look for EIN numbers in the employer information area.\\n\\nFORMAT: Return the EIN exactly as it appears. EINs are typically formatted as XX-XXXXXXX (two digits, dash, seven digits). Preserve any formatting, dashes, or spacing as shown. If EIN is not shown, return null.\\n\\nEDGE CASES:\\n - EINs may be formatted with or without dashes - preserve as shown.\\n - EINs are 9-digit numbers, typically shown as XX-XXXXXXX.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'EIN: 12-3456789' -> extract '12-3456789'\\n \\u2713 Text shows '12-3456789' -> extract '12-3456789'\\n\\nAVOID:\\n \\u2717 Do NOT extract employee SSN as EIN\\n \\u2717 Do NOT extract other tax IDs as EIN\"}, \"employee_name\": {\"type\": \"string\", \"datapoint_prompt\": \"The name of the employee (the person who received the W-2 form).\\n\\nCOMMON LABELS: Employee name appears in the employee information section, typically labeled or in Box 'e' area.\\n\\nLOCATION: Typically in the employee information section, usually in the left portion of the W-2 form.; Often appears in Box 'e' area or employee name field.; Look for employee names in the employee information area.\\n\\nFORMAT: Return the employee name exactly as it appears on the W-2 form. Common formats: 'John Doe', 'John M. Doe', 'Doe, John'. Preserve capitalization and formatting. Include middle names/initials if present.\\n\\nEDGE CASES:\\n - Names may include middle initial or middle name - preserve as shown.\\n - Names may be shown last name first (e.g., 'Doe, John') - preserve the format as shown.\\n - Names may be in all uppercase on W-2 forms - preserve the capitalization.\\n\\nEXAMPLES:\\n \\u2713 Text shows 'John Doe' -> extract 'John Doe'\\n \\u2713 Text shows 'DOE, JOHN MICHAEL' -> extract 'DOE, JOHN MICHAEL'\\n \\u2713 Text shows 'John M. Doe' -> extract 'John M. Doe'\\n\\nAVOID:\\n \\u2717 Do NOT extract employer names as employee names\\n \\u2717 Do NOT extract only last name when full name is provided\"}, \"employee_ssn\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The employee's Social Security Number (SSN).\\n\\nCOMMON LABELS: 'SSN', 'Social Security Number', appears in Box 'a' or employee information section.\\n\\nLOCATION: Typically in Box 'a' labeled 'Employee's social security number' on the W-2 form.; Usually in the employee information section, often near the employee name.; Look for SSN in Box 'a' or employee information area.\\n\\nFORMAT: Return the SSN exactly as it appears. SSNs are typically formatted as XXX-XX-XXXX (three digits, dash, two digits, dash, four digits). Preserve any formatting, dashes, or spacing as shown. If SSN is masked or not shown (for privacy), return null.\\n\\nEDGE CASES:\\n - SSNs may be formatted with or without dashes - preserve as shown.\\n - SSNs are 9-digit numbers, typically shown as XXX-XX-XXXX.\\n - Some forms may mask SSNs (e.g., 'XXX-XX-1234') - extract as shown or return null if fully masked.\\n\\nEXAMPLES:\\n \\u2713 Box a shows '123-45-6789' -> extract '123-45-6789'\\n \\u2713 Text shows 'SSN: 123-45-6789' -> extract '123-45-6789'\\n\\nAVOID:\\n \\u2717 Do NOT extract employer EIN as employee SSN\\n \\u2717 Do NOT extract other identifiers as SSN\"}, \"employee_address\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The employee's address (if shown on the W-2 form).\\n\\nCOMMON LABELS: Employee address appears in the employee information section, typically in Box 'f' or employee address field.\\n\\nLOCATION: Typically in Box 'f' labeled 'Employee's address and ZIP code' or in the employee information section.; Usually in the employee information area, often below the employee name.; Look for employee addresses in the employee information area.\\n\\nFORMAT: Return the complete address as it appears on the W-2 form. Common formats: '123 Main St, City, State ZIP' or multi-line addresses. Preserve the format as shown, or join multi-line addresses with commas. If employee address is not shown, return null.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Addresses may include apartment numbers or unit numbers - include if present.\\n\\nEXAMPLES:\\n \\u2713 Box f shows '123 Main St, Anytown, CA 12345' -> extract '123 Main St, Anytown, CA 12345'\\n \\u2713 Text shows multi-line address -> join with commas\\n\\nAVOID:\\n \\u2717 Do NOT extract employer addresses as employee addresses\\n \\u2717 Do NOT extract city/state/zip only when full address is shown\"}, \"tax_year\": {\"type\": \"string\", \"datapoint_prompt\": \"The tax year for which the W-2 form was issued.\\n\\nCOMMON LABELS: Tax year appears prominently on the W-2 form, typically labeled 'For calendar year' or shown in the form title/header.\\n\\nLOCATION: Typically in the form header or title area, often labeled 'For calendar year [YEAR]' or 'Tax Year [YEAR]'.; May appear prominently at the top of the form.; Look for tax year designations in the header or title area.\\n\\nFORMAT: Return the tax year as a 4-digit year (e.g., '2024', '2023'). If the year is shown as two digits, expand to 4 digits (e.g., '24' -> '2024'). Preserve as a string.\\n\\nEDGE CASES:\\n - Tax years are calendar years (e.g., 2024, 2023).\\n - Two-digit years: Expand to 4 digits (e.g., '24' -> '2024').\\n\\nEXAMPLES:\\n \\u2713 Text shows 'For calendar year 2024' -> extract '2024'\\n \\u2713 Text shows 'Tax Year: 2023' -> extract '2023'\\n \\u2713 Text shows '2024' in header -> extract '2024'\\n\\nAVOID:\\n \\u2717 Do NOT extract form copy numbers or other numbers as tax year\\n \\u2717 Do NOT extract dates (like issue dates) as tax year\"}, \"wages_tips_other_compensation\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Wages, tips, and other compensation (Box 1 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Wages, tips, other compensation', appears in Box '1' on the W-2 form.\\n\\nLOCATION: Box '1' on the W-2 form, labeled 'Wages, tips, other compensation'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 1 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators (e.g., '$50,000.00' -> 50000.00). If the amount is not shown or Box 1 is empty, return null.\\n\\nEDGE CASES:\\n - This is the total wages/tips/other compensation before deductions.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants (missing $ sign, commas, or noisy characters).\\n\\nEXAMPLES:\\n \\u2713 Box 1 shows '$50,000.00' -> extract 50000.00\\n \\u2713 Box 1 shows '50000.00' -> extract 50000.00\\n \\u2713 Box 1 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract other box amounts as Box 1 amount\\n \\u2717 Do NOT extract federal tax withheld as wages\"}, \"federal_income_tax_withheld\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Federal income tax withheld (Box 2 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Federal income tax withheld', appears in Box '2' on the W-2 form.\\n\\nLOCATION: Box '2' on the W-2 form, labeled 'Federal income tax withheld'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 2 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 2 is empty, return null.\\n\\nEDGE CASES:\\n - This is the amount of federal income tax withheld from wages.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 2 shows '$5,000.00' -> extract 5000.00\\n \\u2713 Box 2 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract state tax withheld as federal tax withheld\\n \\u2717 Do NOT extract Social Security tax as federal income tax\"}, \"social_security_wages\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Social Security wages (Box 3 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Social security wages', appears in Box '3' on the W-2 form.\\n\\nLOCATION: Box '3' on the W-2 form, labeled 'Social security wages'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 3 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 3 is empty, return null.\\n\\nEDGE CASES:\\n - This is wages subject to Social Security tax (may differ from Box 1 if wages exceed the Social Security wage base).\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 3 shows '$50,000.00' -> extract 50000.00\\n \\u2713 Box 3 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract Box 1 wages as Social Security wages (they may differ)\\n \\u2717 Do NOT extract Social Security tax withheld as Social Security wages\"}, \"social_security_tax_withheld\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Social Security tax withheld (Box 4 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Social security tax withheld', appears in Box '4' on the W-2 form.\\n\\nLOCATION: Box '4' on the W-2 form, labeled 'Social security tax withheld'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 4 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 4 is empty, return null.\\n\\nEDGE CASES:\\n - This is the amount of Social Security tax (FICA) withheld.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 4 shows '$3,100.00' -> extract 3100.00\\n \\u2713 Box 4 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract Medicare tax as Social Security tax\\n \\u2717 Do NOT extract Social Security wages as Social Security tax\"}, \"medicare_wages\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Medicare wages and tips (Box 5 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Medicare wages and tips', appears in Box '5' on the W-2 form.\\n\\nLOCATION: Box '5' on the W-2 form, labeled 'Medicare wages and tips'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 5 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 5 is empty, return null.\\n\\nEDGE CASES:\\n - This is wages subject to Medicare tax (typically the same as Box 1, but may differ in some cases).\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 5 shows '$50,000.00' -> extract 50000.00\\n \\u2713 Box 5 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract Medicare tax withheld as Medicare wages\\n \\u2717 Do NOT extract other box amounts as Medicare wages\"}, \"medicare_tax_withheld\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"Medicare tax withheld (Box 6 amount on the W-2 form).\\n\\nCOMMON LABELS: 'Medicare tax withheld', appears in Box '6' on the W-2 form.\\n\\nLOCATION: Box '6' on the W-2 form, labeled 'Medicare tax withheld'.; Usually in the left portion of the form, in the numbered boxes area.; Look for Box 6 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 6 is empty, return null.\\n\\nEDGE CASES:\\n - This is the amount of Medicare tax withheld.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 6 shows '$725.00' -> extract 725.00\\n \\u2713 Box 6 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract Social Security tax as Medicare tax\\n \\u2717 Do NOT extract Medicare wages as Medicare tax\"}, \"state\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The state for which state wages/taxes are reported (if applicable, appears in Box 15 area).\\n\\nCOMMON LABELS: State appears in Box '15' area on the W-2 form, labeled 'State'.\\n\\nLOCATION: Box '15' area on the W-2 form, in the state and local tax information section.; Usually in the right portion of the form, in the state/local tax boxes area.; Look for state information in Box 15 area.\\n\\nFORMAT: Return the state abbreviation or name exactly as it appears (e.g., 'CA', 'NY', 'California', 'New York'). Preserve the format as shown. If state information is not shown (employee worked in a state with no state income tax), return null.\\n\\nEDGE CASES:\\n - State may be shown as abbreviation (CA, NY) or full name (California, New York) - preserve as shown.\\n - Some employees work in multiple states - if only one state is shown, extract that; if multiple states, extract the primary state or return null if unclear.\\n\\nEXAMPLES:\\n \\u2713 Box 15 shows 'CA' -> extract 'CA'\\n \\u2713 Box 15 shows 'California' -> extract 'California'\\n\\nAVOID:\\n \\u2717 Do NOT extract employer state as employee work state\\n \\u2717 Do NOT extract state tax amounts as state names\"}, \"state_wages\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"State wages, tips, etc. (Box 16 amount on the W-2 form, if applicable).\\n\\nCOMMON LABELS: 'State wages, tips, etc.', appears in Box '16' on the W-2 form.\\n\\nLOCATION: Box '16' on the W-2 form, labeled 'State wages, tips, etc.'.; Usually in the right portion of the form, in the state/local tax boxes area.; Look for Box 16 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 16 is empty (employee worked in a state with no state income tax), return null.\\n\\nEDGE CASES:\\n - This is wages subject to state income tax.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Some employees work in states with no state income tax - return null if not applicable.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 16 shows '$50,000.00' -> extract 50000.00\\n \\u2713 Box 16 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract state tax withheld as state wages\\n \\u2717 Do NOT extract federal wages as state wages\"}, \"state_income_tax_withheld\": {\"type\": [\"number\", \"null\"], \"datapoint_prompt\": \"State income tax withheld (Box 17 amount on the W-2 form, if applicable).\\n\\nCOMMON LABELS: 'State income tax', appears in Box '17' on the W-2 form.\\n\\nLOCATION: Box '17' on the W-2 form, labeled 'State income tax'.; Usually in the right portion of the form, in the state/local tax boxes area.; Look for Box 17 on the W-2 form.\\n\\nFORMAT: Return a numeric decimal value with two digits after the decimal point, no currency symbol and no thousands separators. If the amount is not shown or Box 17 is empty (employee worked in a state with no state income tax), return null.\\n\\nEDGE CASES:\\n - This is the amount of state income tax withheld.\\n - Amounts may be zero - return 0.00 (not null) if explicitly shown as zero.\\n - Some employees work in states with no state income tax - return null if not applicable.\\n - Be robust to OCR variants.\\n\\nEXAMPLES:\\n \\u2713 Box 17 shows '$2,000.00' -> extract 2000.00\\n \\u2713 Box 17 shows '0.00' -> extract 0.00\\n\\nAVOID:\\n \\u2717 Do NOT extract federal tax withheld as state tax withheld\\n \\u2717 Do NOT extract local tax as state tax\"}, \"employer_address\": {\"type\": [\"string\", \"null\"], \"datapoint_prompt\": \"The employer's address (if shown separately from the employer name in Box b).\\n\\nCOMMON LABELS: Employer address appears in Box 'b' area labeled 'Employer's name, address, and ZIP code' on the W-2 form.\\n\\nLOCATION: Box 'b' area on the W-2 form, in the employer information section.; Usually in the upper-left portion of the form.; Look for employer address in Box b area (below or after the employer name).\\n\\nFORMAT: Return the complete address as it appears on the W-2 form. Common formats: '123 Main St, City, State ZIP' or multi-line addresses. Preserve the format as shown, or join multi-line addresses with commas. If employer address is not shown separately (only name is shown), return null.\\n\\nEDGE CASES:\\n - Addresses may span multiple lines - join them into a single string with appropriate separators.\\n - Employer address appears in the same Box b area as the employer name - extract the address portion only.\\n\\nEXAMPLES:\\n \\u2713 Box b shows address below employer name -> extract the address\\n \\u2713 Text shows multi-line address -> join with commas\\n\\nAVOID:\\n \\u2717 Do NOT extract employer name as part of the address\\n \\u2717 Do NOT extract employee address as employer address\"}}, \"required\": [\"employer_name\", \"employee_name\", \"tax_year\", \"wages_tips_other_compensation\"], \"validation\": {\"cross_field\": [{\"type\": \"approximate_match\", \"fields\": [\"social_security_wages\", \"wages_tips_other_compensation\"], \"tolerance\": 168600, \"message\": \"Social Security wages (Box 3) should approximately equal wages (Box 1) unless wages exceed the Social Security wage base limit (currently $168,600)\"}, {\"type\": \"approximate_match\", \"fields\": [\"medicare_wages\", \"wages_tips_other_compensation\"], \"tolerance\": 0.01, \"message\": \"Medicare wages (Box 5) should approximately equal wages (Box 1) in most cases\"}]}}", "true_json_output": "{\"employer_name\": \"PUBLIX SUPER MARKETS INC\", \"employer_ein\": \"59-0324412\", \"employee_name\": \"Carl P Feil\", \"employee_ssn\": \"592-22-4529\", \"employee_address\": \"5072 Aunt Nannies Pl, Nolensville TN 37135\", \"tax_year\": \"2020\", \"wages_tips_other_compensation\": 138148.07, \"federal_income_tax_withheld\": 20002.18, \"social_security_wages\": 137700.0, \"social_security_tax_withheld\": 8537.4, \"medicare_wages\": 139720.07, \"medicare_tax_withheld\": 2025.94, \"state\": null, \"state_wages\": null, \"state_income_tax_withheld\": null, \"employer_address\": \"P.O. Box 32024, Lakeland FL 33802-2024\", \"source_filename\": \"w_2_2.pdf\"}", "true_markdown_output": "**Employer Name:** PUBLIX SUPER MARKETS INC\n**Employer Ein:** 59-0324412\n**Employee Name:** Carl P Feil\n**Employee Ssn:** 592-22-4529\n**Employee Address:** 5072 Aunt Nannies Pl, Nolensville TN 37135\n**Tax Year:** 2020\n**Wages Tips Other Compensation:** 138148.07\n**Federal Income Tax Withheld:** 20002.18\n**Social Security Wages:** 137700.0\n**Social Security Tax Withheld:** 8537.4\n**Medicare Wages:** 139720.07\n**Medicare Tax Withheld:** 2025.94\n**State:** N/A\n**State Wages:** N/A\n**State Income Tax Withheld:** N/A\n**Employer Address:** P.O. Box 32024, Lakeland FL 33802-2024"}