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

import typing

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


class SamplingParams(UniversalBaseModel):
    seed: typing.Optional[int] = pydantic.Field(default=None)
    """
    Generations with the same parameters _including_ a non-null `seed` are identical.
    """

    temperature: typing.Optional[float] = pydantic.Field(default=None)
    """
    Smaller values correspond to more stable but less expressive speech. Must be greater than or equal to 0.
    """

    top_k: typing.Optional[int] = pydantic.Field(default=None)
    """
    Must be -1 or greater than 0.
    """

    top_p: typing.Optional[float] = pydantic.Field(default=None)
    """
    Must be greater than 0 and less than or equal to 1.
    """

    min_p: typing.Optional[float] = pydantic.Field(default=None)
    """
    Must be between 0 and 1, inclusive.
    """

    repetition_penalty: typing.Optional[float] = pydantic.Field(default=None)
    """
    Must be between 1 and 2, inclusive.
    """

    frequency_penalty: typing.Optional[float] = pydantic.Field(default=None)
    """
    Must be between 0 and 2, inclusive.
    """

    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
