fix(media): send ElevenLabs TTS text under the field fal requires
Merged
WA
23d ago+41+41+01234567890123456789-2-2-0123456789
Summary
- Speech generation sent the text as
promptfor every model. That is right for the default Gemini 3.1 Flash TTS, but fal's ElevenLabs TTS endpoints (fal-ai/elevenlabs/tts/*, which the generate-audio tool suggests as a speech override) requiretext, so every ElevenLabs speech call was rejected with a 422 (missing body.text) - ElevenLabs TTS models now get the text under
text;voicestill passes through asvoice(the documented field on eleven-v3, multilingual-v2, and turbo-v2.5) - Model matching follows the existing
model.includes('elevenlabs/music')pattern in the same function; Gemini, music, sfx, and voice-clone requests are unchanged
Type of Change
- Bug fix
Testing
- Field names confirmed against fal's published OpenAPI schemas: the ElevenLabs TTS inputs require
textand acceptvoice; Gemini 3.1 Flash TTS requiresprompt - New test in
falai.test.tsasserts the body submitted to fal: ElevenLabs eleven-v3 and multilingual-v2 get{ text, voice }, the Gemini default gets{ prompt, voice }. Both ElevenLabs cases fail on the pre-fix code (promptreceived); the whole file passes with the fix
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing (new tests pass the
test-auditauthoring gate) - No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)