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) # auth with session token
api2 = ChatGPT(email='example@domain.com', password='password') # auth with email and password
api3 = ChatGPT(session_token, conversation_id='some-random-uuid') # specify a conversation id
api4 = ChatGPT(session_token, proxy='http://proxy.example.com:8080') # specify proxy
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.1.0.tar.gz
(16.4 kB
view hashes)
Built Distribution
pyChatGPT-0.1.0-py3-none-any.whl
(17.1 kB
view hashes)
Close
Hashes for pyChatGPT-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c05aa766feda891b13edea111e42cc10cab828e094516dc5d902f660607b4de |
|
MD5 | 7824c8d91a59752237d2a2c232cf9481 |
|
BLAKE2b-256 | 247a5c3bf6ec8b3ee0b7a811943da6df8b48f56d8db6065a5120a22beda82235 |