{
  "version": 1,
  "structures": [
    {
      "name": "ticket_triage_response",
      "description": "对收到的支持工单进行分类",
      "example": {
        "category": "technical",
        "priority": "high",
        "sentiment": "frustrated",
        "needs_human": true
      },
      "schema": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string",
            "enum": [
              "billing",
              "technical",
              "account",
              "feature_request",
              "other"
            ]
          },
          "priority": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high",
              "urgent"
            ]
          },
          "sentiment": {
            "type": "string"
          },
          "needs_human": {
            "type": "boolean"
          }
        },
        "required": [
          "category",
          "priority",
          "sentiment",
          "needs_human"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "ticket_reply_response",
      "description": "草拟的首次回复与给客户的后续步骤",
      "example": {
        "reply": "感谢你的反馈，我已开始为你处理这个问题。",
        "next_steps": [
          "尝试清除浏览器缓存",
          "请确认你看到的报错信息"
        ],
        "needs_human": true
      },
      "schema": {
        "type": "object",
        "properties": {
          "reply": {
            "type": "string"
          },
          "next_steps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "needs_human": {
            "type": "boolean"
          }
        },
        "required": [
          "reply",
          "next_steps",
          "needs_human"
        ],
        "additionalProperties": false
      }
    }
  ],
  "workflows": [
    {
      "name": "ticket_triage_workflow",
      "description": "对工单分类并启动回复流水线",
      "provider": "xai",
      "model": "grok-4.5",
      "backups": [
        {
          "provider": "anthropic",
          "model": "claude-haiku-4-5-20251001"
        }
      ],
      "request_type": "chat",
      "system_instructions": "对支持工单进行分类：选择类别、设定优先级、记录客户情绪，并标记发送前必须由人工客服审核的工单。",
      "structure": "ticket_triage_response",
      "customer_fields": [
        "ticket_id",
        "customer_message"
      ],
      "test_mode": false,
      "cache_window_seconds": 600,
      "backend_pipeline": {
        "enabled": true,
        "events": [
          {
            "name": "ticket_received"
          },
          {
            "name": "draft_reply",
            "target_workflow": "ticket_reply_workflow"
          },
          {
            "name": "reply_ready"
          }
        ]
      }
    },
    {
      "name": "ticket_reply_workflow",
      "description": "草拟一封客服团队可以直接发出的首次回复",
      "provider": "anthropic",
      "model": "claude-haiku-4-5-20251001",
      "backups": [
        {
          "provider": "xai",
          "model": "grok-4.5"
        }
      ],
      "request_type": "chat",
      "system_instructions": "为支持工单撰写一封友好的首次回复，给出客户可以执行的清晰步骤，并持续标记需要人工客服的工单。",
      "structure": "ticket_reply_response",
      "customer_fields": [
        "ticket_id",
        "customer_message"
      ],
      "test_mode": false
    }
  ]
}
