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.5.tar.gz
(15.5 kB
view hashes)
Built Distribution
pyChatGPT-0.0.5-py3-none-any.whl
(16.1 kB
view hashes)
Close
Hashes for pyChatGPT-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fe482f91d29141760347b5f6ae4ad93ca2c1cdfb20e13af44594e7383019f25 |
|
MD5 | 56f26482a75065bc9cbb87220cf4fe65 |
|
BLAKE2b-256 | e3ed38989392230349ed3d520470eed53b138f0cb9c873f0df68fe5973a6d04f |