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
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.7.tar.gz
(15.3 kB
view hashes)
Built Distribution
pyChatGPT-0.0.7-py3-none-any.whl
(15.9 kB
view hashes)
Close
Hashes for pyChatGPT-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ce45ad6f02642dfffef648e113f486b3c818553698676ab26707210b76e92f2 |
|
MD5 | 2e1392ce08db384c7b17c2ae535a132b |
|
BLAKE2b-256 | 17d27d96c84eba2a4d3bf67fa0e9a3eb16f382614bbc402f9eae4456f0414a93 |