# 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 .table_generation_spec import TableGenerationSpec


class TableExtractor(UniversalBaseModel):
    """
    A table extractor can be used to extract tabular data from documents during indexing.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the table extractor.
    """

    is_default: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Indicates whether it is the default extractor when not specified during indexing.
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    The description of the table extractor.
    """

    generation: typing.Optional[TableGenerationSpec] = None

    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
