fix: refact logic

This commit is contained in:
2025-12-31 17:38:32 +08:00
parent 6ac50f7d2f
commit 35928c2484
17 changed files with 678 additions and 738 deletions

View File

@@ -7,7 +7,7 @@ class MarkdownToDocxRequest(BaseModel):
"""Request body for markdown to DOCX conversion endpoint."""
markdown: str = Field(..., description="Markdown content to convert")
filename: str | None = Field(None, description="Optional output filename (without extension)")
filename: str = Field("texpixel", description="Optional output filename (without extension)")
@field_validator("markdown")
@classmethod

View File

@@ -9,14 +9,15 @@ class LayoutRegion(BaseModel):
type: str = Field(..., description="Region type: text, formula, table, figure")
bbox: list[float] = Field(..., description="Bounding box [x1, y1, x2, y2]")
confidence: float = Field(..., description="Detection confidence score")
score: float = Field(..., description="Detection score")
class LayoutInfo(BaseModel):
"""Layout detection information."""
regions: list[LayoutRegion] = Field(default_factory=list)
has_plain_text: bool = Field(False, description="Whether plain text was detected")
has_formula: bool = Field(False, description="Whether formulas were detected")
MixedRecognition: bool = Field(False, description="Whether mixed recognition was used")
# FormulaRecognition: bool = Field(False, description="Whether formula recognition (with prompt) was used")
class ImageOCRRequest(BaseModel):