Checking
Endpoint tests
Sends real requests, good and bad, and checks the status and the audio that comes back.
GET /health
Reports ok
Expects 200 and {status: ok}
GET /languages
Returns a non-empty list
Expects 200 and an array with codes
POST /tts
Twi, default voice
Expects 200, RIFF audio longer than 0.3 s
English (needs espeak-ng)
Expects 200, RIFF audio
Unknown language code
Expects 404
Empty text
Expects 422
1001 characters
Expects 422
Missing lang field
Expects 422
Three requests at once
Expects all 200 (the lock queues them)
POST /tts/clone
Valid 4 s reference clip
Expects 200, RIFF audio
11 s reference clip
Expects 400
Voice file is not audio
Expects 400
No voice file
Expects 422
Unknown language code
Expects 4xx (a 500 means app.py needs the fix in FRONTEND.md)
GET /asr/status
ASR model is installed
Expects 200 and {available: true}
POST /asr
No file
Expects 422
File is not audio
Expects 400
61 s clip (over the 60 s default limit)
Expects 400
English round trip: speak it, then transcribe it
Expects 200 and at least half the words recovered
GET /agent/status
Reports its mode
Expects 200 and mode llm or demo
POST /agent/chat
No messages
Expects 422
Unknown role
Expects 422
Last message is from the assistant
Expects 422
Gets a spoken-style reply
Expects 200 and a non-empty reply (uses a few tokens when a key is set)