# 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 .chunk_result import ChunkResult


class StructuredDataExtractorResponse(UniversalBaseModel):
    """
    The agent's response.
    """

    chunk_by_chunk_data: typing.Optional[typing.List[ChunkResult]] = pydantic.Field(default=None)
    """
    The extracted structured data for each chunk.  A list where each element is guaranteed to match `json_schema`.
    """

    reduced_data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
    """
    If reduce is True, the reduced structured data, otherwise null.  Guaranteed to match `json_schema`.
    """

    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
