fix(media): send ElevenLabs TTS text under the field fal requires

Merged
WA
23d ago
+41-2

Summary

  • Speech generation sent the text as prompt for 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) require text, so every ElevenLabs speech call was rejected with a 422 (missing body.text)
  • ElevenLabs TTS models now get the text under text; voice still passes through as voice (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 text and accept voice; Gemini 3.1 Flash TTS requires prompt
  • New test in falai.test.ts asserts 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 (prompt received); 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-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)