Production-minded Python pipeline for the HackerRank Orchestrate damage-claim verification task.
Staged orchestration with images as the primary source of truth:
- Claim extraction (
gpt-4o-mini) – parse the conversation into structured claim intent - Per-image VLM analysis (
gpt-4o) – inspect each image independently - Decision synthesis (
gpt-4o-mini) – combine visual evidence, evidence requirements, and user history risk flags
A second single-pass strategy is included for evaluation comparison.
cd code
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt
copy .env.example .env # Windows
# cp .env.example .env # macOS/LinuxAdd your OpenAI key to code/.env:
OPENAI_API_KEY=sk-...From the repository root:
python code/main.py --input dataset/claims.csv --output output.csv --strategy multi_stageOptions:
| Flag | Default | Description |
|---|---|---|
--input |
dataset/claims.csv |
Input claims CSV |
--output |
output.csv |
Output predictions CSV |
--dataset-root |
dataset |
Folder containing images/ |
--strategy |
multi_stage |
multi_stage or single_pass |
--metrics-out |
none | Optional JSON usage metrics |
Compares both strategies on dataset/sample_claims.csv:
python code/evaluation/main.pyOutputs:
code/evaluation/evaluation_report.mdcode/evaluation/results.json
Then run the winning strategy on the test set.
code/
├── main.py
├── requirements.txt
├── prompts/
├── src/
│ ├── pipeline.py
│ ├── llm_client.py
│ ├── data_loader.py
│ └── schema.py
└── evaluation/
├── main.py
└── evaluation_report.md
- JSON caching under
code/.cache/avoids repeated VLM calls during development - Exponential backoff retries on API failures
- Configurable
REQUEST_DELAY_SECONDSfor RPM throttling - Usage metrics and approximate USD cost are printed after each run
-
output.csvhas one row perdataset/claims.csvrow - Column order matches
problem_statement.md - Zip
code/(exclude.venv,.cache,__pycache__) - Upload chat transcript from
%USERPROFILE%\hackerrank_orchestrate\log.txt