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 Carrier Quotation Parser and Route Dispatcher
Format
Code-aware
Lines
66
Sections
11
Linked challenge
Build a Multilingual Carrier Quotation Parser and Route Dispatcher
Prompt source
Original prompt text with formatting preserved for inspection.
66 lines
11 sections
No variables
1 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.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.