An unofficial API allowing free interaction with ChatGPT in Python
Project description
pyGPT
An (unofficial) ChatGPT API made by yoinking code from revChatGPT and adapting it to use tls-client.
Installation
pip install pyGPT_api
Getting started
An access token is required for this package to run correctly. You can get yours here or open the chat.openai.com webpage, access the developer console, and get the token from Application -> Cookies -> __Secure-next-auth.session-token.
Below is a basic example that will create an infinitely looping conversation.
from pyGPT_api import AI
from uuid import uuid4
ai = AI("your_token_here")
while True:
message = ""
for data in ai.send_message(input(" > "), None, str(uuid4())):
message = data["message"]
print("\nChatGPT:", message, "\n")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyGPT-api-0.1.1.tar.gz.
File metadata
- Download URL: pyGPT-api-0.1.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
083ef392a46f9a7132a535efc9420839ce9c4d790f1dc60e77e77c13d0c57e02
|
|
| MD5 |
e9a96822ebd27ee8021d9f513907caf1
|
|
| BLAKE2b-256 |
cedebdfc3386b2e316a9698cdf9422e28bbb6f9eec59a5d9d37fee4b85120966
|
File details
Details for the file pyGPT_api-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyGPT_api-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
035f55ad581739c74e6efb2f473631aadbf14fdf71e55fe6833d60667966d628
|
|
| MD5 |
85f18aef8e1fa649121b14a6f8e859dc
|
|
| BLAKE2b-256 |
252faafd185761e7d311a05eb02fee748384f24c555fd151bb9e90988bb5a703
|