Problem
The entire hint and story system (agent/hint_generator.py, agent/story_mode.py) is text-only. The target users are children learning to read — many can't decode the hint text itself, which undermines the product's core purpose.
Scope
- Integrate a TTS provider (e.g. Amazon Polly, since the project already uses AWS/boto3 for Bedrock) to generate audio for: the target word, each hint level, and generated stories.
- Add an endpoint (or extend existing ones) to return an audio URL/stream alongside text, e.g.
POST /api/v1/hint response gains an audio_url field.
- Cache generated audio (don't regenerate on every request for the same word/hint) — a local file cache keyed by content hash is sufficient.
- Fall back gracefully (text-only) if the TTS provider is unavailable or unconfigured, mirroring the existing Bedrock fallback pattern.
Acceptance criteria
Problem
The entire hint and story system (
agent/hint_generator.py,agent/story_mode.py) is text-only. The target users are children learning to read — many can't decode the hint text itself, which undermines the product's core purpose.Scope
POST /api/v1/hintresponse gains anaudio_urlfield.Acceptance criteria
/api/v1/hintand/api/v1/storyresponses include an audio reference when TTS is configured.test_bedrock_story_fallback_on_errorpattern).