pyGPT-api


NamepyGPT-api JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/alfred-exe/pyGPT
SummaryAn unofficial API allowing free interaction with ChatGPT in Python
upload_time2023-11-20 19:59:18
maintainer
docs_urlNone
authorAlfred Tonic
requires_python>=3.6
licenseGNU General Public License v2.0
keywords chatgpt openai
VCS
bugtrack_url
requirements tls-client requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 let you converse with ChatGPT as much as you'd like.
```py
from pyGPT_api import AI

ai = AI("your_token_here")
while True:
    message = ""
    for data in ai.send_message(input(" > ")):
        message = data["message"]
    print("\nChatGPT:", message, "\n")
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alfred-exe/pyGPT",
    "name": "pyGPT-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "chatgpt,openai",
    "author": "Alfred Tonic",
    "author_email": "eldritch.alfred@outlook.com",
    "download_url": "https://files.pythonhosted.org/packages/8a/90/95bd9d340fe248d51fb6f6639e1544c8ec8e7b2902f6acb10dc5d71d919c/pyGPT-api-0.1.3.tar.gz",
    "platform": null,
    "description": "# pyGPT\r\n![Tag](https://img.shields.io/github/license/alfred-exe/pyGPT)\r\n[![Downloads](https://static.pepy.tech/badge/pyGPT-api/month)](https://pepy.tech/project/pyGPT-api)\r\n\r\nAn (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).\r\n\r\n## Installation\r\n```bash\r\npip install pyGPT_api\r\n```\r\n\r\n## Getting started\r\nAn 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`.\r\n\r\nBelow is a basic example that will let you converse with ChatGPT as much as you'd like.\r\n```py\r\nfrom pyGPT_api import AI\r\n\r\nai = AI(\"your_token_here\")\r\nwhile True:\r\n    message = \"\"\r\n    for data in ai.send_message(input(\" > \")):\r\n        message = data[\"message\"]\r\n    print(\"\\nChatGPT:\", message, \"\\n\")\r\n```\r\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v2.0",
    "summary": "An unofficial API allowing free interaction with ChatGPT in Python",
    "version": "0.1.3",
    "project_urls": {
        "Homepage": "https://github.com/alfred-exe/pyGPT"
    },
    "split_keywords": [
        "chatgpt",
        "openai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4a33985590229ec1d7e6ed101517a05f86107784723194479ffaa16ca875d09f",
                "md5": "e9a74613e4b28ea2467905257b79b278",
                "sha256": "6c6f2b550fa258eb54c8543fc84abaee12c49d1c6e9b4d5721d78f26f1aee13c"
            },
            "downloads": -1,
            "filename": "pyGPT_api-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e9a74613e4b28ea2467905257b79b278",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4722,
            "upload_time": "2023-11-20T19:59:17",
            "upload_time_iso_8601": "2023-11-20T19:59:17.059456Z",
            "url": "https://files.pythonhosted.org/packages/4a/33/985590229ec1d7e6ed101517a05f86107784723194479ffaa16ca875d09f/pyGPT_api-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8a9095bd9d340fe248d51fb6f6639e1544c8ec8e7b2902f6acb10dc5d71d919c",
                "md5": "0682057e56c5f77823b53bbd79a95d8c",
                "sha256": "113acf127579ba91f904bda5e46c68290df1a26bed90648d5e848baa910eb5b2"
            },
            "downloads": -1,
            "filename": "pyGPT-api-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0682057e56c5f77823b53bbd79a95d8c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4897,
            "upload_time": "2023-11-20T19:59:18",
            "upload_time_iso_8601": "2023-11-20T19:59:18.271456Z",
            "url": "https://files.pythonhosted.org/packages/8a/90/95bd9d340fe248d51fb6f6639e1544c8ec8e7b2902f6acb10dc5d71d919c/pyGPT-api-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-20 19:59:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alfred-exe",
    "github_project": "pyGPT",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "tls-client",
            "specs": [
                [
                    ">=",
                    "0.2.2"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": []
        }
    ],
    "lcname": "pygpt-api"
}
        
Elapsed time: 0.18982s