What this is
A Juejin tutorial went viral this week, breaking down the full pipeline for Google's Gemini multimodal model reading an invoice: the model reads the image, Pydantic Schema extracts the fields, and local code recalculates the totals. After these three layers of checks, the receipt only enters a pending-approval queue—it never triggers automatic payment. This matters because it demonstrates a principle: AI sees, code judges, and the financial signature must never be handed to a large model.
The tutorial is blunt about why every layer matters. Vision models on complex layouts can misread decimal points and confuse discounts for fees—so you must lock the fields with Pydantic Schema (a tool that enforces data fields and types) and recompute totals with high-precision Decimal functions. All three constraints are non-negotiable.
Industry view
This "AI for perception, code for decisions" pattern is becoming the consensus architecture for enterprise AI deployment. We've noticed that several RPA (Robotic Process Automation) vendors and finance SaaS companies are pivoting their products in this direction—AI handles reading documents and matching vouchers; rule engines handle compliance and risk control.
But the counterarguments are equally clear. First, vision models on blurry, skewed, or low-resolution receipts still exhibit a tendency toward "confident fabrication"—misreading discounts as fees, inverting tax amounts, and similar failures. Second, most domestic enterprise finance systems lack the capacity for strict Schema constraints, so when the model wants to "freestyle," nothing stops it. Third, business loopholes like forged invoices and duplicate reimbursements cannot be prevented by vision models at all—human or system-layer checks must be stacked on top.
Impact on regular people
For enterprise IT: copy this four-layer architecture—input validation, Schema constraints, rule recomputation, human fallback—for any automation project. It is far safer than letting AI make end-to-end decisions.
For individual careers: finance, admin, and procurement roles will not be replaced by AI in the short term, but the work shifts from "filling it out yourself" to "reviewing whether AI filled it out correctly."
For the consumer market: receipt management and travel reimbursement tools will become more widespread and cheaper, but "fully unmanned approval" promises remain untrustworthy in the near term.