Spaces:
Sleeping
Sleeping
Download routers/transcript.py from vigneshwark/focusflow-api: direct link, hf CLI and curl.
- Browser
- Download file 1.4 kB
-
https://huggingface.co/spaces/vigneshwark/focusflow-api/resolve/main/routers/transcript.py
- Command line
-
hf download hf://spaces/vigneshwark/focusflow-api/routers/transcript.py
-
curl -L -o transcript.py https://huggingface.co/spaces/vigneshwark/focusflow-api/resolve/main/routers/transcript.py
1.4 kB
| from fastapi import APIRouter, HTTPException | |
| from services.session_store import get_session | |
| from services.ollama_client import generate_digest | |
| from ml.rag import clear_store | |
| router = APIRouter() | |
| async def get_digest(session_id: str): | |
| """Generate a post-meeting digest from the full session.""" | |
| session = get_session(session_id) | |
| if not session: | |
| raise HTTPException(status_code=404, detail="Session not found") | |
| full_text = " ".join( | |
| seg["text"] for seg in session.get("transcript", []) | |
| ) | |
| action_items = [i["text"] for i in session.get("action_items", [])] | |
| decisions = [d["text"] for d in session.get("decisions", [])] | |
| digest = generate_digest(full_text, action_items, decisions) | |
| clear_store(session_id) | |
| return { | |
| "digest": digest, | |
| "action_items": session.get("action_items", []), | |
| "decisions": session.get("decisions", []), | |
| "open_questions": session.get("open_questions", []), | |
| "total_sentences": len(session.get("transcript", [])), | |
| } | |
| async def get_transcript(session_id: str): | |
| """Return the full transcript for a session.""" | |
| session = get_session(session_id) | |
| if not session: | |
| raise HTTPException(status_code=404, detail="Session not found") | |
| return {"transcript": session.get("transcript", [])} | |