fix: refact logic
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user