Buckets:

download
raw
1.52 kB
from pydantic import BaseModel
class PaginatedResponse[T](BaseModel):
"""Paginated response model"""
data: list[T]
total: int
page: int
per_page: int
total_pages: int
has_next: bool
has_prev: bool
class HealthStatus(BaseModel):
"""Response of the healthy path of /health"""
status: str
config_loaded: bool
version: str
class ErrorField(BaseModel):
"""One field-level validation problem."""
field: str
"""Dotted path to the offending field, e.g. "query.per_page"."""
message: str
"""Human-readable description of the problem."""
type: str
"""Pydantic error type, e.g. "greater_than_equal"."""
class ErrorResponse(BaseModel):
"""Unified error envelope returned by every API error response.
`detail` is always a plain string, on every status code including 422.
Clients may rely on that: it is the backward-compatible contract with
the frontend (`getApiErrorMessage`) and the CLI (`api_client.py`).
An optional `request_id` could be added here later without breaking
clients, should log correlation ever become worth the plumbing.
"""
detail: str
"""Human-readable message, safe to show to the user."""
code: str
"""Machine-readable error code in SCREAMING_SNAKE_CASE."""
status: int
"""HTTP status code, duplicated here so bodies are self-describing."""
errors: list[ErrorField] | None = None
"""Field-level problems. Populated only for validation errors (422)."""

Xet Storage Details

Size:
1.52 kB
·
Xet hash:
fd0fd61daf52cac9c16fddb9f91e4e07f1cb7a296d1cbf5cab6f54f3e55329ba

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.