{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/docspeed-ai/json-schema/docspeed-ai-classification-result-schema.json",
  "title": "ClassificationResult",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/docspeed-ai-openapi.json#/components/schemas/ClassificationResult",
  "properties": {
    "doc_class": {
      "type": "string",
      "title": "Doc Class"
    },
    "input_type": {
      "type": "string",
      "enum": [
        "markdown",
        "image",
        "pdf",
        "text",
        "auto"
      ],
      "title": "Input Type",
      "default": "auto"
    },
    "page_count": {
      "type": "integer",
      "title": "Page Count",
      "default": 1
    },
    "page_classifications": {
      "items": {
        "$ref": "#/$defs/ClassificationPage"
      },
      "type": "array",
      "title": "Page Classifications"
    },
    "document_identity_hints": {
      "additionalProperties": true,
      "type": "object",
      "title": "Document Identity Hints"
    },
    "page_dimensions": {
      "items": {
        "$ref": "#/$defs/PageDimension"
      },
      "type": "array",
      "title": "Page Dimensions"
    },
    "classification_metadata": {
      "$ref": "#/$defs/ClassificationMetadata"
    },
    "debug": {
      "anyOf": [
        {
          "$ref": "#/$defs/ClassificationDebug"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "doc_class"
  ],
  "$defs": {
    "ClassificationDebug": {
      "properties": {
        "sampled_page_classifications": {
          "items": {
            "$ref": "#/$defs/ClassificationPage"
          },
          "type": "array",
          "title": "Sampled Page Classifications"
        }
      },
      "type": "object",
      "title": "ClassificationDebug"
    },
    "ClassificationMetadata": {
      "properties": {
        "classification_scope": {
          "type": "string",
          "enum": [
            "document",
            "page"
          ],
          "title": "Classification Scope",
          "default": "document"
        },
        "verbosity": {
          "type": "string",
          "enum": [
            "none",
            "debug"
          ],
          "title": "Verbosity",
          "default": "none"
        },
        "budget_limited": {
          "type": "boolean",
          "title": "Budget Limited",
          "default": false
        },
        "total_pages": {
          "type": "integer",
          "title": "Total Pages",
          "default": 1
        },
        "processed_pages": {
          "type": "integer",
          "title": "Processed Pages",
          "default": 1
        },
        "sampled_page_indexes": {
          "items": {
            "type": "integer"
          },
          "type": "array",
          "title": "Sampled Page Indexes"
        },
        "class_count": {
          "type": "integer",
          "title": "Class Count",
          "default": 0
        }
      },
      "type": "object",
      "title": "ClassificationMetadata"
    },
    "ClassificationPage": {
      "properties": {
        "page_index": {
          "type": "integer",
          "title": "Page Index"
        },
        "doc_class": {
          "type": "string",
          "title": "Doc Class"
        },
        "page_role": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Page Role"
        },
        "components_present": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Components Present"
        },
        "document_identity_hints": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Document Identity Hints"
        },
        "confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Confidence"
        }
      },
      "type": "object",
      "required": [
        "page_index",
        "doc_class"
      ],
      "title": "ClassificationPage"
    },
    "PageDimension": {
      "properties": {
        "page_index": {
          "type": "integer",
          "title": "Page Index"
        },
        "width": {
          "type": "integer",
          "title": "Width"
        },
        "height": {
          "type": "integer",
          "title": "Height"
        }
      },
      "type": "object",
      "required": [
        "page_index",
        "width",
        "height"
      ],
      "title": "PageDimension"
    }
  }
}