docs: update media examples and add parameter details for TTS providers

- Updated EdgeTTS example to mention additional audio parameters (`rate`, `volume`, `pitch`)
- Updated gTTS example to include support for `tld` and `slow` audio parameters
- Modified the EdgeTTS provider to use `get_last_message` instead of `format_image_prompt` for prompt handling
- Modified the gTTS provider to use `get_last_message` instead of `format_image_prompt` for prompt handling
- Refactored audio file generation logic in the gTTS provider to handle `language` parameter and update the voice model accordingly
- Refactored backend API code to introduce `cast_str` function for processing responses, including cache management and response formatting
- Fixed a bug in `AnyProvider` where the model string check would fail if the model was `None`
- Added check in `to_string` helper function to handle `None` values correctly
```
This commit is contained in:
hlohaus
2025-04-20 13:54:46 +02:00
parent 099d7283ed
commit 2e928c3b94
6 changed files with 44 additions and 25 deletions
+5 -1
View File
@@ -51,9 +51,13 @@ client = Client(provider=EdgeTTS)
response = client.media.generate("Hello", audio={"language": "en"})
response.data[0].save("edge-tts.mp3")
# The EdgeTTS provider also support the audio parameters `rate`, `volume` and `pitch`
client = Client(provider=gTTS)
response = client.media.generate("Hello", audio={"language": "en"})
response = client.media.generate("Hello", audio={"language": "en-US"})
response.data[0].save("google-tts.mp3")
# The gTTS provider also support the audio parameters `tld` and `slow`
```
#### **Transcribe an Audio File:**