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

from __future__ import annotations

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel, update_forward_refs
from .generation_parameters import GenerationParameters
from .search_corpora_parameters import SearchCorporaParameters


class CorporaSearchQueryConfiguration(UniversalBaseModel):
    """
    User-configurable settings for corpora search that are not exposed to the LLM.
    """

    search: SearchCorporaParameters
    generation: typing.Optional[GenerationParameters] = None
    save_history: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether to save the query to query history.
    """

    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


from .chain_reranker import ChainReranker  # noqa: E402, F401, I001

update_forward_refs(CorporaSearchQueryConfiguration)
