An unofficial Python wrapper for OpenAI's ChatGPT API
Project description
pyChatGPT
An unofficial Python wrapper for OpenAI's ChatGPT API
Getting Started
Installation
pip install pyChatGPT
Usage
Interactive mode
python -m pyChatGPT
Import as a module
from pyChatGPT import ChatGPT
session_token = 'abc123' # `__Secure-next-auth.session-token` cookie from https://chat.openai.com/chat
api = ChatGPT(session_token)
resp = api.send_message('Hello, world!')
print(resp['message'])
api.refresh_auth() # refresh the authorization token
api.reset_conversation() # reset the conversation
Insipration
This project is inspired by
Disclaimer
This project is not affiliated with OpenAI in any way. Use at your own risk. I am not responsible for any damage caused by this project. Please read the OpenAI Terms of Service before using this project.
License
This project is licensed under the GPLv3 License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyChatGPT-0.0.8.tar.gz
(15.6 kB
view hashes)
Built Distribution
pyChatGPT-0.0.8-py3-none-any.whl
(16.3 kB
view hashes)
Close
Hashes for pyChatGPT-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f33e639c1862ca4139b351113d2f5c0f79e88cf329a67fc52a8c93f60797649 |
|
MD5 | e4382d7ed5668115d2b7181880569c2a |
|
BLAKE2b-256 | f04c45767eb3da6e3134a6523331a25af152d21d5ea1d5fcd46939d580b1b5dd |