Back to Prompt Library
implementation
Build the application
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a Multilingual Logistics Intake and Cross-Border Transit Router
Format
Code-aware
Lines
74
Sections
11
Linked challenge
Build a Multilingual Logistics Intake and Cross-Border Transit Router
Prompt source
Original prompt text with formatting preserved for inspection.
74 lines
11 sections
No variables
1 code block
## Build
Parse unstructured shipping inquiries across English, Malay, Mandarin, and Tamil into normalized consignments. Evaluate port customs urgency and dispatch booking payloads to terminal operators.
## User
Regional freight forwarder logistics coordinator
## Workflow
1. Ingest multilingual freight requests received through webhooks and messaging channels.
2. Translate text and extract normalized cargo dimensions, commodity codes, and arrival targets.
3. Score customs clearance urgency against Jurong and Tuas terminal berthing windows.
4. Dispatch structured logistics orders to terminal dispatch queues for operator confirmation.
## Interface
Multi-pane routing console showing incoming raw messages, detected language confidence, normalized booking entity fields, and terminal dispatch status.
## Data
Create synthetic normalized inquiry datasets using real Data.gov.sg weather and traffic status schemas from source 0 for local transit context.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Singapore open data API](https://guide.data.gov.sg/developer-guide/api-overview)
Queries real-time API formats referenced in data.gov.sg developer docs for traffic and weather context during transit routing.
## Tools
pydantic-ai, fastapi, httpx.
Pydantic AI ensures strict type validation on multilingual entity extraction before payload dispatch.
Fast multilingual instruction-following model via hosted API for translation and structured entity extraction.
## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.
## Acceptance
- Correctly identifies English, Malay, Simplified Chinese, and Tamil message payloads.
- Extracts pallet count, cargo weight, and destination terminal without schema errors.
- Flags incomplete dangerous goods declarations before queue dispatch.
- Dispatches normalized booking orders with deterministic urgency scores.
## Starter Examples
```json
[
{
"input": {
"source_language": "ms",
"raw_message": "Sila aturkan 14 palet barang elektrik dari Pasir Gudang ke Tuas Port sebelum 4 petang esok.",
"sender_uen": "201823901M"
},
"expected_output": {
"detected_language": "ms",
"normalized_order": {
"cargo_type": "electrical_goods",
"pallet_count": 14,
"origin": "Pasir Gudang",
"destination": "Tuas Port",
"urgency_level": "standard",
"routed_terminal": "tuas_gate_4"
},
"status": "ready_for_dispatch"
}
},
{
"input": {
"source_language": "zh",
"raw_message": "冷冻海鲜,明天送,数量没定",
"sender_uen": "202011409K"
},
"expected_output": {
"detected_language": "zh",
"normalized_order": {
"cargo_type": "frozen_seafood",
"pallet_count": null,
"origin": null,
"destination": null,
"urgency_level": "blocked",
"routed_terminal": null
},
"status": "missing_required_dimensions"
}
}
]
```
## Safety
Simulates all external carrier bookings and terminal gate dispatches without executing real-world commitments.
Use mock external writes. Require human review before any real deployment.Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.