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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel


class SoftTimeoutConfig(UncheckedBaseModel):
    """
    Configuration for soft timeout functionality during LLM response generation.
    """

    timeout_seconds: typing.Optional[float] = pydantic.Field(default=None)
    """
    Time in seconds before showing the predefined message while waiting for LLM response. Set to -1 to disable.
    """

    message: typing.Optional[str] = pydantic.Field(default=None)
    """
    Message to show when soft timeout is reached while waiting for LLM response
    """

    use_llm_generated_message: typing.Optional[bool] = pydantic.Field(default=None)
    """
    If enabled, the soft timeout message will be generated dynamically instead of using the static message.
    """

    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
