CO_MODEL_PROMPT = '''<start_of_turn>user
You are a specialized Document AI system for Colorado DMV financial documents. Extract structured data from the provided document image and OCR text.

CORE RULES:
1. Primary: Use OCR text for values, use image for layout and label alignment.
2. NO HALLUCINATION: Copy values exactly as they appear. If missing, return "".
3. Do NOT calculate totals. Extract ONLY explicitly present values.
4. Do NOT generate or infer totals, subtotals, penalties, registration totals, ownership totals, or tax totals.
5. Preserve numeric values exactly (including decimals, commas, and formatting).
6. Dates must remain exactly as seen (do not reformat).
7. The output JSON keys MUST EXACTLY match the schema keys (case-sensitive). Do NOT rename keys.
8. Do NOT add extra fields. Do NOT omit any field from the schema.
9. Do NOT perform partial, semantic, or approximate matching. For example, "Title" and "Title Application" are different labels and must never be treated as equivalent.
10. If a schema field is "Title Application", extract the value only from the row explicitly labeled "Title Application". Never use the value from a row labeled only "Title".

Step-by-Step Process:
1. Scan document for sections: Header (Process Date), Tax Section, Ownership Tax Section, Registration/Fee Section, Penalty Section, Summary/Receipt section.
2. Identify labels exactly as written (e.g., "State Use Tax", "County Use Tax", "Bridge Safety Surcharge", etc.).
3. Extract the value nearest to each label (usually right-aligned or adjacent).
4. If multiple matches exist, choose the correctly aligned value from the same row/section.
5. Ignore headers, footers, duplicate values, irrelevant text, and calculated totals.

EXACT LABEL MATCHING
The following labels are distinct and must never be interchanged:

Title ≠ Title Application
Registration ≠ Registration Base Fee
Plate ≠ Plate Transfer
Plate ≠ Plate Personalized/Designer Plate
Plate ≠ Plate Personalized Renewal/Designer Plate Renewal
Plug-In Electric Vehicle Fee ≠ Plug-In Electric Vehicle Decal Fee
Material Fee (Plate) ≠ Material Fee (Month Tab)
Material Fee (Plate) ≠ Material Fee (Year Tab)
County Use Tax ≠ County MHA Tax
County Use Tax ≠ County PSI Tax

Example 1:
OCR: "Issue Date 01/15/2025"
Output: {"Process Date":"01/15/2025"}

Example 2:
OCR: "State Use Tax 120.00   County Use Tax 45.00"
Output: {"State Use Tax":"120.00","County Use Tax":"45.00"}

Example 3:
OCR: "Registration Base Fee 58.00   Plate Transfer 12.00"
Output: {"Registration Base Fee":"58.00","Plate Transfer":"12.00"}

Example 4:
OCR: "Bridge Safety Surcharge 17.00   Material Fee (Plate) 5.00"
Output: {"Bridge Safety Surcharge":"17.00","Material Fee (Plate)":"5.00"}

Example 5:
OCR: "Title Application 7.20   Lienholder - Lien Filing Fee 5.00"
Output: {"Title Application":"7.20","Lienholder - Lien Filing Fee":"5.00"}

Example 6:
OCR:"Title 33.50 Title Application 7.20"
Output:{"Title Application":"7.20"}
Do NOT extract 33.50 because it belongs to the different label "Title".

Now extract from:
Image: [image]
OCR: [ocr_text]

Return ONLY valid JSON (no explanation, no extra text).

JSON Schema:
{
  "Process Date": "",
  "MSRP": "",
  "Taxable Selling Price/Purchase Price": "",
  "Sales Tax Credit Reciprocity": "",
  "State Use Tax": "",
  "State Use Tax Vendor Fee": "",
  "City Use Tax": "",
  "City Tax Vendor Fee": "",
  "County Use Tax": "",
  "County Use Tax Vendor Fee": "",
  "County MHA Tax": "",
  "County MHA Tax Vendor Fee": "",
  "County PSI Tax": "",
  "RTA County Tax": "",
  "County MTS Sales Tax": "",
  "County Sales Revenue Sharing": "",
  "Regional Transportation District Use Tax": "",
  "RTD Tax Vendor Fee": "",
  "Scientific & Cultural District Use Tax": "",
  "Scientific & Cultural District Use Tax Vendor Fee": "",
  "Misc Sales Tax": "",
  "Prior Ownership Tax": "",
  "Specific Ownership Tax": "",
  "Ownership Tax Total": "",
  "Road Usage Equalization Fee": "",
  "Age of Vehicle Add on": "",
  "Bridge Safety Surcharge": "",
  "Clerk Hire Fee": "",
  "County Road and Bridge": "",
  "Emergency Medical Services": "",
  "Emissions - Area Air Account": "",
  "Emissions - Program Area County": "",
  "Emissions - Statewide Air Account": "",
  "Emissions - Diesel": "",
  "Insurance Fee": "",
  "Material Fee (Month Tab)": "",
  "Material Fee (Plate)": "",
  "Material Fee (Year Tab)": "",
  "Material Fee (Temp Permit Mounting Board)": "",
  "Temporary Permit": "",
  "Motorist Insurance Database Fee": "",
  "Peace Officer Standardized Training Fee": "",
  "Registration Base Fee": "",
  "Road Safety Surcharge": "",
  "Plug-In Electric Vehicle Decal Fee": "",
  "Plug In Electric Vehicle Fee": "",
  "Plate Transfer": "",
  "Plate Personalized/Designer Plate": "",
  "Plate Personalized Renewal/ Designer Plate Renewal": "",
  "Specialty Plate (HUTF) (LSCF)": "",
  "Motorcycle Surcharge": "",
  "License Plate Mailing": "",
  "Small Balance Adjustment (Mail)": "",
  "Title Application": "",
  "Lienholder - Lien Filing Fee": "",
  "Keep CO Wild Pass": "",
  "Prior Registration Fees": "",
  "Prior Registration Base Fee County": "",
  "Annual Retired Plate Disability Fee": "",
  "ACH Fee": "",
  "Refunds": "",
  "Portal Administration Fee": "",
  "Additional Charge": "",
  "Late Fee": "",
  "State Receipt Total": ""
}

<end_of_turn>
<start_of_turn>model
'''