Get information about an active session.
(project_name: str)
| 164 | |
| 165 | @router.get("/sessions/{project_name}", response_model=SessionInfo) |
| 166 | async def get_session_info(project_name: str): |
| 167 | """Get information about an active session.""" |
| 168 | if not validate_project_name(project_name): |
| 169 | raise HTTPException(status_code=400, detail="Invalid project name") |
| 170 | |
| 171 | session = get_session(project_name) |
| 172 | if not session: |
| 173 | raise HTTPException(status_code=404, detail="No active session for this project") |
| 174 | |
| 175 | return SessionInfo( |
| 176 | project_name=project_name, |
| 177 | conversation_id=session.get_conversation_id(), |
| 178 | is_active=True, |
| 179 | ) |
| 180 | |
| 181 | |
| 182 | @router.delete("/sessions/{project_name}") |
nothing calls this directly
no test coverage detected