From f57af704ba263567c1f5f698fc273c332ab4b75c Mon Sep 17 00:00:00 2001 From: abc <98614666+xtekky@users.noreply.github.com> Date: Fri, 12 Apr 2024 22:29:43 +0100 Subject: update retryprovider now works with one provider. --- g4f/Provider/needs_auth/OpenaiChat.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'g4f/Provider/needs_auth/OpenaiChat.py') diff --git a/g4f/Provider/needs_auth/OpenaiChat.py b/g4f/Provider/needs_auth/OpenaiChat.py index 3145161a..ff3446ac 100644 --- a/g4f/Provider/needs_auth/OpenaiChat.py +++ b/g4f/Provider/needs_auth/OpenaiChat.py @@ -334,6 +334,7 @@ class OpenaiChat(AsyncGeneratorProvider, ProviderModelMixin): Raises: RuntimeError: If an error occurs during processing. """ + async with StreamSession( proxies={"all": proxy}, impersonate="chrome", @@ -359,6 +360,7 @@ class OpenaiChat(AsyncGeneratorProvider, ProviderModelMixin): if debug.logging: print("OpenaiChat: Load default_model failed") print(f"{e.__class__.__name__}: {e}") + arkose_token = None if cls.default_model is None: @@ -582,6 +584,7 @@ this.fetch = async (url, options) => { user_data_dir = user_config_dir("g4f-nodriver") except: user_data_dir = None + browser = await uc.start(user_data_dir=user_data_dir) page = await browser.get("https://chat.openai.com/") while await page.query_selector("#prompt-textarea") is None: -- cgit v1.2.3