# AUTOGENERATED FILE, DO NOT MANUALLY EDIT
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, Literal # noqa: F401
from pydantic import BaseModel, Field
from pydantic.main import object_setattr
from .base import PerspectiveConfiguration
[docs]class TypographyPerspectiveSegmenter(str, Enum):
pdftotext = "pdftotext"
pdfminer = "pdfminer"
tesseract = "tesseract"
[docs]class TypographyPerspectiveConfig(BaseModel):
options: Dict = Field(default_factory=dict, title="Options") # OVERRIDE
segmenter: TypographyPerspectiveSegmenter = Field(
default="pdftotext", examples=["pdftotext", "pdfminer", "tesseract"]
)
[docs] class Config:
use_enum_values = True
arbitrary_types_allowed = True
[docs]class TypographyPerspective(PerspectiveConfiguration):
name: Literal["typography"] = Field(default="typography")
config: TypographyPerspectiveConfig = Field(
default_factory=TypographyPerspectiveConfig, description="Specific configuration options for the enrichment"
)
def __init__(__pydantic_self__, **data: Any) -> None:
super().__init__(**data)
# we want to make sure that the _name_ attribute is _always_ serialized even when "exclude_unset" is True
object_setattr(__pydantic_self__, "__fields_set__", __pydantic_self__.__fields_set__.union({"name"}))