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

from __future__ import annotations
from ..core.pydantic_utilities import UniversalBaseModel
from .metadata_filters import MetadataFilters
import pydantic
import typing
from .retriever_pipeline import RetrieverPipeline
import datetime as dt
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.pydantic_utilities import update_forward_refs


class Retriever(UniversalBaseModel):
    """
    An entity that retrieves context nodes from several sub RetrieverTools.
    """

    name: str = pydantic.Field()
    """
    A name for the retriever tool. Will default to the pipeline name if not provided.
    """

    pipelines: typing.Optional[typing.List[RetrieverPipeline]] = pydantic.Field(default=None)
    """
    The pipelines this retriever uses.
    """

    id: str = pydantic.Field()
    """
    Unique identifier
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Creation datetime
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Update datetime
    """

    project_id: str = pydantic.Field()
    """
    The ID of the project this retriever resides in.
    """

    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(MetadataFilters, Retriever=Retriever)
