# generated by datamodel-codegen:
#   filename:  model_info-schema.json
#   timestamp: 2025-12-11T07:52:17+00:00

from __future__ import annotations

from datetime import date
from enum import Enum
from typing import Any

from pydantic import AwareDatetime, BaseModel, ConfigDict, Field


class Format(Enum):
    huggingface = 'huggingface'
    openclip = 'openclip'
    modelscope = 'modelscope'
    custom = 'custom'


class Source(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    format: Format
    repo_id: str = Field(..., min_length=1)
    """
    Repository identifier for model source
    """


class Requirements(BaseModel):
    python: str | None = None
    dependencies: list[str] | None = None


class Runtimes(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    available: bool
    files: list[str] | dict[str, list[str]] | None = None
    devices: list[str] | None = None
    requirements: Requirements | None = None


class Datasets(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    labels: str
    embeddings: str


class Metadata(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    license: str | None = None
    author: str | None = None
    created_at: date | None = None
    updated_at: AwareDatetime | None = None
    tags: list[str] | None = None


class ModelInfo(BaseModel):
    """
    Schema for Lumen AI model configuration files
    """

    model_config = ConfigDict(
        extra='forbid',
    )
    name: str = Field(..., max_length=100, min_length=1)
    """
    Model name identifier, this is also openclip model identifier if openclip is set as source format
    """
    version: str = Field(..., pattern='^[0-9]+\\.[0-9]+\\.[0-9]+$')
    """
    Model version
    """
    description: str = Field(..., max_length=500, min_length=1)
    """
    Model description and purpose
    """
    model_type: str
    """
    Type of the model
    """
    embedding_dim: int | None = Field(None, ge=1, le=100000)
    """
    Dimension of the embedding space
    """
    source: Source
    runtimes: dict[str, Runtimes]
    datasets: dict[str, Datasets] | None = None
    extra_metadata: dict[str, Any] | None = None
    """
    Additional model-specific configuration and metadata
    """
    metadata: Metadata | None = None
