summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/retry_provider.py
diff options
context:
space:
mode:
authorHeiner Lohaus <heiner@lohaus.eu>2023-10-22 23:53:18 +0200
committerHeiner Lohaus <heiner@lohaus.eu>2023-10-22 23:53:18 +0200
commit598255fa26e39d57e51fb41957a381a9241cb032 (patch)
tree041477072837e13f5ccd313e3b67fce0a0b334b4 /g4f/Provider/retry_provider.py
parentImprove get_cookies helper (diff)
downloadgpt4free-598255fa26e39d57e51fb41957a381a9241cb032.tar
gpt4free-598255fa26e39d57e51fb41957a381a9241cb032.tar.gz
gpt4free-598255fa26e39d57e51fb41957a381a9241cb032.tar.bz2
gpt4free-598255fa26e39d57e51fb41957a381a9241cb032.tar.lz
gpt4free-598255fa26e39d57e51fb41957a381a9241cb032.tar.xz
gpt4free-598255fa26e39d57e51fb41957a381a9241cb032.tar.zst
gpt4free-598255fa26e39d57e51fb41957a381a9241cb032.zip
Diffstat (limited to 'g4f/Provider/retry_provider.py')
-rw-r--r--g4f/Provider/retry_provider.py8
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()