Tanner Davis commited on
Commit
840cb29
·
1 Parent(s): ed2b9cf

update instruction prompt

Browse files
src/papertrail/schema/extraction.py CHANGED
@@ -82,8 +82,8 @@ class ExtractedExpense(BaseModel):
82
  # the model knows the exact output contract. Keep this byte-stable: it is part of
83
  # the training data AND the inference prompt, and changing it invalidates a tune.
84
  EXTRACTION_INSTRUCTION = (
85
- "You are an expense-document extractor. Read the attached medical expense "
86
- "document (receipt, invoice, or insurance EOB) and return ONLY a JSON object "
87
  "with these fields:\n"
88
  ' "merchant": string or null — the business/provider name\n'
89
  ' "date": string or null — service or purchase date as YYYY-MM-DD\n'
@@ -91,6 +91,6 @@ EXTRACTION_INSTRUCTION = (
91
  ' "currency": string — ISO currency code, default "USD"\n'
92
  ' "provider_type": one of "pharmacy" | "dental" | "vision" | "medical" | "other"\n'
93
  ' "line_items": array of {"description": string, "amount": number or null}\n'
94
- ' "patient": string or null — patient name if present\n'
95
  "Use null for any field you cannot read. Do not invent values. Output JSON only."
96
  )
 
82
  # the model knows the exact output contract. Keep this byte-stable: it is part of
83
  # the training data AND the inference prompt, and changing it invalidates a tune.
84
  EXTRACTION_INSTRUCTION = (
85
+ "Read the attached medical expense document "
86
+ "(receipt, invoice, or insurance EOB) and return ONLY a JSON object "
87
  "with these fields:\n"
88
  ' "merchant": string or null — the business/provider name\n'
89
  ' "date": string or null — service or purchase date as YYYY-MM-DD\n'
 
91
  ' "currency": string — ISO currency code, default "USD"\n'
92
  ' "provider_type": one of "pharmacy" | "dental" | "vision" | "medical" | "other"\n'
93
  ' "line_items": array of {"description": string, "amount": number or null}\n'
94
+ ' "patient": string or null — patient name\n'
95
  "Use null for any field you cannot read. Do not invent values. Output JSON only."
96
  )