- Added new examples for `client.media.generate` with `PollinationsAI`, `EdgeTTS`, and `Gemini` in `docs/media.md`
- Modified `PollinationsAI.py` to default to `default_audio_model` when audio data is present
- Adjusted `PollinationsAI.py` to conditionally construct message list from `prompt` when media is being generated
- Rearranged `PollinationsAI.py` response handling to yield `save_response_media` after checking for non-JSON content types
- Added support in `EdgeTTS.py` to use default values for `language`, `locale`, and `format` from class attributes
- Improved voice selection logic in `EdgeTTS.py` to fallback to default locale or language when not explicitly provided
- Updated `EdgeTTS.py` to yield `AudioResponse` with `text` field included
- Modified `Gemini.py` to support `.ogx` audio generation when `model == "gemini-audio"` or `audio` is passed
- Used `format_image_prompt` in `Gemini.py` to create audio prompt and saved audio file using `synthesize`
- Appended `AudioResponse` to `Gemini.py` for audio generation flow
- Added `save()` method to `Image` class in `stubs.py` to support saving `/media/` files locally
- Changed `client/__init__.py` to fallback to `options["text"]` if `alt` is missing in `Images.create`
- Ensured `AudioResponse` in `copy_images.py` includes the `text` (prompt) field
- Added `Annotated` fallback definition in `api/__init__.py` for compatibility with older Python versions
feat: add __call__ in field_serializer and update body wait logic
- In g4f/client/stubs.py, add a __call__ method to the field_serializer class that returns the first positional argument.
- In g4f/requests/__init__.py, replace the wait_for call with a while loop that repeatedly evaluates "document.querySelector('body:not(.no-js)')" and sleeps until the element is found.
```
- **g4f/providers/helper.py**
- Add `render_messages()` to normalise message contents that are lists of blocks.
- **g4f/Provider/Blackbox.py**
- Import `get_har_files` and `render_messages`.
- Replace manual walk of `get_cookies_dir()` with `get_har_files()` in `_find_session_in_har`.
- Simplify session‑parsing loop and exception logging; drop permissions check.
- Build `current_messages` with `render_messages(messages)` instead of raw list.
- **g4f/Provider/Cloudflare.py**
- Swap `to_string` import for `render_messages`.
- Add `"impersonate": "chrome"` to default `_args`.
- Construct `data["messages"]` with `render_messages(messages)` and inline `"parts"`; remove `to_string()` calls.
- Move `cache_file` write outside inner `try` to always save arguments.
- **g4f/Provider/Copilot.py**
- Defer `yield conversation` until after `conversation` is created when `return_conversation` is requested.
- **g4f/Provider/openai/har_file.py**
- Break out of `os.walk` after first directory in `get_har_files()` to avoid deep traversal.
- **g4f/api/__init__.py**
- Use `config.conversation` directly and set `return_conversation` when present.
- **g4f/client/__init__.py**
- Pass `conversation` to both `ChatCompletionChunk.model_construct()` and `ChatCompletion.model_construct()`.
- **g4f/client/stubs.py**
- Import `field_serializer` (with stub fallback).
- Add serializers for `conversation` (objects and dicts) and for `content` fields.
- Extend model constructors to accept/propagate `conversation`.
- **g4f/cookies.py**
- Insert ".huggingface.co" into `DOMAINS` list.
- Stop recursive directory walk in `read_cookie_files()` with early `break`.
- **g4f/gui/client/background.html**
- Reorder error‑handling branches; reset `errorImage` in `onload`.
- Revise `skipRefresh` logic and random image URL building.
- **g4f/gui/server/backend_api.py**
- Add `self.match_files` cache for repeated image searches.
- Use `safe_search` for sanitised term matching and `min` comparison.
- Limit walk to one directory level; support deterministic random selection via `random` query param.
- **Miscellaneous**
- Update imports where `render_messages` replaces `to_string`.
- Ensure all modified providers iterate messages through `render_messages` for consistent formatting.
Add none auth with OpenAI using nodriver
Fix missing 1 required positional argument: 'cls'
Update count tokens in GUI
Fix streaming example in requests guide
Remove ChatGptEs as default model
* Add Path and PathLike support when uploading images
Improve raise_for_status in special cases
Move ImageResponse to providers.response module
Improve OpenaiChat and OpenaiAccount providers
Add Sources for web_search in OpenaiChat
Add JsonConversation for import and export conversations to js
Add RequestLogin response type
Add TitleGeneration support in OpenaiChat and gui
* Improve Docker Container Guide in README.md
* Add tool calls api support, add search tool support
* Fix api streaming, fix AsyncClient, Improve Client class, Some providers fixes, Update models list, Fix some tests, Update model list in Airforce provid
er, Add OpenAi image generation url to api, Fix reload and debug in api arguments, Fix websearch in gui
* Fix Cloadflare and Pi and AmigoChat provider
* Fix conversation support in DDG provider, Add cloudflare bypass with nodriver
* Fix unittests without curl_cffi