mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
- In **docs/media.md**:
- Updated the import to include `gTTS` alongside `EdgeTTS`, `Gemini`, and `PollinationsAI`.
- Changed the audio parameter for EdgeTTS from `"locale": "en-US"` to `"language": "en"`.
- Added a new code example demonstrating how to use the gTTS provider and save the output as "google-tts.mp3".
- In **g4f/Provider/__init__.py**:
- Replaced the import of `EdgeTTS` with a wildcard import (`from .audio import *`) to include all audio providers.
- In **g4f/Provider/audio/EdgeTTS.py**:
- Added a new class attribute `model_id = "edge-tts"`.
- Changed the voice selection logic to use `cls.model_id` instead of the hardcoded string "edge-tts".
- Updated the filename generation to use `[cls.model_id]` instead of `[cls.default_model]`.
- In **g4f/Provider/audio/__init__.py**:
- Added an import for the new `gTTS` provider.
- Added new file **g4f/Provider/audio/gTTS.py**:
- Implements the gTTS provider using the `gtts` library.
- Defines provider attributes (`label`, `working`, `model_id`, etc.) and generates audio using a similar structure to EdgeTTS.
- In **g4f/image/__init__.py**:
- Modified the `get_extension` function to extract the extension using `.lower().lstrip('.')` instead of slicing with `[1:]`.
|
||
|---|---|---|
| .. | ||
| guides | ||
| images | ||
| async_client.md | ||
| authentication.md | ||
| client.md | ||
| configuration.md | ||
| docker.md | ||
| file.md | ||
| git.md | ||
| gui.md | ||
| interference-api.md | ||
| legacy.md | ||
| local.md | ||
| media.md | ||
| providers-and-models.md | ||
| pydantic_ai.md | ||
| requests.md | ||
| requirements.md | ||
| selecting_a_provider.md | ||
| vision.md | ||
| webview.md | ||