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

import typing

import pydantic
import typing_extensions
from ....core.pydantic_utilities import IS_PYDANTIC_V2
from ....core.serialization import FieldMetadata
from ....core.unchecked_base_model import UncheckedBaseModel


class PatchAgentIdRequestLanguageSwitching(UncheckedBaseModel):
    """
    Language switching configuration for the agent. If enabled, the agent will be able to switch between languages based on the user's language.
    """

    is_enabled: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="isEnabled"),
        pydantic.Field(alias="isEnabled", description="Whether to enable language switching for the agent"),
    ] = None
    min_words_for_detection: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="minWordsForDetection"),
        pydantic.Field(
            alias="minWordsForDetection", description="Minimum number of words required for language detection"
        ),
    ] = None
    strong_signal_threshold: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="strongSignalThreshold"),
        pydantic.Field(
            alias="strongSignalThreshold", description="Threshold for strong language signal detection (0.1 to 0.9)"
        ),
    ] = None
    weak_signal_threshold: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="weakSignalThreshold"),
        pydantic.Field(
            alias="weakSignalThreshold", description="Threshold for weak language signal detection (0.1 to 0.9)"
        ),
    ] = None
    min_consecutive_for_weak_threshold_switch: typing_extensions.Annotated[
        typing.Optional[float],
        FieldMetadata(alias="minConsecutiveForWeakThresholdSwitch"),
        pydantic.Field(
            alias="minConsecutiveForWeakThresholdSwitch",
            description="Minimum consecutive detections required for weak threshold language switch",
        ),
    ] = 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
