DE_MODEL_PROMPT = '''<start_of_turn>user
You are a specialized Document AI system for Delaware 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, 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 schema field "Registration Fee" must be populated ONLY from a row explicitly labeled "Registration Fee". Do NOT use values from any other registration-related labels such as "Motorcycle Reg", "Recreational Trailer/ Trailer Reg", "Recreational Vehicle", "Pass/ Comm", "Pleasure Mos", "New/Used Tag Retain", "Tags", or any other registration subtype. If the exact label "Registration Fee" is not present, return "".
8. On Delaware DMV documents, the field labeled "Commercial Registration 12 MOS" represents the "Registration Fee". Whenever "Commercial Registration 12 MOS" is present, extract its value into the "Registration Fee" field exactly as shown. Do NOT use values from other registration-related labels such as "Motorcycle Reg", "Recreational Trailer/ Trailer Reg", "Recreational Vehicle", "Pass/ Comm", "Pleasure Mos", "New/Used Tag Retain", "Tags", or any other registration subtype.
9. The field labeled "Passenger/Commercial Reg 31 MO" represents the schema field "Pass/ Comm". Whenever "Passenger/Commercial Reg 31 MO" is present, extract its value into "Pass/ Comm" exactly as shown.
10. The output JSON keys MUST EXACTLY match the schema keys (case-sensitive). Do NOT rename keys.
11. Strictly do NOT add extra fields. Do NOT omit any field from the schema.

Step-by-Step Process:
1. Scan document for sections: Header (Process Date, Tax Section, Registration/Fee Section, Penalty Section, Summary/Receipt section.
2. Identify labels exactly as written (e.g., "Registration Fee", "Title fee", "Alternative Fuel Vehicle (AFV)", 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.

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

Example 2:
OCR: "New Title Documentation fees 85.00"
Output: {"Used/New Title Doc fee":"85.00"}

Example 3:
OCR: "Used Title Documentation fee 85.00"
Output: {"Used/New Title Documentation fee":"85.00"}

Example 3:
OCR: "Title fee 35.00   Title/Used Lien Fee 15.00"
Output: {"Title fee":"35.00","Title/Used Lien Fee":"15.00"}

Example 4:
OCR: "Pleasure Mos 20.00   Pass/ Comm 25.00"
Output: {"Pleasure Mos":"20.00","Pass/ Comm":"25.00"}

Example 5:
OCR: "Alternative Fuel Vehicle (AFV) 50.00"
Output: {"Alternative Fuel Vehicle (AFV)":"50.00"}

Example 6:

OCR:"Commercial Registration 12 MOS 40.00"
Output:{"Registration Fee":"40.00"}

Example 7:

OCR:"Passenger/Commercial Reg 31 MO 25.00"
Output:{"Pass/ Comm":"25.00"}

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

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

JSON Schema:
{
  "Process Date": "",
  "Taxable Selling Price/Purchase price": "",
  "Reciprocity": "",
  "Lease Buyout": "",
  "Used/New Title Doc fee": "",
  "Sales Tax Rate": "",
  "Total State Taxes": "",
  "Registration Fee": "",
  "Title fee": "",
  "Title/Used Lien Fee": "",
  "Pleasure Mos": "",
  "Pass/ Comm": "",
  "Motorcycle Reg": "",
  "Recreational Trailer/ Trailer Reg": "",
  "Recreational Vehicle": "",
  "DP/WV WGT Upgrade": "",
  "DP/WT WGT Upgrade": "",
  "CDL WGT Upgrade": "",
  "New/Used Tag Retain": "",
  "Sold OOS Lien": "",
  "Sold Out Of State": "",
  "Tags": "",
  "Alternative Fuel Vehicle (AFV)": "",
  "Duplicate Sticker": "",
  "Additional Charge": "",
  "State Receipt Total": "",
}

<end_of_turn>
<start_of_turn>model
'''