{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "TurnFailure",
  "type": "object",
  "properties": {
    "code": {
      "$ref": "#/$defs/TurnFailureCode"
    },
    "message": {
      "type": "string"
    },
    "retryable": {
      "type": "boolean"
    }
  },
  "required": [
    "code",
    "message",
    "retryable"
  ],
  "$defs": {
    "TurnFailureCode": {
      "type": "string",
      "enum": [
        "stale_node",
        "invalid_input",
        "invalid_model_output",
        "provider_unavailable",
        "cancelled",
        "timed_out",
        "internal"
      ]
    }
  }
}
