Spaces:
Sleeping
Sleeping
Download app/api/sessions.py from ColdAshSage/reed: direct link, hf CLI and curl.
- Browser
- Download file 473 Bytes
-
https://huggingface.co/spaces/ColdAshSage/reed/resolve/main/app/api/sessions.py
- Command line
-
hf download hf://spaces/ColdAshSage/reed/app/api/sessions.py
-
curl -L -o sessions.py https://huggingface.co/spaces/ColdAshSage/reed/resolve/main/app/api/sessions.py
473 Bytes
| """Read endpoint for registered sessions.""" | |
| from __future__ import annotations | |
| from fastapi import APIRouter | |
| from app.sessions.registry import all_sessions | |
| router = APIRouter(prefix="/api/sessions", tags=["sessions"]) | |
| def list_sessions() -> list[dict]: | |
| """Return the names and time windows of every registered session.""" | |
| return [ | |
| {"name": s.name, "time_window": s.time_window, "topic": s.topic} | |
| for s in all_sessions() | |
| ] | |