Files
ledgerdock/backend/app/schemas/processing_logs.py
2026-02-21 09:44:18 -03:00

36 lines
900 B
Python

"""Pydantic schemas for processing pipeline log API payloads."""
from datetime import datetime
from uuid import UUID
from pydantic import BaseModel, Field
class ProcessingLogEntryResponse(BaseModel):
"""Represents one persisted processing log event returned by API endpoints."""
id: int
created_at: datetime
level: str
stage: str
event: str
document_id: UUID | None
document_filename: str | None
provider_id: str | None
model_name: str | None
prompt_text: str | None
response_text: str | None
payload_json: dict
class Config:
"""Enables ORM object parsing for SQLAlchemy model instances."""
from_attributes = True
class ProcessingLogListResponse(BaseModel):
"""Represents a paginated collection of processing log records."""
total: int
items: list[ProcessingLogEntryResponse] = Field(default_factory=list)