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.4.tar.gz
(15.5 kB
view hashes)
Built Distribution
pyChatGPT-0.0.4-py3-none-any.whl
(16.1 kB
view hashes)
Close
Hashes for pyChatGPT-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17710c3e608c37cca0d73649e87d244171ece7b16d27c8f2d4ba8a6e499dcedf |
|
MD5 | 6d73ec4d1f1367408eb7544e6c0b9af3 |
|
BLAKE2b-256 | 7453e6c7eff402ad9290400fa2d6d5504fe7d2c50b9662885802c09b07d8e829 |