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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .tool_id import ToolId


class StructuredIndexingTool(UniversalBaseModel):
    """
    A tool that indexes structured documents into the Vectara platform with full control over document structure, sections, metadata, tables, and images.
    """

    type: typing.Literal["structured_indexing"] = "structured_indexing"
    id: ToolId
    name: str = pydantic.Field()
    """
    Unique identifier for the tool.
    """

    title: typing.Optional[str] = pydantic.Field(default=None)
    """
    Human-readable title of the tool.
    """

    description: str = pydantic.Field()
    """
    A detailed description of what the tool does and how it can be used.
    """

    enabled: bool = pydantic.Field()
    """
    Whether the tool is currently enabled and available for use.
    """

    created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp when the tool was created.
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp when the tool was last updated.
    """

    input_schema: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
    """
    The schema that defines the expected input structure for the structured indexing tool.
    """

    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
