import os
import requests
ticket = {
"subject": "Charged twice for one subscription",
"body": "My card shows two charges for the same monthly plan. Please reverse one.",
"customer_tier": "enterprise",
}
response = requests.post(
"https://api.fastino.ai/v1/systemone",
headers={"X-API-Key": os.environ["FASTINO_API_KEY"]},
json={
"model": "fastino/GLiDE",
"state": ticket,
"questions": {
"destination": {
"type": "choice",
"instructions": "Which team should handle this request?",
"criteria": {
"billing": "Payments, invoices, charges, and refunds",
"technical": "Product errors, outages, and integration problems",
"account": "Login, access, permissions, and account settings",
"human_review": "Unclear or does not fit another route",
},
}
},
},
timeout=300,
)
response.raise_for_status()
answer = response.json()["answers"]["destination"]
route = answer["choice"]
confidence = answer["confidence"]
probabilities = answer["probabilities"]
if confidence < 0.5:
route = "human_review"