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

import datetime as dt
import typing

from ..core.datetime_utils import serialize_datetime
from .model_version_build_config import ModelVersionBuildConfig
from .model_version_exec_config import ModelVersionExecConfig
from .model_version_read_status_enum import ModelVersionReadStatusEnum
from .provider_enum import ProviderEnum

try:
    import pydantic.v1 as pydantic  # type: ignore
except ImportError:
    import pydantic  # type: ignore


class ModelVersionRead(pydantic.BaseModel):
    id: str = pydantic.Field()
    """
    Vellum-generated ID that uniquely identifies this model version.
    """

    created: dt.datetime = pydantic.Field()
    """
    Timestamp of when this model version was created.
    """

    label: str = pydantic.Field()
    """
    Human-friendly name for this model version.
    """

    provider: ProviderEnum = pydantic.Field()
    """
    Which LLM provider this model version is associated with.
    
    - `ANTHROPIC` - Anthropic
    - `AWS_BEDROCK` - AWS Bedrock
    - `AZURE_OPENAI` - Azure OpenAI
    - `COHERE` - Cohere
    - `GOOGLE` - Google
    - `HOSTED` - Hosted
    - `MOSAICML` - MosaicML
    - `OPENAI` - OpenAI
    - `FIREWORKS_AI` - Fireworks AI
    - `HUGGINGFACE` - HuggingFace
    - `MYSTIC` - Mystic
    - `PYQ` - Pyq
    - `REPLICATE` - Replicate
    """

    external_id: str = pydantic.Field()
    """
    The unique id of this model version as it exists in the above provider's system.
    """

    build_config: ModelVersionBuildConfig = pydantic.Field()
    """
    Configuration used to build this model version.
    """

    exec_config: ModelVersionExecConfig = pydantic.Field()
    """
    Configuration used to execute this model version.
    """

    status: typing.Optional[ModelVersionReadStatusEnum] = None

    def json(self, **kwargs: typing.Any) -> str:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().json(**kwargs_with_defaults)

    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().dict(**kwargs_with_defaults)

    class Config:
        frozen = True
        smart_union = True
        extra = pydantic.Extra.allow
        json_encoders = {dt.datetime: serialize_datetime}
