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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .retrieval_metadata import RetrievalMetadata


class RetrievalContent(UniversalBaseModel):
    number: int = pydantic.Field()
    """
    Citation position [[N]]
    """

    id: str = pydantic.Field()
    """
    Chroma vector ID
    """

    document: str = pydantic.Field()
    """
    Text content of the chunk
    """

    score: float = pydantic.Field()
    """
    Relevance score
    """

    rerank_score: typing.Optional[float] = pydantic.Field(default=None)
    """
    Rerank relevance score (only present when rerank is enabled)
    """

    metadata: RetrievalMetadata

    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
