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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from .language import Language
from .individual_search_result import IndividualSearchResult
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class QueryFullResponse(UniversalBaseModel):
    """
    The full response to a RAG query when the result is not streamed.
    """

    summary: typing.Optional[str] = pydantic.Field(default=None)
    """
    The summary of the search results.
    """

    response_language: typing.Optional[Language] = None
    search_results: typing.Optional[typing.List[IndividualSearchResult]] = pydantic.Field(default=None)
    """
    The ranked search results.
    """

    factual_consistency_score: typing.Optional[float] = pydantic.Field(default=None)
    """
    The probability that the summary is factually consistent with the results.
    """

    rendered_prompt: typing.Optional[str] = pydantic.Field(default=None)
    """
    The rendered prompt sent to the LLM. Useful when creating customer `prompt_text` templates. Only available
    to Scale customers.
    """

    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
