# 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
from ..core.unchecked_base_model import UncheckedBaseModel
from .llm import Llm
from .llm_deprecation_config_model import LlmDeprecationConfigModel


class LlmDeprecationInfoModel(UncheckedBaseModel):
    llm: Llm = pydantic.Field()
    """
    The identifier of the deprecated LLM model.
    """

    is_deprecated: bool = pydantic.Field()
    """
    Whether this model is currently deprecated. True if the model is immediately deprecated or within the warning period.
    """

    is_in_warning_period: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether this model is currently in the warning period before deprecation.
    """

    is_in_fallback_period: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether traffic is currently being progressively routed to the replacement model.
    """

    fallback_percentage: typing.Optional[int] = pydantic.Field(default=None)
    """
    Current percentage of traffic being routed to the replacement model (0-100).
    """

    provider_deprecation_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    The date when the model provider will deprecate this model. Null for immediately deprecated models.
    """

    replacement_model: typing.Optional[Llm] = pydantic.Field(default=None)
    """
    The model that replaces this deprecated model. Traffic will be automatically routed to this model.
    """

    deprecation_config: typing.Optional[LlmDeprecationConfigModel] = pydantic.Field(default=None)
    """
    Custom deprecation timing configuration for this model. Null if using the default configuration.
    """

    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
