Repair an unstructured address
repair_addressUpgrades legacy unstructured address lines to hybrid/structured form using country-specific heuristics for GB, US, DE, FR, JP and best-effort for other countries. Prepares pre-cliff data for November 2026 compliance.
Instructions
Upgrade legacy unstructured address lines toward hybrid/structured form.
Experimental country-aware repair (``GB``, ``US``, ``DE``, ``FR``, ``JP``
have dedicated heuristics; other countries get a best-effort pass promoting
the last line to a town). Use this to lift pre-cliff data over the
November 14, 2026 bar; audit the output before submitting, and keep both
the original and derived address in your audit trail.
Returns ``{"address": {...}, "classification": str, "is_structured":
bool, "is_hybrid": bool}`` (so you can see the unstructured -> hybrid /
structured upgrade) or an ``{"error": ...}`` payload.
Args:
lines: Legacy unstructured address lines.
country: ISO 3166-1 alpha-2 country code driving the heuristics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | Legacy unstructured address lines (free-form). Empty or whitespace-only lines are skipped. | |
| country | Yes | ISO 3166-1 alpha-2 country code (e.g. 'GB', 'US', 'DE', 'FR', 'JP') used to drive country-aware repair heuristics. |