gpt4free/g4f/Provider
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
..
audio Refactor MarkItDown and OpenaiChat classes for improved media handling and optional parameters; enhance is_data_an_media function to support binary/octet-stream return type for unsupported URLs. 2025-10-31 18:16:19 +01:00
deprecated Enhance Copilot provider with cookie handling and user identity support; add Kimi provider; refactor usage tracking in run_tools. 2025-10-02 18:11:11 +02:00
hf_space fix: improve message formatting and set default activation for providers 2025-08-06 04:46:28 +02:00
local Track live model instances in Ollama and Cohere providers, updating count on model retrieval 2025-09-06 12:10:14 +02:00
needs_auth Improve Yupp provider account handling , request timeout and get byte from url (#3249) 2025-11-26 14:02:51 +01:00
not_working refactor: reorganize providers and update model configurations 2025-08-25 23:50:53 +03:00
openai Update default model to "gpt-5-1" and enhance text model list 2025-11-14 16:51:12 +01:00
qwen Refactor Cloudflare and LMArena providers to enhance authentication handling and improve WebSocket communication 2025-10-30 21:34:45 +01:00
search Refactor search and response handling; introduce CachedSearch and DDGS classes for improved web search functionality and response management. Add PlainTextResponse for handling plain text responses. Update requirements and setup for new dependencies. 2025-10-03 11:38:24 +02:00
template Enhance MCP server tests to reflect updated tool count; improve model fetching with timeout handling in providers 2025-11-02 08:01:20 +01:00
yupp Add initial implementation of Yupp provider 2025-10-07 04:56:17 +02:00
__init__.py Add Yupp provider implementation with account management and model fetching 2025-10-06 07:16:01 +02:00
ApiAirforce.py Refactor ApiAirforce class to enhance async generator and improve rate limit handling; update setup.py dependencies 2025-10-08 09:12:32 +02:00
base_provider.py Improve download of generated images, serve images in the api (#2391) 2024-11-20 19:58:16 +01:00
Chatai.py refactor: update providers and models for better compatibility 2025-05-12 20:24:36 +03:00
Cloudflare.py Fix LMAreana provider 2025-11-10 09:30:53 +01:00
Copilot.py Improve auth cookie detection in Copilot provider 2025-11-07 18:04:40 +02:00
DeepInfra.py Add model alias for Kimi-K2-Instruct and update best_provider references 2025-09-21 11:55:29 +02:00
EasyChat.py Update EasyChat and OpenRouter classes, modify backend API timing, and enhance website rendering 2025-09-04 02:42:04 +02:00
GLM.py Enhance GLM provider with authentication signature generation and caching; update setup.py dependencies 2025-10-09 17:43:09 +02:00
helper.py Remove all not working provider (#1679) 2024-03-12 02:06:06 +01:00
LambdaChat.py refactor: reorganize providers and update model configurations 2025-08-25 23:50:53 +03:00
Mintlify.py refactor: reorganize providers and update model configurations 2025-08-25 23:50:53 +03:00
OIVSCodeSer.py Refactor OIVSCodeSer2 and OIVSCodeSer0501 classes; consolidate Perplexity provider and update OpenaiTemplate for API key handling 2025-10-02 00:55:01 +02:00
OperaAria.py feat: add new providers and update models (#3075) 2025-07-11 03:50:59 +02:00
Perplexity.py Enhance Perplexity provider to yield additional response types including sources, media items, and suggested follow-ups; update response formatting in response classes for improved data handling. 2025-10-31 15:48:26 +01:00
PollinationsAI.py Refactor PollinationsAI model selection logic; update default system in AIModel; clean up unused provider imports 2025-11-10 13:58:07 +01:00
PollinationsImage.py active_by_default 2025-07-15 13:49:29 +02:00
Qwen.py Improve Yupp provider account handling , request timeout and get byte from url (#3249) 2025-11-26 14:02:51 +01:00
Startnest.py Add OpenRouterFree provider 2025-08-10 05:07:55 +02:00
StringableInference.py Update StringableInference to set working status to False and remove unused format_prompt import in Yupp provider 2025-10-29 23:13:56 +01:00
TeachAnything.py refactor: reorganize providers and update model configurations 2025-08-25 23:50:53 +03:00
WeWordle.py fix: update provider status, models, error handling, and imports 2025-07-27 18:03:54 +02:00
Yqcloud.py Set return_conversation to True 2025-04-26 23:10:06 +02:00
Yupp.py Improve Yupp provider account handling , request timeout and get byte from url (#3249) 2025-11-26 14:02:51 +01:00