mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-10-06 00:36:57 +08:00
fix: improve error handling and add type checks in various providers and API
- Updated error handling in g4f/Provider/DDG.py to raise ResponseError instead of yield error strings - Replaced yield statements with raises in g4f/Provider/DDG.py for HTTP and response errors - Added response raising in g4f/Provider/DeepInfraChat.py for image upload responses - Included model alias validation and error raising in g4f/Provider/hf/HuggingFaceMedia.py - Corrected model alias dictionary key in g4f/Provider/hf_space/StabilityAI_SD35Large.py - Ensured referrer parameter default value in g4f/Provider/PollinationsImage.py - Removed duplicate imports and adjusted get_models method in g4f/Provider/har/__init__.py - Modified g4f/gui/server/api.py to remove unused conversation parameter in _create_response_stream - Fixed logic to handle single exception in g4f/providers/retry_provider.py - Added missing import of JsonConversation in g4f/providers/retry_provider.py - Corrected stream_read_files to replace extension in return string in g4f/tools/files.py
This commit is contained in:
@@ -128,7 +128,6 @@ class Backend_Api(Api):
|
||||
return self.app.response_class(
|
||||
self._create_response_stream(
|
||||
kwargs,
|
||||
json_data.get("conversation_id"),
|
||||
json_data.get("provider"),
|
||||
json_data.get("download_media", True),
|
||||
),
|
||||
|
Reference in New Issue
Block a user