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

from __future__ import annotations
from ..core.pydantic_utilities import UniversalBaseModel
from .chain_reranker import ChainReranker
import typing
import pydantic
from .context_configuration import ContextConfiguration
from .search_reranker import SearchReranker
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.pydantic_utilities import update_forward_refs


class SearchParameters(UniversalBaseModel):
    """
    Search parameters to retrieve knowledge for the query.
    """

    offset: typing.Optional[int] = pydantic.Field(default=None)
    """
    Specifies how many results into the result to skip. This is useful for pagination.
    """

    limit: typing.Optional[int] = pydantic.Field(default=None)
    """
    The maximum number of results returned.
    """

    context_configuration: typing.Optional[ContextConfiguration] = None
    reranker: typing.Optional[SearchReranker] = None

    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


update_forward_refs(ChainReranker, SearchParameters=SearchParameters)
