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

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


class AzureOpenAiEmbedding(UniversalBaseModel):
    model_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the OpenAI embedding model.
    """

    embed_batch_size: typing.Optional[int] = pydantic.Field(default=None)
    """
    The batch size for embedding calls.
    """

    num_workers: typing.Optional[int] = pydantic.Field(default=None)
    """
    The number of workers to use for async embedding calls.
    """

    additional_kwargs: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    Additional kwargs for the OpenAI API.
    """

    api_key: typing.Optional[str] = pydantic.Field(default=None)
    """
    The OpenAI API key.
    """

    api_base: typing.Optional[str] = pydantic.Field(default=None)
    """
    The base URL for Azure deployment.
    """

    api_version: typing.Optional[str] = pydantic.Field(default=None)
    """
    The version for Azure OpenAI API.
    """

    max_retries: typing.Optional[int] = pydantic.Field(default=None)
    """
    Maximum number of retries.
    """

    timeout: typing.Optional[float] = pydantic.Field(default=None)
    """
    Timeout for each request.
    """

    default_headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
    """
    The default headers for API requests.
    """

    reuse_client: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Reuse the OpenAI client between requests. When doing anything with large volumes of async API calls, setting this to false can improve stability.
    """

    dimensions: typing.Optional[int] = pydantic.Field(default=None)
    """
    The number of dimensions on the output embedding vectors. Works only with v3 embedding models.
    """

    azure_endpoint: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Azure endpoint to use.
    """

    azure_deployment: typing.Optional[str] = pydantic.Field(default=None)
    """
    The Azure deployment to use.
    """

    class_name: typing.Optional[str] = None

    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
