Spaces:
Running on T4
Running on T4
Download AI-coach-agent/tools/export_schema.py from modventures/baseball-engine: direct link, hf CLI and curl.
- Browser
- Download file 614 Bytes
-
https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/AI-coach-agent/tools/export_schema.py
- Command line
-
hf download hf://spaces/modventures/baseball-engine/AI-coach-agent/tools/export_schema.py
-
curl -L -o export_schema.py https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/AI-coach-agent/tools/export_schema.py
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") | |