refactor: some minor cleanup
This commit is contained in:
parent
307ca38ecc
commit
858d127246
12 changed files with 84 additions and 59 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import asyncio
|
||||
import logging
|
||||
import os
|
||||
from typing import Any
|
||||
from typing import Callable
|
||||
|
||||
|
|
@ -9,6 +8,7 @@ from playwright.async_api import BrowserContext
|
|||
from email_providers import BaseProvider
|
||||
from email_providers import MailTmProvider
|
||||
from providers.base import Provider, ProviderTokens
|
||||
from utils.env import parse_int_env
|
||||
from .tokens import (
|
||||
clear_next_tokens,
|
||||
load_next_tokens,
|
||||
|
|
@ -24,7 +24,13 @@ from .registration import register_chatgpt_account
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
CHATGPT_REGISTRATION_MAX_ATTEMPTS = 4
|
||||
CHATGPT_SWITCH_THRESHOLD = int(os.environ.get("CHATGPT_SWITCH_THRESHOLD", "95"))
|
||||
CHATGPT_PREPARE_THRESHOLD = parse_int_env("CHATGPT_PREPARE_THRESHOLD", 85, 0, 100)
|
||||
CHATGPT_SWITCH_THRESHOLD = parse_int_env(
|
||||
"CHATGPT_SWITCH_THRESHOLD",
|
||||
95,
|
||||
0,
|
||||
100,
|
||||
)
|
||||
|
||||
|
||||
class ChatGPTProvider(Provider):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue