gpt-api-python


Namegpt-api-python JSON
Version 1.0.3 PyPI version JSON
download
home_page
SummaryPython client sdk to access GPT's AI-powered conversational functionality (without OpenAI API key nor VPN)
upload_time2023-12-06 16:25:04
maintainer
docs_urlNone
author
requires_python
licenseBSD 2-Clause License Copyright (c) [2023], [Beeno Tung (Tung Cheung Leong)] All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords gpt gpt-api openai language-model nlp ai chatbot text-generation text-summarization translation question-answering sentiment-analysis content-moderation conversational-ai poe sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gpt-api-python

Python client sdk to access GPT's AI-powered conversational functionality (without OpenAI API key nor VPN).

[![PyPi Package Version](https://img.shields.io/pypi/v/gpt-api-python)](https://pypi.org/project/gpt-api-python)

Details refer to https://github.com/beenotung/gpt-api

## Remarks

The spirit of this library is to enable developers to use the Platform for Open Exploration (Poe) via API. It's designed to empower integration and application development within the terms of service of Poe, which specifically disallow any form of automation that exceeds the set rate limits. Please use this library responsibly and within the provided guidelines.

## Features

- **Intuitive API**: Make conversation with GPT models via simple and developer-friendly API.

- **Programming Language Agnostic**: Designed to work with any programming language. Integrate GPT-powered conversational functionalities into your existing projects with ease.

- **Responsible Usage**: Encourages users to respect the guidelines and rate limits set by Poe.

## Installation

```bash
pip install gpt-api-python
```

## Usage Example

```python
# Import functions from the Python package
from gpt_api import ask
from gpt_api.cli import clear_screen

# ask GPT a question and wait for complete response
task = ask(question='Can I call GPT API from python?')
file_path = f"task-{task['id']}.html"
with open(file_path, 'w') as file:
	file.write(task['html'])
print(task['text'])


# ask GPT a question and process the partial response in realtime
def show_progress(task):
	clear_screen()
	print(task['question'])
	print('=' * 32)
	print(task['text'])

# Use the chat method
task = gpt.chat(prompt='What can I do with GPT?', callback=show_progress)
print(f"text: {len(task['text'])}, html: {len(task['html'])}")
```

Detail example can refer to the demo [cli.py](./client/python/src/gpt_api/cli.py)

## Proper Use

It's important to note that Poe's terms of service disallow any form of automation that exceeds the rate limits set forth by Poe. Please ensure to use this library responsibly and within the limits set by Poe. Improper use may lead to suspension of your access to the services.

## Potential Use Cases

(This section is generated by GPT-4 itself)

GPT (Generative Pre-trained Transformer) models are powerful language models capable of generating human-like text. They can be used to enable a wide range of functionalities:

- **Chatbots and Conversational Agents**: GPT models can be used to create chatbots that can carry on human-like conversations. These chatbots can answer questions, provide recommendations, and even have friendly chats with users.

- **Text Generation and Completion**: Given a prompt, GPT models can generate coherent and contextually relevant text. This can be used for tasks such as writing essays, generating code, creating poetry, and much more.

- **Translation**: While not specifically trained for translation, GPT models have shown reasonable performance in translating text between languages.

- **Summarization**: GPT models can be used to summarize long pieces of text, providing a condensed version while preserving the original meaning.

- **Question Answering**: Given a context and a question, GPT models can provide accurate answers, making them useful for tasks like customer support, tutoring, and knowledge extraction.

- **Sentiment Analysis**: While not a primary use case, GPT models can be used to analyze the sentiment of a piece of text, identifying whether the sentiment is positive, negative, or neutral.

- **Content Moderation**: GPT models can help moderate content, identifying inappropriate or offensive text.

- **Personal Assistants**: GPT models can be used to create personal assistants that can schedule appointments, send messages, set reminders, and more.

- **Tutoring**: GPT can provide detailed explanations on a wide range of topics, making it a useful tool for education and tutoring.

These applications can be integrated into various software applications, websites, and services to provide a more interactive and personalized user experience.

However, it's important to note that while GPT models are powerful, they are not perfect. They can sometimes generate incorrect or inappropriate responses, and should not be relied upon for critical decision-making without human supervision.

## License

This project is licensed with [BSD-2-Clause](./LICENSE)

This is free, libre, and open-source software. It comes down to four essential freedoms [[ref]](https://seirdy.one/2021/01/27/whatsapp-and-the-domestication-of-users.html#fnref:2):

- The freedom to run the program as you wish, for any purpose
- The freedom to study how the program works, and change it so it does your computing as you wish
- The freedom to redistribute copies so you can help others
- The freedom to distribute copies of your modified versions to others

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "gpt-api-python",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "gpt,gpt-api,openai,language-model,nlp,ai,chatbot,text-generation,text-summarization,translation,question-answering,sentiment-analysis,content-moderation,conversational-ai,poe,sdk",
    "author": "",
    "author_email": "Beeno Tung <aabbcc1241@yahoo.com.hk>",
    "download_url": "https://files.pythonhosted.org/packages/62/9c/342c889790bb8c86fe1c80bc42941a40b50aebd7aac44b206f991c599d01/gpt-api-python-1.0.3.tar.gz",
    "platform": null,
    "description": "# gpt-api-python\n\nPython client sdk to access GPT's AI-powered conversational functionality (without OpenAI API key nor VPN).\n\n[![PyPi Package Version](https://img.shields.io/pypi/v/gpt-api-python)](https://pypi.org/project/gpt-api-python)\n\nDetails refer to https://github.com/beenotung/gpt-api\n\n## Remarks\n\nThe spirit of this library is to enable developers to use the Platform for Open Exploration (Poe) via API. It's designed to empower integration and application development within the terms of service of Poe, which specifically disallow any form of automation that exceeds the set rate limits. Please use this library responsibly and within the provided guidelines.\n\n## Features\n\n- **Intuitive API**: Make conversation with GPT models via simple and developer-friendly API.\n\n- **Programming Language Agnostic**: Designed to work with any programming language. Integrate GPT-powered conversational functionalities into your existing projects with ease.\n\n- **Responsible Usage**: Encourages users to respect the guidelines and rate limits set by Poe.\n\n## Installation\n\n```bash\npip install gpt-api-python\n```\n\n## Usage Example\n\n```python\n# Import functions from the Python package\nfrom gpt_api import ask\nfrom gpt_api.cli import clear_screen\n\n# ask GPT a question and wait for complete response\ntask = ask(question='Can I call GPT API from python?')\nfile_path = f\"task-{task['id']}.html\"\nwith open(file_path, 'w') as file:\n\tfile.write(task['html'])\nprint(task['text'])\n\n\n# ask GPT a question and process the partial response in realtime\ndef show_progress(task):\n\tclear_screen()\n\tprint(task['question'])\n\tprint('=' * 32)\n\tprint(task['text'])\n\n# Use the chat method\ntask = gpt.chat(prompt='What can I do with GPT?', callback=show_progress)\nprint(f\"text: {len(task['text'])}, html: {len(task['html'])}\")\n```\n\nDetail example can refer to the demo [cli.py](./client/python/src/gpt_api/cli.py)\n\n## Proper Use\n\nIt's important to note that Poe's terms of service disallow any form of automation that exceeds the rate limits set forth by Poe. Please ensure to use this library responsibly and within the limits set by Poe. Improper use may lead to suspension of your access to the services.\n\n## Potential Use Cases\n\n(This section is generated by GPT-4 itself)\n\nGPT (Generative Pre-trained Transformer) models are powerful language models capable of generating human-like text. They can be used to enable a wide range of functionalities:\n\n- **Chatbots and Conversational Agents**: GPT models can be used to create chatbots that can carry on human-like conversations. These chatbots can answer questions, provide recommendations, and even have friendly chats with users.\n\n- **Text Generation and Completion**: Given a prompt, GPT models can generate coherent and contextually relevant text. This can be used for tasks such as writing essays, generating code, creating poetry, and much more.\n\n- **Translation**: While not specifically trained for translation, GPT models have shown reasonable performance in translating text between languages.\n\n- **Summarization**: GPT models can be used to summarize long pieces of text, providing a condensed version while preserving the original meaning.\n\n- **Question Answering**: Given a context and a question, GPT models can provide accurate answers, making them useful for tasks like customer support, tutoring, and knowledge extraction.\n\n- **Sentiment Analysis**: While not a primary use case, GPT models can be used to analyze the sentiment of a piece of text, identifying whether the sentiment is positive, negative, or neutral.\n\n- **Content Moderation**: GPT models can help moderate content, identifying inappropriate or offensive text.\n\n- **Personal Assistants**: GPT models can be used to create personal assistants that can schedule appointments, send messages, set reminders, and more.\n\n- **Tutoring**: GPT can provide detailed explanations on a wide range of topics, making it a useful tool for education and tutoring.\n\nThese applications can be integrated into various software applications, websites, and services to provide a more interactive and personalized user experience.\n\nHowever, it's important to note that while GPT models are powerful, they are not perfect. They can sometimes generate incorrect or inappropriate responses, and should not be relied upon for critical decision-making without human supervision.\n\n## License\n\nThis project is licensed with [BSD-2-Clause](./LICENSE)\n\nThis is free, libre, and open-source software. It comes down to four essential freedoms [[ref]](https://seirdy.one/2021/01/27/whatsapp-and-the-domestication-of-users.html#fnref:2):\n\n- The freedom to run the program as you wish, for any purpose\n- The freedom to study how the program works, and change it so it does your computing as you wish\n- The freedom to redistribute copies so you can help others\n- The freedom to distribute copies of your modified versions to others\n",
    "bugtrack_url": null,
    "license": "BSD 2-Clause License  Copyright (c) [2023], [Beeno Tung (Tung Cheung Leong)] All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "Python client sdk to access GPT's AI-powered conversational functionality (without OpenAI API key nor VPN)",
    "version": "1.0.3",
    "project_urls": {
        "Homepage": "https://github.com/beenotung/gpt-api"
    },
    "split_keywords": [
        "gpt",
        "gpt-api",
        "openai",
        "language-model",
        "nlp",
        "ai",
        "chatbot",
        "text-generation",
        "text-summarization",
        "translation",
        "question-answering",
        "sentiment-analysis",
        "content-moderation",
        "conversational-ai",
        "poe",
        "sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1246eeaa5d22702f3e101f31669d64c07d4670aef32c2314d5a27478441741a4",
                "md5": "53edfc927f5851dca28862edc4d89af7",
                "sha256": "e4f55bf0f98ac5ccdc52c4acc674423129cf36b8bc233f77b7991c58ed19422e"
            },
            "downloads": -1,
            "filename": "gpt_api_python-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "53edfc927f5851dca28862edc4d89af7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6753,
            "upload_time": "2023-12-06T16:25:00",
            "upload_time_iso_8601": "2023-12-06T16:25:00.994103Z",
            "url": "https://files.pythonhosted.org/packages/12/46/eeaa5d22702f3e101f31669d64c07d4670aef32c2314d5a27478441741a4/gpt_api_python-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "629c342c889790bb8c86fe1c80bc42941a40b50aebd7aac44b206f991c599d01",
                "md5": "491e59d9637ea4ee6a70ba2ab25671bd",
                "sha256": "31d236fdecc71a051556a8aadbd01cdcc28bffe7b87776a7b548035ae24aa5d4"
            },
            "downloads": -1,
            "filename": "gpt-api-python-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "491e59d9637ea4ee6a70ba2ab25671bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6387,
            "upload_time": "2023-12-06T16:25:04",
            "upload_time_iso_8601": "2023-12-06T16:25:04.273854Z",
            "url": "https://files.pythonhosted.org/packages/62/9c/342c889790bb8c86fe1c80bc42941a40b50aebd7aac44b206f991c599d01/gpt-api-python-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-06 16:25:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "beenotung",
    "github_project": "gpt-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "gpt-api-python"
}
        
Elapsed time: 0.49912s