Back to prompt library
Build a Multilingual Carrier Quotation Parser and Route Dispatcher — implementation
Linked challenge: Build a Multilingual Carrier Quotation Parser and Route Dispatcher
Prompt source
implementation66 lines11 sectionsNo variables1 code block
## Build
Extract rate cards and route conditions from carrier quotation emails written in English, Mandarin, and Malay. Score quotes against Singapore port drayage benchmarks and dispatch orders.
## User
SME procurement manager
## Workflow
1. Ingest supplier price quotations and vehicle availability messages across regional languages.
2. Normalize currency conversions, fuel surcharge surcharges, and heavy vehicle parking fees.
3. Benchmark rates against historical Jurong and Tuas drayage price matrices.
4. Dispatch selected carrier routing orders to logistics partners via automated webhook payloads.
## Interface
Comparative quotation dashboard with currency conversion ribbons, rate anomaly callouts, and dispatch trigger buttons.
## Data
Construct synthetic multi-currency quotation logs referencing Singapore heavy vehicle parking guidelines.
Starter examples below are synthetic. They are not downloaded records.
## Source
[Singapore open data API](https://guide.data.gov.sg/developer-guide/api-overview)
Employs Singapore real-time dataset conventions from data.gov.sg for local road and infrastructure fee structures.
## Tools
dspy, pydantic, fastapi.
DSPy compiles robust prompt assertions to normalize diverse tabular quotation formats across three languages.
Multilingual model deployed via standard API with deterministic tabular data extraction capabilities.
## 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
- Normalizes foreign currency freight quotations into Singapore Dollars accurately.
- Extracts detention terms, chassis types, and maximum gross vehicle weight allowances.
- Highlights uncontracted accessorial charges such as tail-lift or night delivery fees.
- Dispatches winning mock carrier allocation payloads with audit timestamps.
## Starter Examples
```json
[
{
"input": {
"quote_language": "zh",
"text": "集装箱拖车报价:裕廊码头到大士仓库,20尺柜收费SGD 180,燃油附加费5%,停车费自理。",
"currency_declared": "SGD",
"base_allowance_sgd": 220
},
"expected_output": {
"carrier_fee_sgd": 180,
"fuel_surcharge_sgd": 9,
"total_estimated_sgd": 189,
"within_allowance": true,
"recommended_action": "APPROVE_AND_DISPATCH"
}
},
{
"input": {
"quote_language": "ms",
"text": "Sebut harga lori treler: Pasir Panjang ke Woodlands, SGD 350 tidak termasuk surcaj bahan api 20%.",
"currency_declared": "SGD",
"base_allowance_sgd": 250
},
"expected_output": {
"carrier_fee_sgd": 350,
"fuel_surcharge_sgd": 70,
"total_estimated_sgd": 420,
"within_allowance": false,
"recommended_action": "REJECT_EXCEEDS_BUDGET"
}
}
]
```
## Safety
Prevents live financial commitment; orders are simulated dispatches stored in local database queues.
Use mock external writes. Require human review before any real deployment.