terry3041 / pyChatGPT

An unofficial Python wrapper for OpenAI's ChatGPT API
GNU General Public License v3.0
1.35k stars 252 forks source link

How to run headless browser? #83

Closed mamun3600 closed 1 year ago

mamun3600 commented 1 year ago

I wish to run the script in headless mode from my PC. what should I do?

I run the below codes and It's working fine on my end but I do not want to open the browser every time.

from pyChatGPT import ChatGPT

session_token = 'abc123' # __Secure-next-auth.session-token cookie from https://chat.openai.com/chat api = ChatGPT(session_token) # auth with session token

resp = api.send_message('Hello, world!') print(resp['message'])

terry3041 commented 1 year ago

You can't run this headless. Headless browser cannot bypass Cloudflare protection.