Metadata-Version: 2.1
Name: pyGPT-api
Version: 0.1.1
Summary: An unofficial API allowing free interaction with ChatGPT in Python
Home-page: https://github.com/alfred-exe/pyGPT
Author: Alfred Tonic
Author-email: eldritch.alfred@outlook.com
License: GNU General Public License v2.0
Keywords: chatgpt,openai
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: tls-client>=0.2.2

# pyGPT
![Tag](https://img.shields.io/github/license/alfred-exe/pyGPT)
[![Downloads](https://static.pepy.tech/badge/pyGPT-api/month)](https://pepy.tech/project/pyGPT-api)

An (unofficial) [ChatGPT](https://chat.openai.com/) API made by yoinking code from [revChatGPT](https://github.com/acheong08/ChatGPT) and adapting it to use [tls-client](https://github.com/FlorianREGAZ/Python-Tls-Client).

## Installation
```bash
pip install pyGPT_api
```

## Getting started
An access token is required for this package to run correctly. You can get yours [here](https://chat.openai.com/api/auth/session) or open the [chat.openai.com](https://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.
```py
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")
```
