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)
api2 = ChatGPT(session_token, conversation_id='conversation_id') # specify a conversation id
api3 = 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.0.9.tar.gz
(15.7 kB
view hashes)
Built Distribution
pyChatGPT-0.0.9-py3-none-any.whl
(16.4 kB
view hashes)
Close
Hashes for pyChatGPT-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 897241a7b06e63d897ea9b0ac9a64d285f08dc5224142a79e95f3d512fb2bf0c |
|
MD5 | 47d72ae599df54bf443fa3f7d4edd8a8 |
|
BLAKE2b-256 | 50cc732204d65b11af61e76776e054ddc4739c51e56003af7f040883fc1808e8 |