# 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 GenerationPreset(UniversalBaseModel):
    """
    Bundle of default values used when calling generation. All values except
    model name can be overridden at generation time.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of the generation preset to be used with configuring generation.
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Description of the generation preset.
    """

    llm_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Name of the model that these presets are used with.
    """

    prompt_template: typing.Optional[str] = pydantic.Field(default=None)
    """
    Preset template used to render the prompt sent to generation.
    """

    max_used_search_results: typing.Optional[int] = pydantic.Field(default=None)
    """
    Preset maximum number of search results that will be available to the prompt.
    """

    max_tokens: typing.Optional[int] = pydantic.Field(default=None)
    """
    Preset maximum number of tokens to be returned by the generation.
    """

    temperature: typing.Optional[float] = pydantic.Field(default=None)
    """
    The sampling temperature to use. Higher values make the output more random, while lower
    values make it more focused and deterministic.
    """

    frequency_penalty: typing.Optional[float] = pydantic.Field(default=None)
    """
    Higher values penalize new tokens based on their existing frequency in the generation so far,
    decreasing the model's likelihood to repeat the same line verbatim.
    """

    presence_penalty: typing.Optional[float] = pydantic.Field(default=None)
    """
    Higher values penalize new tokens based on whether they appear in the generation so far,
    increasing the model's likelihood to talk about new topics.
    """

    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether the prompt is enabled.
    """

    default: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates if this prompt is the default prompt used with the LLM.
    """

    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
