diff options
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/retry_provider.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/g4f/Provider/retry_provider.py b/g4f/Provider/retry_provider.py index 39d61c35..5979e15b 100644 --- a/g4f/Provider/retry_provider.py +++ b/g4f/Provider/retry_provider.py @@ -5,13 +5,13 @@ import random from typing import List, Type, Dict from ..typing import CreateResult, Messages from .base_provider import BaseProvider, AsyncProvider +from .. import debug class RetryProvider(AsyncProvider): __name__: str = "RetryProvider" working: bool = True supports_stream: bool = True - logging: bool = False def __init__( self, @@ -39,7 +39,7 @@ class RetryProvider(AsyncProvider): started: bool = False for provider in providers: try: - if self.logging: + if debug.logging: print(f"Using {provider.__name__} provider") for token in provider.create_completion(model, messages, stream, **kwargs): @@ -51,7 +51,7 @@ class RetryProvider(AsyncProvider): except Exception as e: self.exceptions[provider.__name__] = e - if self.logging: + if debug.logging: print(f"{provider.__name__}: {e.__class__.__name__}: {e}") if started: raise e @@ -77,7 +77,7 @@ class RetryProvider(AsyncProvider): ) except Exception as e: self.exceptions[provider.__name__] = e - if self.logging: + if debug.logging: print(f"{provider.__name__}: {e.__class__.__name__}: {e}") self.raise_exceptions() |