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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .open_ai_moderations_guardrail_config_config_category_thresholds_value import (
    OpenAiModerationsGuardrailConfigConfigCategoryThresholdsValue,
)


class OpenAiModerationsGuardrailConfigConfig(UniversalBaseModel):
    model: str = pydantic.Field(default="omni-moderation-latest")
    """
    The model to use for the OpenAI Moderation API.
    """

    base_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Optional custom base URL for OpenAI API. If not provided, the default base URL will be used.
    """

    category_thresholds: typing.Optional[
        typing.Dict[str, OpenAiModerationsGuardrailConfigConfigCategoryThresholdsValue]
    ] = None

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

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