mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-10-05 08:16:58 +08:00
Refactor model handling and improve timeout functionality
- Removed empty string mapping from model_map in AnyModelProviderMixin. - Updated clean_name function to exclude 'chat' from version patterns. - Added stream_timeout parameter to AsyncGeneratorProvider for more flexible timeout handling. - Enhanced chunk yielding in AsyncAuthedProvider to support stream_timeout, allowing for better control over asynchronous responses.
This commit is contained in:
@@ -196,6 +196,8 @@ class Backend_Api(Api):
|
||||
json_data['media'] = media
|
||||
if app.timeout:
|
||||
json_data['timeout'] = app.timeout
|
||||
if app.stream_timeout:
|
||||
json_data['stream_timeout'] = app.stream_timeout
|
||||
if app.demo and not json_data.get("provider"):
|
||||
model = json_data.get("model")
|
||||
if model != "default" and model in models.demo_models:
|
||||
|
Reference in New Issue
Block a user