# generated by datamodel-codegen:
#   filename:  face_v1.json
#   timestamp: 2025-12-12T07:02:32+00:00

from __future__ import annotations

from pydantic import BaseModel, ConfigDict, Field, RootModel


class BboxItem(RootModel[float]):
    root: float = Field(..., ge=0.0)


class Face(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    bbox: list[BboxItem] = Field(..., max_length=4, min_length=4)
    """
    Bounding box coordinates [x1, y1, x2, y2] where (x1, y1) is top-left corner and (x2, y2) is bottom-right corner
    """
    confidence: float = Field(..., ge=0.0, le=1.0)
    """
    Detection confidence score
    """
    landmarks: list[float] | None = None
    """
    Facial landmark points (optional)
    """
    embedding: list[float] | None = None
    """
    Face embedding vector for recognition/comparison (optional)
    """


class FaceV1(BaseModel):
    """
    Universal schema for face detection and embedding responses across Lumen services
    """

    model_config = ConfigDict(
        extra='forbid',
    )
    faces: list[Face]
    """
    Detected faces with bounding boxes and metadata
    """
    count: int = Field(..., ge=0)
    """
    Number of detected faces
    """
    model_id: str = Field(..., min_length=1)
    """
    Model identifier
    """
