#!/usr/bin/env python3 import argparse import json import time from clef_exl3 import ClefEXL3 def main(): ap = argparse.ArgumentParser() ap.add_argument("--model", required=True) args = ap.parse_args() t0 = time.perf_counter() model = ClefEXL3(args.model) load_s = time.perf_counter() - t0 invoice = { "model": "clef-flash-exl3", "state": {"invoice": {"vendor": "Acme", "total": 1250.0, "currency": "USD", "status": "overdue"}}, "questions": { "status": { "type": "choice", "instructions": "What is the invoice status?", "criteria": {"paid": "Invoice is paid.", "overdue": "Invoice is past due.", "draft": "Not sent."} }, "large": {"type": "noul", "instructions": "Is the total above 1000 USD?"} } } outage = { "model": "clef-flash-exl3", "state": "Our checkout started returning errors and orders are blocked.", "questions": { "department": { "type": "choice", "instructions": "Which team should handle the message?", "criteria": {"billing": "Payments or invoices", "technical": "Bugs or outages"} }, "urgency": {"type": "score", "criteria": ["Can wait", "This week", "Today"]}, "outage": {"type": "noul", "instructions": "Is a service down?"} } } t1 = time.perf_counter() r1 = model.systemone(invoice) t2 = time.perf_counter() r2 = model.systemone(outage) t3 = time.perf_counter() passed = ( r1["answers"]["status"].get("choice") == "overdue" and r1["answers"]["large"].get("noul", 0) > 0.5 and r2["answers"]["department"].get("choice") == "technical" and r2["answers"]["outage"].get("noul", 0) > 0.5 ) result = { "passed": passed, "load_s": round(load_s, 3), "invoice_s": round(t2 - t1, 4), "outage_s": round(t3 - t2, 4), "invoice": r1, "outage": r2 } print(json.dumps(result, indent=2)) raise SystemExit(0 if passed else 3) if __name__ == "__main__": main()