diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2023-11-16 19:41:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-16 19:41:31 +0100 |
commit | 56db2051118073d19b0146b23f6e76214f2853a8 (patch) | |
tree | 7f1164face60e55f9b705404b9dc2d25a0d8bfa5 /g4f/Provider/MyShell.py | |
parent | Update Bard.py (diff) | |
download | gpt4free-56db2051118073d19b0146b23f6e76214f2853a8.tar gpt4free-56db2051118073d19b0146b23f6e76214f2853a8.tar.gz gpt4free-56db2051118073d19b0146b23f6e76214f2853a8.tar.bz2 gpt4free-56db2051118073d19b0146b23f6e76214f2853a8.tar.lz gpt4free-56db2051118073d19b0146b23f6e76214f2853a8.tar.xz gpt4free-56db2051118073d19b0146b23f6e76214f2853a8.tar.zst gpt4free-56db2051118073d19b0146b23f6e76214f2853a8.zip |
Diffstat (limited to 'g4f/Provider/MyShell.py')
-rw-r--r-- | g4f/Provider/MyShell.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/g4f/Provider/MyShell.py b/g4f/Provider/MyShell.py index ac3290b5..70fd3509 100644 --- a/g4f/Provider/MyShell.py +++ b/g4f/Provider/MyShell.py @@ -24,13 +24,13 @@ class MyShell(BaseProvider): hidden_display: bool = True, **kwargs ) -> CreateResult: - if not browser: + if browser: + driver = browser + else: if hidden_display: driver, display = get_browser("", True, proxy) else: - display = get_browser("", False, proxy) - else: - driver = browser + driver = get_browser("", False, proxy) from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait @@ -66,7 +66,7 @@ window.reader = response.body.getReader(); script = """ chunk = await window.reader.read(); if (chunk['done']) return null; -text = await (new Response(chunk['value']).text()); +text = (new TextDecoder ()).decode(chunk['value']); content = ''; text.split('\\n').forEach((line, index) => { if (line.startsWith('data: ')) { |