# This file was auto-generated by Fern from our API Definition.

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .model_pricing import ModelPricing


class ModelResponse(UniversalBaseModel):
    """
    Response schema for model catalog entries.
    """

    id: str = pydantic.Field()
    """
    Model ID with mdl_ prefix
    """

    key: str = pydantic.Field()
    """
    Stable internal slug
    """

    name: str = pydantic.Field()
    """
    Display name (maps to title)
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Model description
    """

    provider: typing.Optional[str] = pydantic.Field(default=None)
    """
    Provider slug
    """

    is_visible_in_ui: bool = pydantic.Field()
    """
    Whether model is shown in UI selectors
    """

    is_deprecated: bool = pydantic.Field()
    """
    Whether model is deprecated (computed from is_active)
    """

    availability_status: str = pydantic.Field()
    """
    Availability status: 'general_availability' or 'coming_soon'
    """

    capabilities: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Flattened list of capability strings
    """

    context_window: typing.Optional[int] = pydantic.Field(default=None)
    """
    Maximum context tokens (maps to model_context_limit)
    """

    pricing: typing.Optional[ModelPricing] = pydantic.Field(default=None)
    """
    Pricing information
    """

    release_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Model release date (when include_details=true)
    """

    recommended_for: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Recommended use cases (when include_details=true)
    """

    model_version: typing.Optional[str] = pydantic.Field(default=None)
    """
    Model version identifier
    """

    training_data_cutoff: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Training data cutoff date
    """

    added_to_aitronos_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Date when model was added to Aitronos
    """

    use_cases: typing.Optional[str] = pydantic.Field(default=None)
    """
    Detailed use case descriptions
    """

    strengths: typing.Optional[str] = pydantic.Field(default=None)
    """
    Model strengths and advantages
    """

    limitations: typing.Optional[str] = pydantic.Field(default=None)
    """
    Model limitations and constraints
    """

    performance_ratings: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Performance ratings across different dimensions
    """

    benchmark_scores: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None)
    """
    Benchmark test scores
    """

    documentation_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Link to Aitronos model documentation
    """

    provider_docs_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Link to provider's model documentation
    """

    badge: typing.Optional[str] = pydantic.Field(default=None)
    """
    UI badge identifier (e.g., 'recommended')
    """

    health_status: typing.Optional[str] = pydantic.Field(default=None)
    """
    Provider health status (healthy, degraded, unavailable)
    """

    health_message: typing.Optional[str] = pydantic.Field(default=None)
    """
    Health status message
    """

    health_checked_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp of last health check
    """

    health_response_time_ms: typing.Optional[float] = pydantic.Field(default=None)
    """
    Health check response time in milliseconds
    """

    last_used_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Last time this model was used by the requesting API key
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
