Skip to content

Commit

Permalink
some more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
xtekky committed Apr 15, 2024
1 parent e5a5764 commit fdbb474
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ dist.py
x.txt
bench.py
to-reverse.txt
g4f/Provider/OpenaiChat2.py
5 changes: 5 additions & 0 deletions g4f/Provider/needs_auth/OpenaiChat.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ async def create_async_generator(
except NoValidHarFileError:
...
if cls._api_key is None:
if debug.logging:
print("Getting access token with nodriver.")
await cls.nodriver_access_token()
cls.default_model = cls.get_model(await cls.get_default_model(session, cls._headers))

Expand All @@ -386,6 +388,9 @@ async def create_async_generator(
blob = data["arkose"]["dx"]
need_arkose = data["arkose"]["required"]
chat_token = data["token"]

if debug.logging:
print(f'Arkose: {need_arkose} Turnstile: {data["turnstile"]["required"]}')

if need_arkose and arkose_token is None:
arkose_token, api_key, cookies = await getArkoseAndAccessToken(proxy)
Expand Down
3 changes: 3 additions & 0 deletions g4f/Provider/you/har_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,7 @@ async def send_handler(event: cdp.network.RequestWillBeSent):
response = requests.post('https://telemetry.stytch.com/submit',
headers=headers, data=payload, proxies=proxies)

if '-' in response.text:
print(f'telemetry generated: {response.text}')

return (response.text)

0 comments on commit fdbb474

Please sign in to comment.