import os
from tryagent import TryAgent
tryagent = TryAgent(api_key=os.environ["TRYAGENT_API_KEY"])
escalation = tryagent.escalate(
"orders.auth_doc",
{
"agentId": "order-agent",
"runId": "run_4821",
"subject": {
"type": "order",
"id": "ord_4821",
"label": "Order #4821",
},
"question": "The authorization document is missing a signature date. Continue?",
"evidence": [
"Candidate name is present.",
"Employer is present.",
"Signature date is blank.",
],
"choices": [
{"id": "manual_review", "label": "Send to manual review"},
{"id": "continue", "label": "Continue anyway"},
],
"resume": {
"mode": "webhook",
"url": "https://api.example.com/tryagent/resume",
"secret": os.environ["TRYAGENT_WEBHOOK_SECRET"],
},
},
)
print(escalation["id"], escalation["status"])