mirror of
https://github.com/hanzoai/kai.git
synced 2026-10-17 11:18:06 +00:00
Every runner printed whatever came back and exited 0, and fell back to a second raw HTTP call when the SDK import failed. Now each recipe carries expect.json, the answers a careful reader gives on its own input: a list of acceptable options for a choice, of level indices for a score, true or false for a noul. run.py and run.ts send request.json through the SDK, print every answer, and exit 1 when a checked one is wrong. A question with no obvious answer on its input is printed and not checked. Recipes 09 and 11 had no input with an obvious answer, so each state gains the one fact that decides it. The recipe READMEs describe what each recipe asks instead of capabilities it never exercised, and copy the request and checked answers from the two JSON files. Co-authored-by: Hanzo Dev <[email protected]>
Sales: Inbound Lead Qualification
Sort an inbound lead into a tier and give it an overall fit score.
Request (request.json)
{
"model": "kai",
"state": {
"work_email": "[email protected]",
"company_size": "250-500",
"use_case": "Migrating 200 developers from Copilot to self-hosted Zen Coder models on private VPC.",
"budget": "$100k-$250k annual allocated",
"timeline": "Deploying within 30 days"
},
"questions": {
"lead_tier": {
"type": "choice",
"instructions": "Categorize enterprise lead quality",
"criteria": {
"tier_1_strategic": "enterprise with immediate budget, clear technical fit, and urgent timeline",
"tier_2_growth": "mid-market with valid use case and evaluation budget",
"tier_3_nurture": "early stage or student with unclear timeline"
}
},
"qualification_score": {
"type": "score",
"instructions": "Overall lead score",
"criteria": [
"0: disqualified",
"1: low fit",
"2: moderate fit",
"3: high fit",
"4: ideal customer profile (ICP)"
]
}
}
}
Checked answers (expect.json)
lead_tier(choice):tier_1_strategicqualification_score(score): most probable level 33: high fitor level 44: ideal customer profile (ICP)
Run
From the repository root, after pip install -r requirements.txt and npm install:
curl -sS --fail-with-body https://api.hanzo.ai/v1/decisions \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d @recipes/08_sales_lead_qualification/request.json
python3 recipes/08_sales_lead_qualification/run.py
npx tsx recipes/08_sales_lead_qualification/run.ts
run.py and run.ts print every answer and exit 1 when a checked answer is wrong.