Commit graph

3944 commits

Author SHA1 Message Date
hlohaus
a066b3a062 Fix build 2025-08-22 14:24:33 +02:00
hlohaus
c56d0a5204 Fix build 2025-08-22 13:56:46 +02:00
hlohaus
d0f0e4a954 Fix build 2025-08-22 13:51:45 +02:00
hlohaus
ae985be2eb Update build 2025-08-22 13:45:19 +02:00
hlohaus
612e1faec5 Fix build deb 2025-08-22 11:23:55 +02:00
hlohaus
a909827180 Update build packages 2025-08-22 11:12:02 +02:00
Copilot
9f02959cfc
Add comprehensive build workflow for multiple package formats (pip, winget, docker, executables, deb) (#3138)
* Add comprehensive build workflow and package configuration

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

* Complete build workflow implementation with documentation and testing

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

* Update WinGet package structure and build dependencies per feedback

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

* Simplify WinGet package identifier to "g4f" and add winget/* to .gitignore

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-08-22 10:59:04 +02:00
hlohaus
aab5c045a2 Update api module 2025-08-22 00:09:45 +02:00
hlohaus
567fec8650 feat: update OpenRouter defaults and Together activation state
- In `g4f/Provider/needs_auth/OpenRouter.py`, removed import of `DEFAULT_MODEL`
- Changed `default_model` in `OpenRouter` from `DEFAULT_MODEL` to string `"openrouter/auto"`
- In `OpenRouterFree.get_models`, expanded filter condition to include models ending with `"/auto"` in addition to those ending with `":free"`
- In `g4f/Provider/needs_auth/Together.py`, changed `active_by_default` in `Together` class from `True` to `False
2025-08-21 19:06:47 +02:00
Copilot
43898f081a
Standardize reasoning field to OpenAI format while maintaining input compatibility (#3136)
* Initial plan

* Add comprehensive reasoning field standardization tests

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

* Standardize reasoning field to OpenAI format while maintaining input compatibility

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

* Rename reasoning_content parameter to reasoning for consistent naming

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

* Address review comments: remove hardcoded path and rename reasoning_content to reasoning

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-08-21 16:06:36 +02:00
H Lohaus
f8e51b8edc
Merge pull request #3134 from xtekky/copilot/fix-3126
Fix "Illegal instruction (core dumped)" error on aarch64 systems
2025-08-21 11:09:02 +02:00
copilot-swe-agent[bot]
96404a9d10 Add documentation for aarch64 compatibility
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-08-21 08:18:32 +00:00
copilot-swe-agent[bot]
31f408ed87 Fix aarch64 compatibility issue with curl_cffi imports
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-08-21 08:17:04 +00:00
copilot-swe-agent[bot]
0342b13ba0 Initial plan 2025-08-21 08:08:13 +00:00
H Lohaus
879e7f18b3
Merge pull request #3132 from xtekky/copilot/fix-3130
Add comprehensive GitHub Copilot instructions with corrected CLI commands
2025-08-21 10:07:13 +02:00
copilot-swe-agent[bot]
95c1116899 Fix API-only command and documentation URL based on feedback
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-08-21 08:03:54 +00:00
H Lohaus
df3c34cd69
Merge pull request #3131 from xtekky/copilot/fix-3128
Fix WebUI authentication bypass for /chat/ endpoint
2025-08-21 08:52:11 +02:00
H Lohaus
42f610c6a6
Merge pull request #3133 from TheFirstNoob/main
Fix typo in example.env
2025-08-20 12:27:58 +02:00
hlohaus
196946b75c Add gel all models 2025-08-20 00:06:10 +02:00
hlohaus
526292c4c3 Improce check key 2025-08-19 23:54:22 +02:00
TheFirstNoob
f11f47f15c
Fix typo in example.env
Wrong: HUUGINGFACE_API_KEY
Correct: HUGGINGFACE_API_KEY
2025-08-20 00:17:48 +03:00
copilot-swe-agent[bot]
9bf343610d Add comprehensive GitHub Copilot instructions for gpt4free repository
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-08-19 14:14:11 +00:00
copilot-swe-agent[bot]
d0ce56689c Fix WebUI authentication bypass for /chat/ endpoint
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-08-19 14:08:38 +00:00
copilot-swe-agent[bot]
7d3c96f5e2 Initial plan 2025-08-19 14:04:16 +00:00
copilot-swe-agent[bot]
1c93b936bb Initial plan 2025-08-19 14:02:12 +00:00
hlohaus
05f0f55711 refactor: update providers list, env vars, and minor fixes
- **example.env**:
  - Added `G4F_API_KEY` and `G4F_PROXY` variables
  - Removed Azure-related API keys and routes block
  - Added `OLLAMA_API_KEY`, `NVIDIA_API_KEY`, and `PUTER_API_KEY`

- **g4f/Provider/EasyChat.py**:
  - Replaced `page.js_dumps` with `page.evaluate` for retrieving `guestId`

- **g4f/Provider/deprecated/LegacyLMArena.py**:
  - Changed `working = True` to `working = False`

- **g4f/Provider/deprecated/har/__init__.py**:
  - Changed `working = True` to `working = False`

- **g4f/providers/any_provider.py**:
  - Updated imports, adding `Custom`, `PollinationsImage`, `OpenaiAccount`, and reordering providers
  - Renamed `PROVIERS_LIST_2` → `PROVIDERS_LIST_2` and `PROVIERS_LIST_3` → `PROVIDERS_LIST_3`
  - Removed `PROVIERS_LIST_1` and replaced its usage with `Provider.__providers__`
  - Changed `cls.audio_models` initialization from `{}` to `[]`
  - Adjusted handling of model mapping with `clean_name` for consistency
  - GeminiPro check updated to `if provider == GeminiPro`
  - Changed final `cls.audio_models` assignment to `[ *cls.audio_models ]` instead of `list(cls.audio_models.keys())`
  - Adjusted provider fallback in `AnyProvider` to use `PROVIDERS_LIST_2 + PROVIDERS_LIST_3`

- **g4f/requests/__init__.py**:
  - Changed SSE parsing condition from `line.startswith(b"data: ")` to `line.startswith(b"data:")`
  - Updated slice from `line[6:]` to `line[5:]` when extracting `rest
2025-08-18 17:44:05 +02:00
hlohaus
b6bf9ee62c Update model map 2025-08-18 17:19:02 +02:00
hlohaus
3a83806903 Disable leagcy lmarena 2025-08-17 15:32:48 +02:00
H Lohaus
8d58d3da0e
Update Gemini.py 2025-08-15 07:58:37 +02:00
hlohaus
ee5e503bac Fix save args 2025-08-13 09:16:22 +02:00
hlohaus
de5ace5b02 Fix save args 2025-08-13 09:11:03 +02:00
hlohaus
2f64a19957 Update LMArena provider 2025-08-13 04:06:07 +02:00
H Lohaus
258c6ccd65
Update README.md 2025-08-12 22:03:34 +02:00
H Lohaus
59bcd46e68
Update README.md 2025-08-12 22:00:05 +02:00
H Lohaus
a7ae5a524d
Update README.md 2025-08-12 16:31:00 +02:00
H Lohaus
b008fe63ce
Update README.md 2025-08-12 16:30:39 +02:00
hlohaus
f3f9e9115c Update LMArena 2025-08-12 13:54:28 +02:00
H Lohaus
9a1a802c35
Merge pull request #3124 from restartxx/feature/GLM-provider
feat(provider/GLM): Enable reasoning/thinking stream
2025-08-12 13:36:33 +02:00
hlohaus
d0f4d1b7ad Update LMArena provider 2025-08-12 09:25:11 +02:00
hlohaus
571af32062 Fix track usage 2025-08-11 22:44:49 +02:00
hlohaus
4b1351a457 Add --no-sandbox to nodriver 2025-08-11 18:49:56 +02:00
hlohaus
116a01cd5e Update nodriver function 2025-08-11 17:24:41 +02:00
hlohaus
4132b0a494 feat: add image size support and update nodriver args handling
- **ApiAirforce.py**: Added `use_image_size = True` class attribute.
- **EasyChat.py**: Added `user_data_dir=None` argument when calling `get_args_from_nodriver`.
- **LMArenaBeta.py**:
  - Only set `cls.share_url` from `G4F_SHARE_URL` if `cls.share_url` is `None`.
  - Added `user_data_dir=None` argument when calling `get_args_from_nodriver`.
  - Modified media filtering to check `url` is a `str` before `startswith("https://")`.
- **OpenaiTemplate.py**:
  - Added `use_image_size = False` class attribute.
  - Modified image generation payload to optionally include `"size"` key when `use_image_size` is `True` and width/height present.
  - Refactored `read_response` to store `content` in a variable, strip on first chunk, and yield `ToolCalls` directly from `tool_calls` variable.
- **g4f/requests/__init__.py**:
  - Added `user_data_dir` parameter (default `"nodriver"`) to `get_args_from_nodriver`.
  - Passed `user_data_dir` to `get_nodriver` call.
2025-08-11 15:48:16 +02:00
hlohaus
efae5a57fc Update Video provider 2025-08-11 11:38:11 +02:00
H Lohaus
9ec171c647
Update LMArenaBeta.py 2025-08-11 02:32:16 +02:00
hlohaus
227e2469f1 Add emojies to labels 2025-08-11 01:55:32 +02:00
hlohaus
422c3dd5ca Only streaming in EasyChat 2025-08-11 01:26:10 +02:00
hlohaus
933b2e15d1 refactor: move DuckDuckGo/Free2GPT to deprecated; SearXNG updates
- g4f/Provider/ApiAirforce.py: replace class attr parent="Api.Airforce" with label="Api.Airforce"
- g4f/Provider/EasyChat.py: add guard after loop to raise ValueError("Failed to retrieve arguments for EasyChat.") when args is falsy
- g4f/Provider/SearXNG.py:
  - add imports: from .helper import format_media_prompt; from .. import debug
  - rename class attr default_url to url (SEARXNG_URL) and use cls.url in requests
  - create(): add parameters prompt: str = None and language: str = "it"
  - build prompt via format_media_prompt(messages, prompt); remove previous query extraction
  - request params: set q to prompt and language to provided language
  - pass proxy to session.get(...); replace print(...) with debug.log(...)
  - on empty results, return early (remove "Nessun risultato trovato." and FinishReason("stop") yields)
  - result formatting: use r.get("title") without default fallback
- g4f/Provider/__init__.py: import DuckDuckGo and Free2GPT from .deprecated.DuckDuckGo and .deprecated.Free2GPT
- g4f/Provider/deprecated/DuckDuckGo.py: update relative imports to ...typing, ..base_provider, ..helper
- g4f/Provider/deprecated/Free2GPT.py: update relative imports to ...errors, ...requests, ...typing, ..base_provider
- g4f/Provider/needs_auth/DeepSeekAPI.py: set working = False (was has_dsk)
- g4f/Provider/needs_auth/You.py: set working = False (was True); update headers["Referer"] to f"{cls.url}/api/streamingSearch"
2025-08-11 00:42:18 +02:00
hlohaus
05148d2b30 Add ApiAirforce provider 2025-08-10 22:28:11 +02:00
H Lohaus
480f5caec8
Update LMArenaBeta.py 2025-08-10 07:18:59 +02:00