Files
ai-agent/backend/schemas/base.py
Gabriel Vidal 2119af66d5 refactor(schemas): split backend/schemas.py into a schemas/ package
One module per API area (base, files, activity, skills, conversations,
notifications, forms, search, plans, projects, services, misc, diff, cron,
agents) on a shared base.Schema; __init__.py re-exports every model so
handlers keep writing schemas.<Name>. OpenAPI output is byte-identical.
PlanSummary lives in conversations.py to keep the module graph a DAG.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-06 23:55:47 +02:00

26 lines
667 B
Python

"""Shared base of every response model: the ``Schema`` root (opts out of
Pydantic's protected ``model_`` namespace) and the per-account split."""
from __future__ import annotations
from pydantic import BaseModel, ConfigDict
__all__ = [
"Schema",
"AccountSplit",
]
class Schema(BaseModel):
# ``model`` is a legit field name on several of these; opt out of Pydantic's
# protected ``model_`` namespace so it doesn't warn.
model_config = ConfigDict(protected_namespaces=())
class AccountSplit(Schema):
"""One account's share of an aggregate (the ``byAccount`` maps)."""
cost: float = 0.0
tokens: int = 0
conversations: int = 0