Skip to content

Commit

Permalink
Update Gemini.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hlohaus authored Nov 23, 2024
1 parent b6a4af1 commit 08de02c
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions g4f/Provider/needs_auth/Gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from ..helper import format_prompt, get_cookies
from ...requests.raise_for_status import raise_for_status
from ...requests.aiohttp import get_connector
from ..requests import get_browser
from ...errors import MissingAuthError
from ...image import ImageResponse, to_bytes
from ... import debug
Expand Down Expand Up @@ -68,17 +69,7 @@ async def nodriver_login(cls, proxy: str = None) -> AsyncIterator[str]:
if debug.logging:
print("Skip nodriver login in Gemini provider")
return
try:
from platformdirs import user_config_dir
user_data_dir = user_config_dir("g4f-nodriver")
except:
user_data_dir = None
if debug.logging:
print(f"Open nodriver with user_dir: {user_data_dir}")
browser = await nodriver.start(
user_data_dir=user_data_dir,
browser_args=None if proxy is None else [f"--proxy-server={proxy}"],
)
browset = await get_browser(proxy=proxy)
login_url = os.environ.get("G4F_LOGIN_URL")
if login_url:
yield f"Please login: [Google Gemini]({login_url})\n\n"
Expand Down

0 comments on commit 08de02c

Please sign in to comment.