summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/retry_provider.py
diff options
context:
space:
mode:
authorTekky <98614666+xtekky@users.noreply.github.com>2023-10-22 23:55:32 +0200
committerGitHub <noreply@github.com>2023-10-22 23:55:32 +0200
commit955fb4bbaa3c31787bbe699aa913f22ec3a4a639 (patch)
treec298e3feb1110b047a74cdb224024b412712323a /g4f/Provider/retry_provider.py
parentMerge pull request #1122 from Luneye/patch-2 (diff)
parentDebug logging support (diff)
downloadgpt4free-955fb4bbaa3c31787bbe699aa913f22ec3a4a639.tar
gpt4free-955fb4bbaa3c31787bbe699aa913f22ec3a4a639.tar.gz
gpt4free-955fb4bbaa3c31787bbe699aa913f22ec3a4a639.tar.bz2
gpt4free-955fb4bbaa3c31787bbe699aa913f22ec3a4a639.tar.lz
gpt4free-955fb4bbaa3c31787bbe699aa913f22ec3a4a639.tar.xz
gpt4free-955fb4bbaa3c31787bbe699aa913f22ec3a4a639.tar.zst
gpt4free-955fb4bbaa3c31787bbe699aa913f22ec3a4a639.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()