XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

feat: add model alias handling and update Cloudflare provider

- 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.

51b4b8bc
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

19 个文件 +1467 -1227
Modified g4f/Provider/Cloudflare.py +65 -18
Modified g4f/Provider/DeepInfraChat.py +2 -0
Modified g4f/Provider/PollinationsAI.py +6 -7
Modified g4f/Provider/har/__init__.py +6 -57
Modified g4f/Provider/needs_auth/GeminiPro.py +2 -0
Modified g4f/cli/client.py +11 -6
Modified g4f/client/__init__.py +1 -1
Modified g4f/config.py +3 -3
Modified g4f/cookies.py +8 -1
Modified g4f/gui/server/api.py +2 -2
Modified g4f/gui/server/backend_api.py +9 -5
Modified g4f/providers/any_provider.py +16 -9
Modified g4f/providers/retry_provider.py +5 -0
Modified g4f/requests/defaults.py +2 -2
Modified g4f/tools/run_tools.py +22 -25
Modified requirements-slim.txt +2 -1
Modified requirements.txt +2 -1
Modified setup.py +4 -2