Download example.py from FluidInference/decision-2.0-eos-coreml: direct link, hf CLI and curl.
- Browser
- Download file 868 Bytes
-
https://huggingface.co/FluidInference/decision-2.0-eos-coreml/resolve/main/example.py
- Command line
-
hf download hf://FluidInference/decision-2.0-eos-coreml/example.py
-
curl -L -o example.py https://huggingface.co/FluidInference/decision-2.0-eos-coreml/resolve/main/example.py
868 Bytes
| import json | |
| from decision2_coreml import Decision2CoreML | |
| model = Decision2CoreML(".") | |
| result = model.system_one( | |
| state="The order arrived damaged yesterday. The customer has a receipt and asks for a replacement today.", | |
| questions={ | |
| "route": {"type": "choice", "instructions": "Which team should handle this request?", | |
| "criteria": {"returns": "Refunds, replacements and damaged deliveries", | |
| "billing": "Payments, invoices and charges", | |
| "technical": "Product setup and faults"}}, | |
| "receipt": {"type": "noul", "instructions": "Does the customer have a receipt?"}, | |
| "urgency": {"type": "score", "instructions": "How urgent is this request?", | |
| "criteria": ["Routine", "Soon", "Today"]}, | |
| }, | |
| ) | |
| print(json.dumps(result["answers"], indent=2)) | |