Spaces:
Runtime error
Runtime error
Download src/tutor/services/storage/base.py from blizzarman/polyglot-tutor: direct link, hf CLI and curl.
- Browser
- Download file 689 Bytes
-
https://huggingface.co/spaces/blizzarman/polyglot-tutor/resolve/main/src/tutor/services/storage/base.py
- Command line
-
hf download hf://spaces/blizzarman/polyglot-tutor/src/tutor/services/storage/base.py
-
curl -L -o base.py https://huggingface.co/spaces/blizzarman/polyglot-tutor/resolve/main/src/tutor/services/storage/base.py
689 Bytes
| """Persistence contract. | |
| The surface is deliberately minimal at M0 (learners + attempts) and grows with | |
| real needs: review items and error profiles arrive with M3/M4, when the | |
| SQLite/Supabase implementations replace the in-memory one behind this same | |
| Protocol. | |
| """ | |
| from typing import Protocol, runtime_checkable | |
| from tutor.domain.models import Attempt, Learner | |
| class Repository(Protocol): | |
| async def save_learner(self, learner: Learner) -> None: ... | |
| async def get_learner(self, learner_id: str) -> Learner | None: ... | |
| async def save_attempt(self, attempt: Attempt) -> None: ... | |
| async def list_attempts(self, learner_id: str) -> list[Attempt]: ... | |