返回提交历史
Modified
g4f/api/__init__.py
+3
-0
XFEstudio/gpt4free
fix: enhance error handling for RateLimitError in API response streaming
63a09b74
代码差异
1 个文件
+3
-0
@@ -544,6 +544,9 @@ class Api:
544
544
yield f"data: {chunk.model_dump_json() if hasattr(chunk, 'model_dump_json') else chunk.json()}\n\n"
545
545
except GeneratorExit:
546
546
pass
547
except RateLimitError as e:
548
debug.error(e)
549
yield f'data: {format_exception(e, config)}\n\n'
547
550
except Exception as e:
548
551
logger.exception(e)
549
552
yield f'data: {format_exception(e, config)}\n\n'