{
  "version": 1,
  "structures": [
    {
      "name": "booking_intake_response",
      "description": "从预约请求中解析出的信息",
      "example": {
        "service_type": "haircut",
        "requested_date": "2026-08-12",
        "requested_time": "14:30",
        "missing_details": [
          "phone number"
        ]
      },
      "schema": {
        "type": "object",
        "properties": {
          "service_type": {
            "type": "string"
          },
          "requested_date": {
            "type": "string"
          },
          "requested_time": {
            "type": "string"
          },
          "missing_details": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "service_type",
          "requested_date",
          "requested_time",
          "missing_details"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "booking_confirmation_response",
      "description": "发给客户的确认或跟进消息",
      "example": {
        "confirmation_status": "needs_more_info",
        "confirmation_message": "谢谢！能否留下手机号以便确认预约？",
        "next_steps": "回复手机号"
      },
      "schema": {
        "type": "object",
        "properties": {
          "confirmation_status": {
            "type": "string",
            "enum": [
              "confirmed",
              "needs_more_info"
            ]
          },
          "confirmation_message": {
            "type": "string"
          },
          "next_steps": {
            "type": "string"
          }
        },
        "required": [
          "confirmation_status",
          "confirmation_message",
          "next_steps"
        ],
        "additionalProperties": false
      }
    }
  ],
  "workflows": [
    {
      "name": "booking_intake_workflow",
      "description": "解析预约请求并启动确认流程",
      "provider": "openai",
      "model": "gpt-5.6-terra",
      "backups": [
        {
          "provider": "anthropic",
          "model": "claude-haiku-4-5-20251001"
        }
      ],
      "request_type": "chat",
      "system_instructions": "解析预约请求：识别服务项目、请求的日期与时间，以及缺失的信息。日期和时间保持客户填写的原样。",
      "structure": "booking_intake_response",
      "customer_fields": [
        "customer_name",
        "request_text",
        "preferred_date"
      ],
      "test_mode": false,
      "cache_window_seconds": 600,
      "backend_pipeline": {
        "enabled": true,
        "events": [
          {
            "name": "request_received"
          },
          {
            "name": "confirm_booking",
            "target_workflow": "booking_confirmation_workflow"
          },
          {
            "name": "confirmation_ready"
          }
        ]
      }
    },
    {
      "name": "booking_confirmation_workflow",
      "description": "确认预约或请求缺失信息",
      "provider": "anthropic",
      "model": "claude-haiku-4-5-20251001",
      "backups": [
        {
          "provider": "openai",
          "model": "gpt-5.6-terra"
        }
      ],
      "request_type": "chat",
      "system_instructions": "信息齐全时确认预约，缺少信息时向客户询问。撰写热情、简短的确认或跟进消息。",
      "structure": "booking_confirmation_response",
      "customer_fields": [
        "customer_name",
        "request_text",
        "preferred_date"
      ],
      "test_mode": false
    }
  ]
}
