diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2023-11-17 04:50:37 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2023-11-17 04:50:37 +0100 |
commit | 2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43 (patch) | |
tree | 5ed9c277ecceb2b90aabb32dd886a7eb704de101 /g4f/Provider/helper.py | |
parent | Add Poe Provider, Update AItianhuSpace Porvider (diff) | |
download | gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.gz gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.bz2 gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.lz gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.xz gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.zst gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.zip |
Diffstat (limited to 'g4f/Provider/helper.py')
-rw-r--r-- | g4f/Provider/helper.py | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/g4f/Provider/helper.py b/g4f/Provider/helper.py index b10c912a..f879816a 100644 --- a/g4f/Provider/helper.py +++ b/g4f/Provider/helper.py @@ -31,14 +31,6 @@ except ImportError: class ChromeOptions(): def add_argument(): pass -try: - from pyvirtualdisplay import Display -except ImportError: - class Display(): - def start(): - pass - def stop(): - pass from ..typing import Dict, Messages, Union, Tuple from .. import debug @@ -139,24 +131,16 @@ def format_prompt(messages: Messages, add_special_tokens=False) -> str: def get_browser( user_data_dir: str = None, - hidden_display: bool = False, + headless: bool = False, proxy: str = None, options: ChromeOptions = None -) -> Union[Chrome, Tuple[Chrome, Display]] : +) -> Chrome: if user_data_dir == None: user_data_dir = user_config_dir("g4f") - if hidden_display: - display = Display(visible=0, size=(1920, 1080)) - display.start() - if proxy: if not options: options = ChromeOptions() options.add_argument(f'--proxy-server={proxy}') - browser = Chrome(user_data_dir=user_data_dir, options=options) - if hidden_display: - return browser, display - - return browser
\ No newline at end of file + return Chrome(user_data_dir=user_data_dir, options=options, headless=headless)
\ No newline at end of file |