terry3041 / pyChatGPT

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

Suggestion, Not error #29

Closed Phantom8015 closed 1 year ago

Phantom8015 commented 1 year ago

When the package is run, it opens a chat.openai.com/auth/session link. Instead of specifying a session token, why not grab it from that json response? The session token is labelled "acces_token" in the json.

terry3041 commented 1 year ago

Do you mean to grab the session_token from that json response? accessToken in that json response is Authorization, not session_token.

Phantom8015 commented 1 year ago

ah sorry i meant to not use what the json gives but use something similar to the cf cookies for the session token cookie

terry3041 commented 1 year ago

The main problem is that it does not give anything useful for us if we dont provide session_token. https://chat.openai.com/api/auth/session will respond empty json if nothing is provided.

Phantom8015 commented 1 year ago

good point, ill try and find a way to get this to work, if I have your permission to edit the code.

terry3041 commented 1 year ago

good point, ill try and find a way to get this to work, if I have your permission to edit the code.

Sure, feel free to fork the repo and make a pull request if you find anything useful.