{
  "version": 1,
  "structures": [
    {
      "name": "refund_triage_response",
      "description": "Classification of the incoming refund request",
      "example": {
        "intent": "refund_request",
        "reason_category": "damaged_item",
        "sentiment": "frustrated",
        "needs_manual_review": false
      },
      "schema": {
        "type": "object",
        "properties": {
          "intent": {
            "type": "string"
          },
          "reason_category": {
            "type": "string"
          },
          "sentiment": {
            "type": "string"
          },
          "needs_manual_review": {
            "type": "boolean"
          }
        },
        "required": [
          "intent",
          "reason_category",
          "needs_manual_review"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "refund_decision_response",
      "description": "Refund eligibility decision and customer-facing reply",
      "example": {
        "decision": "approve",
        "refund_amount_usd": 49.99,
        "explanation": "Item arrived damaged; approved per policy section 3.2.",
        "customer_reply": "We've approved a full refund of $49.99 to your original payment method."
      },
      "schema": {
        "type": "object",
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "partial",
              "deny",
              "escalate"
            ]
          },
          "refund_amount_usd": {
            "type": "number"
          },
          "explanation": {
            "type": "string"
          },
          "customer_reply": {
            "type": "string"
          }
        },
        "required": [
          "decision",
          "explanation",
          "customer_reply"
        ],
        "additionalProperties": false
      }
    }
  ],
  "workflows": [
    {
      "name": "refund_triage_workflow",
      "description": "Classifies refund requests and starts the decision pipeline",
      "provider": "openai",
      "model": "gpt-5.6-terra",
      "backups": [
        {
          "provider": "anthropic",
          "model": "claude-haiku-4-5-20251001"
        }
      ],
      "request_type": "chat",
      "system_instructions": "Classify the refund request: identify intent, reason category, and sentiment. Flag cases needing manual review.",
      "structure": "refund_triage_response",
      "customer_fields": [
        "customer_id",
        "order_id"
      ],
      "test_mode": false,
      "cache_window_seconds": 900,
      "backend_pipeline": {
        "enabled": true,
        "events": [
          {
            "name": "request_started"
          },
          {
            "name": "evaluate_refund",
            "target_workflow": "refund_decision_workflow"
          },
          {
            "name": "request_completed"
          }
        ]
      }
    },
    {
      "name": "refund_decision_workflow",
      "description": "Evaluates refund eligibility and drafts the customer reply",
      "provider": "anthropic",
      "model": "claude-haiku-4-5-20251001",
      "backups": [
        {
          "provider": "openai",
          "model": "gpt-5.6-terra"
        }
      ],
      "request_type": "chat",
      "system_instructions": "Apply the refund policy to the triaged request and order details. Decide approve/partial/deny/escalate and write a concise customer reply.",
      "structure": "refund_decision_response",
      "customer_fields": [
        "customer_id",
        "order_id"
      ],
      "test_mode": false
    }
  ]
}
