From 2e531d227c5672c169c26251368c925abb775c80 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Mon, 6 Jan 2025 23:20:29 +0100 Subject: Fix invalid escape in requests module Add none auth with OpenAI using nodriver Fix missing 1 required positional argument: 'cls' Update count tokens in GUI Fix streaming example in requests guide Remove ChatGptEs as default model --- g4f/requests/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'g4f/requests/__init__.py') diff --git a/g4f/requests/__init__.py b/g4f/requests/__init__.py index 2783f1e3..d8f5a000 100644 --- a/g4f/requests/__init__.py +++ b/g4f/requests/__init__.py @@ -127,8 +127,9 @@ async def get_nodriver(proxy: str = None, user_data_dir = "nodriver", browser_ex browser_executable_path = find_chrome_executable() except FileNotFoundError: # Default to Edge if Chrome is not found - if os.path.exists("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"): - browser_executable_path = "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" + browser_executable_path = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe" + if not os.path.exists(browser_executable_path): + browser_executable_path = None debug.log(f"Open nodriver with user_dir: {user_data_dir}") return await nodriver.start( user_data_dir=user_data_dir, -- cgit v1.2.3