# 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 GenerationInfo(UniversalBaseModel):
    """
    Event containing information on how the generation was accomplished.
    """

    type: typing.Literal["generation_info"] = "generation_info"
    rendered_prompt: typing.Optional[str] = pydantic.Field(default=None)
    """
    The rendered prompt sent to the LLM. Useful when creating customer `prompt_template` templates.
    """

    rephrased_query: typing.Optional[str] = pydantic.Field(default=None)
    """
    View the actual query made to backend that was rephrased 
    by the LLM from the input query.
    """

    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
