vera-bot / test_final.py
Dov-tek
Restructure: rule-based decision engine + template slot-filling architecture
a1757c5
Raw
History Blame Contribute Delete
1.9 kB
import requests
import json
# Teardown first
requests.post("https://DeepikaChintamreddy-vera-bot.hf.space/v1/teardown", json={})
# Push fresh contexts with new trigger ID
category = {
"scope": "category",
"context_id": "dentists",
"version": 4,
"payload": {"category_slug": "dentists", "voice": {"register": "peer-clinical", "vocab_taboo": ["guaranteed"]}, "peer_stats": {"median_ctr": 3.0}, "offer_catalog": [{"title": "Dental Cleaning", "price": 299}]}
}
requests.post("https://DeepikaChintamreddy-vera-bot.hf.space/v1/context", json=category)
merchant = {
"scope": "merchant",
"context_id": "m_001",
"version": 4,
"payload": {"merchant_id": "m_001", "category_slug": "dentists", "identity": {"name": "Dr. Meera Dental Clinic", "languages": ["en", "hi"]}, "performance": {"current_ctr": 2.1, "delta_7d": {"ctr": -0.9}}, "offers": [{"title": "Dental Cleaning", "price": 299}], "customer_aggregate": {"high_risk_adult": 124}}
}
requests.post("https://DeepikaChintamreddy-vera-bot.hf.space/v1/context", json=merchant)
trigger = {
"scope": "trigger",
"context_id": "trg_final_test",
"version": 1,
"payload": {"id": "trg_final_test", "merchant_id": "m_001", "kind": "research_digest", "urgency": 3, "scope": "merchant", "suppression_key": "trg_final_test_v1", "source": "internal", "expires_at": "2026-05-10T23:59:00Z", "payload": {"digest_title": "JIDA Oct 2026: Fluoride Varnish", "key_stat": "Fluoride varnish reduces adult cavities by 38%", "source": "JIDA Oct 2026"}}
}
requests.post("https://DeepikaChintamreddy-vera-bot.hf.space/v1/context", json=trigger)
# Fire tick
data = {"now": "2026-04-30T12:05:00Z", "available_triggers": ["trg_final_test"]}
resp = requests.post(
"https://DeepikaChintamreddy-vera-bot.hf.space/v1/tick",
json=data,
headers={"Content-Type": "application/json"}
)
print(json.dumps(resp.json(), indent=2))