wassemgtk's picture
Add gateway API source for one-click deployment
092fd7d verified
Raw
History Blame Contribute Delete
994 Bytes
from typing import Any, Literal
from pydantic import BaseModel, Field
from .assets import BBox, Provenance
class PaletteTokens(BaseModel):
background: str
surface: str
primary: str
secondary: str
accent: str
text_dark: str
text_light: str = "#FFFFFF"
data_series: list[str] = Field(default_factory=list)
provenance: dict[str, Any] = Field(default_factory=dict)
class OcrLine(BaseModel):
id: str
text: str
bbox: BBox
confidence: float
reading_order: int
region_type: str = "text_line"
class OcrView(BaseModel):
markdown: str
lines: list[OcrLine]
tables: list[dict[str, Any]] = Field(default_factory=list)
class GroundedObject(BaseModel):
label: str
bbox: BBox
confidence: float
class VisualViewEnvelope(BaseModel):
view_type: Literal["fingerprint", "palette", "presentation_theme", "ocr", "objects", "chart_ir"]
payload: dict[str, Any]
confidence: float
provenance: list[Provenance]