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

from ..core.pydantic_utilities import UniversalBaseModel
from .embedding_config_embedding_endpoint_type import EmbeddingConfigEmbeddingEndpointType
import pydantic
import typing
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class EmbeddingConfig(UniversalBaseModel):
    """
    Embedding model configuration. This object specifies all the information necessary to access an embedding model to usage with Letta, except for secret keys.

    Attributes:
    embedding_endpoint_type (str): The endpoint type for the model.
    embedding_endpoint (str): The endpoint for the model.
    embedding_model (str): The model for the embedding.
    embedding_dim (int): The dimension of the embedding.
    embedding_chunk_size (int): The chunk size of the embedding.
    azure_endpoint (:obj:`str`, optional): The Azure endpoint for the model (Azure only).
    azure_version (str): The Azure version for the model (Azure only).
    azure_deployment (str): The Azure deployment for the model (Azure only).
    """

    embedding_endpoint_type: EmbeddingConfigEmbeddingEndpointType = pydantic.Field()
    """
    The endpoint type for the model.
    """

    embedding_endpoint: typing.Optional[str] = pydantic.Field(default=None)
    """
    The endpoint for the model (`None` if local).
    """

    embedding_model: str = pydantic.Field()
    """
    The model for the embedding.
    """

    embedding_dim: int = pydantic.Field()
    """
    The dimension of the embedding.
    """

    embedding_chunk_size: typing.Optional[int] = pydantic.Field(default=None)
    """
    The chunk size of the embedding.
    """

    handle: typing.Optional[str] = pydantic.Field(default=None)
    """
    The handle for this config, in the format provider/model-name.
    """

    azure_endpoint: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Azure endpoint for the model.
    """

    azure_version: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Azure version for the model.
    """

    azure_deployment: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Azure deployment for the model.
    """

    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
