Skip to main content
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 Rural Artisan Group Bulk Order Quote Negotiator

Format
Code-aware
Lines
67
Sections
11
Linked challenge
Build a Rural Artisan Group Bulk Order Quote Negotiator

Prompt source

Original prompt text with formatting preserved for inspection.

67 lines
11 sections
No variables
1 code block
## Build
Process buyer requests for bulk custom artisan crafts using Beckn quoting schemas. Calculate cooperative production capacity based on daily limits and material lead times, and generate structured multi-tier price quotes.

## User
Rural craft cooperative catalog manager

## Workflow
1. Ingest buyer requests for bulk custom artisan craft orders via simplified Beckn quoting schemas.
2. Extract requested quantities, customization requirements, and delivery timelines from the request.
3. Calculate feasible production capacity and raw material lead times using cooperative constraints.
4. Generate a structured price quote indicating feasibility, lead time, and validity horizons.

## Interface
Artisan cooperative dashboard showing incoming bulk requests, capacity calculations, and generated quote previews.

## Data
Generate synthetic buyer request datasets and cooperative production profiles specifying daily capacity and raw material lead times.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Beckn protocol specifications](https://raw.githubusercontent.com/beckn/protocol-specifications/master/README.md)
Applies Beckn Protocol Core specifications for ordering events, specifically quote calculation and negotiation.

## Tools
pydantic-ai, fastapi, pandas.
Pydantic AI orchestrates the extraction of request parameters and ensures the calculated quote adheres to a strict schema.
Language model capable of extracting numerical constraints and generating structured commercial negotiation responses.

## 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
- Successfully parses bulk order requests into structured internal parameters.
- Accurately calculates total lead time as (requested quantity / daily capacity) + material lead time.
- Marks the quote as CAPACITY_EXCEEDED_REJECTED if the calculated lead time exceeds the requested delivery days.

## Starter Examples
```json
[
  {
    "input": {
      "request_id": "REQ-001",
      "requested_quantity": 200,
      "delivery_days_requested": 30,
      "daily_capacity": 10,
      "material_lead_time_days": 5
    },
    "expected_output": {
      "capacity_feasible": true,
      "estimated_lead_time_days": 25,
      "unit_price_tier_1": 1200,
      "quote_status": "READY_FOR_BUYER",
      "note": "Simplified synthetic app record, not official schema"
    }
  },
  {
    "input": {
      "request_id": "REQ-002",
      "requested_quantity": 500,
      "delivery_days_requested": 15,
      "daily_capacity": 10,
      "material_lead_time_days": 10
    },
    "expected_output": {
      "capacity_feasible": false,
      "estimated_lead_time_days": 60,
      "unit_price_tier_1": null,
      "quote_status": "CAPACITY_EXCEEDED_REJECTED",
      "note": "Simplified synthetic app record, not official schema"
    }
  }
]
```

## Safety
Ensures no real B2B commercial data is exposed; relies entirely on synthetic capacity and request mockups.
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.