43 lines
991 B
Python
43 lines
991 B
Python
from typing import Optional
|
|
from pydantic import BaseModel
|
|
from sqlalchemy import Column, Integer, String, Text, DateTime, Boolean, func
|
|
from app.database import Base
|
|
|
|
|
|
class Conversion(Base):
|
|
__tablename__ = "conversions"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
filename = Column(String(255), nullable=False)
|
|
file_type = Column(String(50))
|
|
markdown = Column(Text)
|
|
llm_enabled = Column(Boolean, default=False)
|
|
created_at = Column(DateTime, server_default=func.now())
|
|
|
|
|
|
class ConvertResponse(BaseModel):
|
|
id: int
|
|
filename: str
|
|
markdown: str
|
|
llm_enabled: bool = False
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class HealthResponse(BaseModel):
|
|
status: str
|
|
llm_enabled: bool = False
|
|
llm_model: Optional[str] = None
|
|
|
|
|
|
class ConversionRecord(BaseModel):
|
|
id: int
|
|
filename: str
|
|
file_type: Optional[str] = None
|
|
llm_enabled: bool = False
|
|
created_at: str
|
|
|
|
class Config:
|
|
from_attributes = True
|