- Added `OPENROUTER_API_KEY` and `AZURE_API_KEYS` to `example.env`.
- Updated `AZURE_DEFAULT_MODEL` to "model-router" in `example.env`.
- Added `AZURE_ROUTES` with multiple model URLs in `example.env`.
- Changed the mapping for `"phi-4-multimodal"` in `DeepInfraChat.py` to `"microsoft/Phi-4-multimodal-instruct"`.
- Added `media` parameter to `GptOss.create_completion` method and raised a `ValueError` if `media` is provided.
- Updated `model_aliases` in `any_model_map.py` to include new mappings for various models.
- Removed several model aliases from `PollinationsAI` in `any_model_map.py`.
- Added new models and updated existing models in `model_map` across various files, including `any_model_map.py` and `__init__.py`.
- Refactored `AnyModelProviderMixin` to include `model_aliases` and updated the logic for handling model aliases.
- Changed "Inference API" to "Interference API" and updated corresponding documentation links in README.md
- Removed "o1" and "dall-e-3" entries from Copilot.py model_aliases
- Added "stream" and "extra_body" parameters with default values in Azure.py's create_async_generator method
- In CopilotAccount.py, included model_aliases with "gpt-4", "gpt-4o", "o1", and "dall-e-3"
- Updated conditional for provider comparison from "==" to "in" list in any_provider.py
- Modified g4f/api/__init__.py to set g4f_api_key from environment variable
- In backend_api.py, added "user" field to cached data with default "unknown"
- Changed logic in OpenaiTemplate.py read_response to check if "choice" exists before processing, and cleaned up indentation and conditionals in response parsing
- Removed unnecessary "stop" and "prompt" parameters from comments or unused code in OpenaiTemplate.py
- Tightened the check for "provider" comparison in any_provider.py to handle multiple providers properly
* feat: add agent CLI, new providers, and update models
- Add a new `agent` mode to the CLI, a feature-rich AI coding assistant with capabilities for file system operations, code execution, git integration, and interactive chat.
- Add new provider `OperaAria` with support for vision, streaming, and conversation history.
- Add new provider `Startnest` with support for `gpt-4o-mini`, vision, and streaming.
- Move providers `FreeGpt` and `Websim` to the `not_working` directory.
- Delete the `OIVSCodeSer2` provider.
- Rename the CLI `client` mode to `chat` and refactor its argument parsing.
- In `g4f/Provider/DeepInfraChat.py`:
- Add a new `api_endpoint` attribute.
- Extensively update and reorganize the `models` list and `model_aliases` dictionary with numerous new models.
- In `g4f/Provider/LambdaChat.py`:
- Change the `default_model` to `deepseek-v3-0324`.
- In `g4f/Provider/Together.py`:
- Update aliases for `llama-3.1-405b`, `deepseek-r1`, and `flux`.
- Add new models including `gemma-3-27b`, `gemma-3n-e4b`, and `qwen-3-32b`.
- In `g4f/models.py`:
- Add new model definitions for `aria`, `deepseek_v3_0324_turbo`, `deepseek_r1_0528_turbo`, and several `gemma` variants.
- Remove the `mixtral_8x22b` model definition.
- Update the `best_provider` lists for `default`, `default_vision`, `gpt_4o_mini`, `gemini-1.5-pro`, `gemini-1.5-flash`, and others to reflect provider changes.
- In `g4f/Provider/__init__.py`:
- Add `OperaAria` and `Startnest` to the list of imported providers.
- Remove `FreeGpt`, `OIVSCodeSer2`, and `Websim` from imports.
- In `requirements.txt`:
- Add `rich` as a new dependency for the agent CLI.
* feat: add gemma-3-4b alias to DeepInfraChat
In g4f/Provider/DeepInfraChat.py, add the gemma-3-4b alias to the model_aliases dictionary.
The new alias points to the google/gemma-3-4b-it model.
* feat: add OIVSCodeSer2 provider
- Create the new provider file .
- The provider supports the model and includes a custom method to generate a .
- Import and include in .
- Add to the for in .
- Add to in .
* feat: add OIVSCodeSer2 provider
- Create the new provider file .
- The provider supports the model and includes a custom method to generate a .
- Import and include in .
- Add to the for in .
- Add to in .
* refactor: Migrate from duckduckgo-search to ddgs library
* Replaced the dependency with the new library.
* In , updated imports from to and to .
* Modified the function in to use an context manager instead of a global instance.
* Updated the function to catch the new exception.
* In , updated the web search import and installation instructions to use .
* Removed unnecessary comments and simplified f-string formatting in and .
* Added and to .
* Added , , and to the extras in .
* test: Update web search tests for ddgs library and cleanup code
* In `etc/unittest/web_search.py`, updated imports from `duckduckgo_search` to `ddgs` and `DDGSError`.
* Added an import for `MissingRequirementsError` in `etc/unittest/web_search.py`.
* Modified exception handling in web search tests to catch both `DDGSError` and `MissingRequirementsError`.
* Removed temporary modification comments in `g4f/cli/agent/agent.py` and `g4f/tools/web_search.py`.
* fix: remove unstable CLI feature due to critical errors
- Remove the experimental CLI coding assistant feature due to multiple stability issues and critical errors in production environments
- Delete the entire `g4f/cli/agent/` directory and all related functionality
- Remove `rich` dependency from `requirements.txt` as it was only used by the removed feature
- Remove `rich` from the `all` extras in `setup.py`
- Revert CLI mode naming from `chat` back to `client` for consistency
- Clean up argument parsing in CLI to remove references to the removed functionality
- Remove installation instructions and imports related to the unstable feature from documentation
This removal is necessary due to:
- Unpredictable behavior causing data loss risks
- Incompatibility with certain system configurations
- Security concerns with unrestricted file system access
- Excessive resource consumption in production environments
Note: This feature may be reintroduced in the future with a more stable and secure implementation that addresses the current limitations and safety concerns.
---------
Co-authored-by: kqlio67 <kqlio67@users.noreply.github.com>
- Introduced `clean_name` function in `Cloudflare.py` to format model names by removing specific suffixes.
- Updated `model_aliases` in `Cloudflare` class with new model mappings, and cleaned up redundant entries.
- Set `models` in the `Cloudflare` class to use keys from `model_aliases`.
- Adjusted the caching logic in `Cloudflare` to include new headers for requests.
- Added `parent` and `login_url` attributes in `DeepInfraChat` class.
- Updated `PollinationsAI` to clean up model retrieval logic and fixed handling of existing checks.
- Refactored `HarProvider` to inherit models and aliases from `LegacyLMArena`.
- Implemented loading environment variables from `.env` file in `cookies.py`.
- Updated default headers in `defaults.py` for user agent and `sec-ch-ua`.
- Cleaned up various model references in `any_model_map.py` to reflect differences in audio, vision, and other model types.
- Added a more centralized handling for API key management in `run_tools.py` to accommodate new nomenclature.
- Enhanced existing logic to allow for more granular loading and utilization of API keys from environment variables.