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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .entity_search_request_mode import EntitySearchRequestMode
from .entity_search_request_return_format import EntitySearchRequestReturnFormat


class EntitySearchRequest(UncheckedBaseModel):
    """
    Entity search request with flexible return formats
    """

    query: str = pydantic.Field()
    """
    Search query text
    """

    entity_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Specific entity IDs to search within
    """

    entity_types: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Entity types to search (file, note, etc)
    """

    mode: typing.Optional[EntitySearchRequestMode] = pydantic.Field(default=None)
    """
    Search mode
    """

    return_format: typing.Optional[EntitySearchRequestReturnFormat] = pydantic.Field(default=None)
    """
    What to return - chunks, entity info, or full text
    """

    limit: typing.Optional[int] = pydantic.Field(default=None)
    """
    Max results
    """

    similarity_threshold: typing.Optional[float] = pydantic.Field(default=None)
    """
    Minimum similarity score
    """

    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
