summaryrefslogtreecommitdiffstats
path: root/g4f/Provider
diff options
context:
space:
mode:
authorabc <98614666+xtekky@users.noreply.github.com>2024-04-12 23:29:43 +0200
committerabc <98614666+xtekky@users.noreply.github.com>2024-04-12 23:29:43 +0200
commitf57af704ba263567c1f5f698fc273c332ab4b75c (patch)
tree3c1ffcd046d5adf5f00d8a2f4769b6935c93a665 /g4f/Provider
parentFix GPT4All import error (diff)
downloadgpt4free-f57af704ba263567c1f5f698fc273c332ab4b75c.tar
gpt4free-f57af704ba263567c1f5f698fc273c332ab4b75c.tar.gz
gpt4free-f57af704ba263567c1f5f698fc273c332ab4b75c.tar.bz2
gpt4free-f57af704ba263567c1f5f698fc273c332ab4b75c.tar.lz
gpt4free-f57af704ba263567c1f5f698fc273c332ab4b75c.tar.xz
gpt4free-f57af704ba263567c1f5f698fc273c332ab4b75c.tar.zst
gpt4free-f57af704ba263567c1f5f698fc273c332ab4b75c.zip
Diffstat (limited to 'g4f/Provider')
-rw-r--r--g4f/Provider/needs_auth/OpenaiChat.py3
1 files changed, 3 insertions, 0 deletions
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: