# 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


class AgentKnowledgeBaseRagChunkResponseModel(UncheckedBaseModel):
    document_id: str = pydantic.Field()
    """
    ID of the source knowledge base document.
    """

    document_name: str = pydantic.Field()
    """
    Name of the source knowledge base document.
    """

    chunk_id: str = pydantic.Field()
    """
    ID of the retrieved chunk.
    """

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

    vector_distance: typing.Optional[float] = pydantic.Field(default=None)
    """
    Similarity distance when exposed by the retrieval strategy.
    """

    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
