How wibwl/direkt-calltrainer works
Calltrainer lets an authenticated user configure a phone-call practice from a Persona and Scenario, talk to an AI counterpart in a live audio session, then review generated feedback and progress. Its principal path is browser setup → WebSocket conversation (speech recognition, dialogue, speech synthesis) → saved session → asynchronous feedback → history and progress views. The graph preserves the documented scenario authoring, focus, follow-up/reverse, consent, and account capabilities. Several subsystem links are based on the README and source tree; unsampled implementation details are not asserted.
Main entry points: session_ws.py Session WebSocket · generator.py Feedback analysis · app.py FastAPI app · App.tsx Training flow
Components 19
Web application
- React app
frontend/src/main.tsx - Training flow
frontend/src/App.tsx - Session socket
frontend/src/hooks/useSessionSocket.ts - History and progress
frontend/src/components/ProgressView.tsx
API and session runtime
- FastAPI app
backend/app.py - Catalog and setup APIs
backend/api - Session WebSocket
backend/api/session_ws.py - Turn orchestrator
backend/session/orchestrator.py - Session persistence
backend/session/persistence.py
Speech and dialogue
- Speech and LLM clients
backend/clients - DiReKT model gateway
Feedback processing
- Feedback jobs
backend/feedback/jobs.py - Feedback worker
backend/worker.py - Feedback analysis
backend/feedback/generator.py - Speech metrics
backend/feedback/metrics.py
Identity and state
- PostgreSQL
backend/db/session.py - Redis queue
backend/feedback/queue.py - Keycloak
Other components
- Trainee
Connections 23
- Trainee → React app: uses
- React app → Keycloak: authenticates
- React app → Training flow: opens training
- Training flow → Catalog and setup APIs: loads setup
- Training flow → Session socket: starts session
- Session socket → Session WebSocket: sends audio and control
- FastAPI app → Session WebSocket: mounts route
- FastAPI app → Catalog and setup APIs: mounts routes
- Session WebSocket → Turn orchestrator: drives turns
- Turn orchestrator → Speech and LLM clients: transcribes, generates, speaks
- Speech and LLM clients → DiReKT model gateway: calls models
- Session WebSocket → Session persistence: stores session
- Session persistence → PostgreSQL: reads and writes
- Session WebSocket → Feedback jobs: enqueues wrap-up
- Feedback jobs → Redis queue: dispatches job
- Feedback worker → Redis queue: consumes jobs
- Feedback worker → Feedback analysis: runs analysis
- Feedback analysis → Speech metrics: uses measurements
- Feedback analysis → Speech and LLM clients: requests feedback
- Feedback analysis → PostgreSQL: stores feedback
- History and progress → FastAPI app: requests records
- FastAPI app → PostgreSQL: serves stored data
- History and progress → Training flow: starts follow-up or reverse