Commit Graph

3971 Commits

Author SHA1 Message Date
Ammar
619cf90c13 Increase response stream buffer size to 10MB
Set the response content's _high_water attribute to 10MB per line to address ValueError: Chunk too big during stream processing.
2025-12-06 18:26:27 +02:00
Ammar
6b4355e85e Merge branch 'main' of https://github.com/3mora2/gpt4free 2025-12-06 16:41:02 +02:00
Ammar
e4399bc8c0 Update OpenaiChat.py 2025-12-06 16:40:35 +02:00
Ammar
c7201723a4 Merge branch 'xtekky:main' into main 2025-12-06 16:36:30 +02:00
Ammar
e5ca022142 Add websocket media streaming for OpenaiChat
Introduces the wss_media method to stream media updates via websocket in OpenaiChat, and updates logic to yield media as it becomes available. Also adds wait_media as a fallback polling method, tracks image generation tasks in Conversation, and fixes a bug in curl_cffi.py when deleting the 'autoping' key from kwargs.
2025-12-06 16:34:48 +02:00
Ammar
027d486b57 Update Qwen.py 2025-12-06 09:07:23 +02:00
hlohaus
957d73a76e Add UTF-8 encoding to file writes in Backend_Api class 2025-12-05 23:34:10 +01:00
hlohaus
468dc7bd67 Add "gemini-3-pro-preview" model to GeminiCLI provider 2025-11-30 22:30:14 +01:00
hlohaus
1fd9b8d116 Refactor GradientNetwork and ItalyGPT providers; update BAAI_Ling for improved functionality and model handling v6.6.7 2025-11-30 11:20:29 +01:00
H Lohaus
ed84c2dc6b Merge pull request #3268 from HexyeDEV/patch-4
Add ItalyGPT provider
2025-11-30 01:54:56 +01:00
H Lohaus
cda4634d34 Merge pull request #3273 from xtekky/gemini-3
Add support for gemini-3-pro model in Gemini provider
2025-11-30 01:54:35 +01:00
H Lohaus
1b3628dfee Merge pull request #3270 from xtekky/copilot/add-ling-1t-model
Add Ling-1T model support via HuggingFace Space provider
2025-11-30 01:54:08 +01:00
H Lohaus
0d9c00b4e3 Merge pull request #3269 from xtekky/copilot/add-new-provider-gradio-networ
Add GradientNetwork provider for chat.gradient.network
2025-11-30 01:53:50 +01:00
copilot-swe-agent[bot]
21113c51a6 Remove redundant continue statement for cluster message handling
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-11-29 04:39:45 +00:00
copilot-swe-agent[bot]
098b2401ea Fix response parsing: use type "reply" with data.content/reasoningContent, update models
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-11-29 04:36:25 +00:00
copilot-swe-agent[bot]
04e300d7a6 Fix code review issues in BAAI_Ling provider
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-11-29 04:35:54 +00:00
copilot-swe-agent[bot]
c364425250 Add BAAI_Ling provider for Ling-1T model
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-11-29 04:32:32 +00:00
copilot-swe-agent[bot]
f57663cbe8 Address code review: pass enable_thinking value directly, explicit skip for cluster messages
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-11-29 04:25:22 +00:00
copilot-swe-agent[bot]
da4d7d118d Use StreamSession for proper line-by-line NDJSON parsing
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-11-29 04:24:09 +00:00
copilot-swe-agent[bot]
07883bc9f0 Initial plan 2025-11-29 04:23:46 +00:00
copilot-swe-agent[bot]
f0ea4c5b95 Add GradientNetwork provider for chat.gradient.network
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
2025-11-29 04:22:02 +00:00
copilot-swe-agent[bot]
7b32f89eca Initial plan 2025-11-29 04:17:42 +00:00
Ammar
d76e56a66f fix error (#3265)
fix error
2025-11-29 05:15:05 +01:00
hlohaus
6be76e3e84 Add support for gemini-3-pro model in Gemini provider 2025-11-29 05:12:23 +01:00
Hexye
688640b764 Add ItalyGPT provider 2025-11-28 22:47:54 +01:00
Ammar
c32c676b5b Update OpenaiChat.py
fix error
2025-11-27 09:21:13 +02:00
Ammar
861a940361 Merge branch 'xtekky:main' into main 2025-11-27 08:54:47 +02:00
H Lohaus
2e6d417d02 Update Grok.py 2025-11-26 16:19:47 +01:00
Ammar
7771cf3d43 Improve Yupp provider account handling , request timeout and get byte from url (#3249)
* Add image caching to Yupp provider

Introduces an image cache to avoid redundant uploads in the Yupp provider. Refactors media attachment handling into a new prepare_files method, improving efficiency and code organization. Updates .gitignore to exclude .idea directory.

* Refactor Yupp stream handling and chunk processing

Improves stream segmentation in the Yupp provider by introducing buffers for target, variant, quick, thinking, and extra streams. Refactors chunk processing to better handle image-gen, quick responses, and variant outputs, and adds more robust stream ID extraction and routing logic. Yields a consolidated JsonResponse with all stream segments for downstream use.

* Handle ClientResponseError in Yupp provider

Adds specific handling for aiohttp ClientResponseError in the Yupp provider. Marks account as invalid on 500 Internal Server Error, otherwise increments error count and raises ProviderException for other errors.

* Update Yupp.py

fix 429  'Too Many Requests'

* Update Yupp.py

* Improve Yupp provider account handling and request timeout

Refactored account loading to preserve account history and error counts when updating tokens. Enhanced request logic to support custom timeouts using aiohttp's ClientTimeout, allowing for more flexible timeout configuration.

* Update __init__.py

* Handle multi-line <think> and <yapp> blocks in Yupp

Added logic to capture and process multi-line <think> and <yapp class="image-gen"> blocks referenced by special IDs. Introduced block storage and extraction functions, enabling reasoning and image-gen content to be handled via references in the response stream.

* Update LMArena.py

Not Found Model error

* Refactor to use StreamSession in Qwen and Yupp providers

Replaced aiohttp.ClientSession with StreamSession in Qwen.py and Yupp.py for improved session handling. Updated exception and timeout references in Yupp.py to use aiohttp types. Improved default argument handling in StreamSession initialization.

* Update Yupp.py

* Add status parameter to get_generated_image method

Introduces a 'status' parameter to the get_generated_image method to allow passing image generation status. Updates method calls and response objects to include status in their metadata for improved tracking of image generation progress.

* Update OpenaiChat.py

* Refactor Qwen image upload and caching logic and token

Reworked the image upload flow in Qwen provider to use direct file uploads with OSS headers, added caching for uploaded images, and improved file type detection. Updated prepare_files to handle uploads via session and cache results, and added utility for generating OSS headers. Minor imports and typing adjustments included and token support.

* Refactor Qwen and Yupp providers for improved async handling

Updated Qwen provider to handle timeout via kwargs and improved type annotations. Refactored Yupp provider for better code organization, formatting, and async account rotation logic. Enhanced readability and maintainability by reordering imports, adding whitespace, and clarifying function implementations.

* Add image caching to OpenaiChat provider

Introduces an image cache mechanism to OpenaiChat for uploaded images, reducing redundant uploads and improving efficiency. Also refactors code for clarity, updates type hints, and makes minor formatting improvements throughout the file.
2025-11-26 14:02:51 +01:00
H Lohaus
32215bb7bb Merge pull request #3257 from keac/main
Improve input handling in Grok.py
2025-11-26 13:59:33 +01:00
Ammar
9d2cdf9b4d Add image caching to OpenaiChat provider
Introduces an image cache mechanism to OpenaiChat for uploaded images, reducing redundant uploads and improving efficiency. Also refactors code for clarity, updates type hints, and makes minor formatting improvements throughout the file.
2025-11-24 20:08:28 +02:00
Ammar
3235caf1b9 Refactor Qwen and Yupp providers for improved async handling
Updated Qwen provider to handle timeout via kwargs and improved type annotations. Refactored Yupp provider for better code organization, formatting, and async account rotation logic. Enhanced readability and maintainability by reordering imports, adding whitespace, and clarifying function implementations.
2025-11-22 15:08:17 +02:00
Ammar
1681466943 Refactor Qwen image upload and caching logic and token
Reworked the image upload flow in Qwen provider to use direct file uploads with OSS headers, added caching for uploaded images, and improved file type detection. Updated prepare_files to handle uploads via session and cache results, and added utility for generating OSS headers. Minor imports and typing adjustments included and token support.
2025-11-22 00:23:09 +02:00
Ammar
5dbc0f744c Update OpenaiChat.py 2025-11-21 18:00:26 +02:00
Ammar
c5e8681503 Add status parameter to get_generated_image method
Introduces a 'status' parameter to the get_generated_image method to allow passing image generation status. Updates method calls and response objects to include status in their metadata for improved tracking of image generation progress.
2025-11-21 16:20:57 +02:00
keacwu
05c108d3f6 Improve input handling in Grok.py
Refactor input selection and submission logic for better error handling and clarity.
2025-11-21 15:19:17 +08:00
Ammar
e81688185a Update Yupp.py 2025-11-20 01:48:04 +02:00
Ammar
aead0e4b76 Refactor to use StreamSession in Qwen and Yupp providers
Replaced aiohttp.ClientSession with StreamSession in Qwen.py and Yupp.py for improved session handling. Updated exception and timeout references in Yupp.py to use aiohttp types. Improved default argument handling in StreamSession initialization.
2025-11-20 01:44:28 +02:00
Ammar
0634807d44 Update LMArena.py
Not Found Model error
2025-11-16 18:03:25 +02:00
Ammar
c3f8d7e7f6 Handle multi-line <think> and <yapp> blocks in Yupp
Added logic to capture and process multi-line <think> and <yapp class="image-gen"> blocks referenced by special IDs. Introduced block storage and extraction functions, enabling reasoning and image-gen content to be handled via references in the response stream.
2025-11-16 04:02:04 +02:00
Ammar
8415963c99 Merge branch 'main' of https://github.com/3mora2/gpt4free 2025-11-16 02:37:45 +02:00
Ammar
4047ac5636 Update __init__.py 2025-11-16 02:28:58 +02:00
Ammar
7eb1d1a440 Improve Yupp provider account handling and request timeout
Refactored account loading to preserve account history and error counts when updating tokens. Enhanced request logic to support custom timeouts using aiohttp's ClientTimeout, allowing for more flexible timeout configuration.
2025-11-16 02:05:17 +02:00
Ammar
18fda760cb Add image caching to Yupp provider (#3246)
* Add image caching to Yupp provider

Introduces an image cache to avoid redundant uploads in the Yupp provider. Refactors media attachment handling into a new prepare_files method, improving efficiency and code organization. Updates .gitignore to exclude .idea directory.

* Refactor Yupp stream handling and chunk processing

Improves stream segmentation in the Yupp provider by introducing buffers for target, variant, quick, thinking, and extra streams. Refactors chunk processing to better handle image-gen, quick responses, and variant outputs, and adds more robust stream ID extraction and routing logic. Yields a consolidated JsonResponse with all stream segments for downstream use.

* Handle ClientResponseError in Yupp provider

Adds specific handling for aiohttp ClientResponseError in the Yupp provider. Marks account as invalid on 500 Internal Server Error, otherwise increments error count and raises ProviderException for other errors.

* Update Yupp.py

fix 429  'Too Many Requests'

* Update Yupp.py
2025-11-15 18:16:03 +01:00
Ammar
5aa372efba Update Yupp.py 2025-11-15 18:13:42 +02:00
Ammar
36d7910799 Merge branch 'main' of https://github.com/3mora2/gpt4free 2025-11-15 17:14:27 +02:00
Ammar
2ab3f8e318 Update Yupp.py
fix 429  'Too Many Requests'
2025-11-15 17:14:21 +02:00
Ammar
64218ca823 Merge branch 'xtekky:main' into main 2025-11-15 12:35:10 +02:00
hlohaus
9c7fc9fe4a Remove version declaration from Docker Compose files and update Dockerfile to streamline package installation v6.6.6 2025-11-14 19:52:57 +01:00
H Lohaus
f8978c1437 Update Dockerfile v6.6.5 2025-11-14 18:24:28 +01:00