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.6.tar.gz
(15.5 kB
view hashes)
Built Distribution
pyChatGPT-0.0.6-py3-none-any.whl
(16.1 kB
view hashes)
Close
Hashes for pyChatGPT-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9773341b2433ea22f93ea6b5a40172782482bf95f3cdf31d91126ea372c00164 |
|
MD5 | 1655f9d9383cdea761a3c0b1396c31e2 |
|
BLAKE2b-256 | 5bb6ebd2a97885ecc66bffac27f7350a49bf91e3bd5e0908f6c024f99ad9dfa0 |