{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/avala-ai/json-schema/avala-ai-model-prediction-schema.json",
  "title": "ModelPrediction",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/avala-ai-models-api-openapi.yml#/components/schemas/ModelPrediction",
  "required": [
    "dataset_uid",
    "dataset_item_uid"
  ],
  "type": "object",
  "properties": {
    "dataset_uid": {
      "title": "Dataset uid",
      "type": "string",
      "minLength": 1
    },
    "dataset_item_uid": {
      "title": "Dataset item uid",
      "type": "string",
      "minLength": 1
    },
    "predictions": {
      "$ref": "#/$defs/ModelPredictionDatasetItemAnnotationList"
    }
  },
  "$defs": {
    "AnnotationUser": {
      "required": [
        "username"
      ],
      "type": "object",
      "properties": {
        "uid": {
          "title": "Uid",
          "type": "string",
          "format": "uuid",
          "readOnly": true
        },
        "full_name": {
          "title": "Full name",
          "type": "string",
          "readOnly": true
        },
        "username": {
          "title": "Username",
          "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.",
          "type": "string",
          "pattern": "^[\\w.@+-]+$",
          "maxLength": 150,
          "minLength": 1
        },
        "picture": {
          "title": "Picture",
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "maxLength": 2048
        }
      }
    },
    "DatasetItemAnnotation": {
      "required": [
        "task_name",
        "task_object",
        "object_uuid"
      ],
      "type": "object",
      "properties": {
        "task_name": {
          "title": "Task name",
          "type": "string",
          "minLength": 1
        },
        "task_object": {
          "title": "Task object",
          "type": "string",
          "minLength": 1
        },
        "object_uuid": {
          "title": "Object uuid",
          "type": [
            "string",
            "null"
          ],
          "minLength": 1
        },
        "data": {
          "title": "Data",
          "type": "object",
          "readOnly": true
        }
      }
    },
    "DatasetItemAnnotationNode": {
      "required": [
        "annotation_info",
        "status",
        "uid",
        "project_index",
        "children"
      ],
      "type": "object",
      "properties": {
        "annotation_info": {
          "$ref": "#/$defs/DatasetItemAnnotation"
        },
        "status": {
          "title": "Status",
          "type": "string",
          "minLength": 1
        },
        "uid": {
          "title": "Uid",
          "type": "string",
          "minLength": 1
        },
        "project_index": {
          "title": "Project index",
          "type": [
            "integer",
            "null"
          ]
        },
        "annotator": {
          "$ref": "#/$defs/AnnotationUser"
        },
        "reviewer": {
          "$ref": "#/$defs/AnnotationUser"
        },
        "children": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DatasetItemAnnotationNode"
          }
        }
      }
    },
    "ModelPredictionDatasetItemAnnotationList": {
      "required": [
        "nodes"
      ],
      "type": "object",
      "properties": {
        "nodes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DatasetItemAnnotationNode"
          }
        }
      }
    }
  }
}