feat: add omml api
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Request and response schemas for markdown to DOCX conversion endpoint."""
|
||||
"""Request and response schemas for format conversion endpoints."""
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
@@ -17,3 +17,23 @@ class MarkdownToDocxRequest(BaseModel):
|
||||
raise ValueError("Markdown content cannot be empty")
|
||||
return v
|
||||
|
||||
|
||||
class LatexToOmmlRequest(BaseModel):
|
||||
"""Request body for LaTeX to OMML conversion endpoint."""
|
||||
|
||||
latex: str = Field(..., description="Pure LaTeX formula (without $ or $$ delimiters)")
|
||||
|
||||
@field_validator("latex")
|
||||
@classmethod
|
||||
def validate_latex_not_empty(cls, v: str) -> str:
|
||||
"""Validate that LaTeX formula is not empty."""
|
||||
if not v or not v.strip():
|
||||
raise ValueError("LaTeX formula cannot be empty")
|
||||
return v
|
||||
|
||||
|
||||
class LatexToOmmlResponse(BaseModel):
|
||||
"""Response body for LaTeX to OMML conversion endpoint."""
|
||||
|
||||
omml: str = Field("", description="OMML (Office Math Markup Language) representation")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user