Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Temicide/thcode/llms.txt

Use this file to discover all available pages before exploring further.

Extract Address is the “other”-category specialist service in thcode’s AI for Thai catalog. It takes a Thai free-text address string — the kind found in form submissions, chat messages, shipping labels, or scraped web content — and parses it into discrete structured components: house number, street, subdistrict, district, province, and postal code. This is especially valuable in applications that handle delivery logistics, user profile data, or any workflow that must normalize unstructured Thai addresses before storing or routing them.
Extract Address is catalogued in this release. It is discoverable and fully inspectable via /tools, but the endpoint mapping, live transport, and contract test are a subsequent integration phase. Invoking the service now returns a stub refusal: "Catalogued — Not available yet".

Service Identity

FieldValue
Service IDextract-address
Upstream nameExtract Address
Thai nameแยกที่อยู่
Categoryother
Modalitytext
Endpointhttps://api.aiforthai.in.th/textmedad
Support levelcatalogued
Contract ver.1.0.0
Adapter ver.1.0.0

Search Terms

The router matches Extract Address against the following terms. You can use any of them in the /tools search command:
address   ที่อยู่   extraction   structured

Handler: Input Contract

The ExtractAddressSpecialistHandler builds a transport request from a text artifact. The handler reads the first prepared artifact, preferring the text property and falling back to extractedText when text is absent. The plain text string is then sent as a JSON body.
Request body sent to the Extract Address endpoint
{
  "text": "123/45 หมู่ 6 ถนนสุขุมวิท แขวงคลองเตย เขตคลองเตย กรุงเทพมหานคร 10110"
}
The request is dispatched as an authenticated POST to https://api.aiforthai.in.th/textmedad with:
  • Authorization: Bearer <key> — the raw API key is resolved in scope only and never appears in Evidence, logs, or the secret-free headersSummary (which shows [redacted]).
  • Content-Type: application/json
If the artifact is absent or the text is empty, the handler throws before a transport call is made.

Handler: Output Contract

The ExtractAddressSpecialistHandler maps the upstream JSON response into structured address component fields plus confidence and source-span metadata. The upstream response is expected to carry an address object, a top-level confidence number, and a sourceSpans array.

Address Component Fields

Each of the six address components is mapped individually as a text SpecialistFieldValue. A component is present: true only when the upstream address object contains a non-null, non-empty string for that key. Components that are absent, null, empty, or of the wrong type are present: false and listed in emptyFields.
{ "kind": "text", "value": "123/45", "present": true }

Confidence and Source Spans

FieldKindDescription
confidencenumberTop-level confidence score. Present when a finite number is returned. Propagated to SpecialistResult.confidence.
sourceSpansstructuredArray of span objects indicating where in the original text each component was found. Each span must have field, offset, and length. Stored as { items: [...] }.
The handler never coerces non-string address components to strings and never invents fields absent from the upstream response.

Fixture

The handler ships with a deterministic, built-in (non-user) fixture for health probes. The canary uses text/plain as the media type and sends the following address string:
123/45 หมู่ 6 ถนนสุขุมวิท แขวงคลองเตย เขตคลองเตย กรุงเทพมหานคร 10110
The fixture’s expected structured output is:
EXPECTED_HOUSE_NUMBER = '123/45'
EXPECTED_STREET       = 'สุขุมวิท'
EXPECTED_SUBDISTRICT  = 'คลองเตย'
EXPECTED_DISTRICT     = 'คลองเตย'
EXPECTED_PROVINCE     = 'กรุงเทพมหานคร'
EXPECTED_POSTAL_CODE  = '10110'
EXPECTED_CONFIDENCE   = 0.95
Any media type other than text/plain is rejected before the probe is dispatched.

Use Cases

Delivery & Logistics

Parse a user-entered shipping address into components your backend can validate, geocode, or route independently.

Form Normalization

Convert a single free-text address field collected from a form into a structured record for a database or CRM.

Data Cleaning

Process legacy datasets where Thai addresses were stored as unstructured strings and normalize them in bulk.

User Profile Data

Validate and structure address fields before they are persisted, reducing downstream parsing errors in Thai e-commerce or registration flows.

Using /tools with Extract Address

Inspect the Extract Address catalog entry
/tools inspect extract-address
Search for address or structured-text services
/tools search address
/tools search ที่อยู่
The inspect output will show invokable: false with reason "Catalogued — Not available yet". Attempting to invoke Extract Address before integration is complete will produce a pre-transport refusal — no network call is made.

Phase 1 Role

Extract Address is part of both the Verification Quartet and the Demo Portfolio. In Phase 1, it must pass a live contract test and a complete Typhoon-driven coding scenario before it is considered demo-certified. See ADR 0011 for the full Phase 1 roadmap.

Build docs developers (and LLMs) love