baseball-engine / AI-coach-agent /tools /export_schema.py
github-actions[bot]
Automated Deploy: f4f01388c7b26e818cffbd64414eac11381a7891
35e80ff
Raw History Blame Contribute Delete
614 Bytes
"""Write docs/coach_input.schema.json and docs/coach_note.schema.json from the pydantic models."""
import json
from pathlib import Path
from ai_coach.schemas import CoachInput, CoachNote
DOCS = Path(__file__).resolve().parents[1] / "docs"
def render(model) -> str:
return json.dumps(model.model_json_schema(), indent=2, sort_keys=True) + "\n"
if __name__ == "__main__":
DOCS.mkdir(exist_ok=True)
(DOCS / "coach_input.schema.json").write_text(render(CoachInput), encoding="utf-8")
(DOCS / "coach_note.schema.json").write_text(render(CoachNote), encoding="utf-8")
print("schemas written")