PurGPT.py


NamePurGPT.py JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryPurGPT.py, the wrapper for the PurGPT API
upload_time2023-10-23 20:55:56
maintainer
docs_urlNone
authorTheCatsMoo
requires_python
license
keywords purgpt ai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PurGPT.py Documentation

The `PurGPT.py` Python package provides easy access to the PurGPT API for various natural language processing and AI tasks. This documentation explains the methods and their usage within the `PurGPT` class.

For full documentation, please visit [https://purgpt.xyz](https://purgpt.xyz)

---

## Getting a token

Think you're worthy to start with PurGPT? We sure do! If you agree with us, simply follow the steps below!

- Head over to the [Discord server](https://discord.gg) <-- Invites are currently paused!

Once there, click into the [``# bots``](https://discord.com/channels/1117511140440821852/1117527621459267694) channel

Run the `/key` command

The PurGPT bot will respond with your key. **Do not, under any circumstance, share it with anyone!** It's yours :)

Now that you have your token, you can move on!

## Initializing the class

### `ai = purgpt.PurGPT(token, dev = True)`

Initialize the `PurGPT` class with a token and an optional development mode flag.

- `token` (str): The API token for authentication! 
- `dev` (bool, optional): If set to `True`, the package will return the full JSON response from the request. If `False` (default), it will return important information or an error.

---

## Methods

### Test method: `test()`

Test the API by recieving a test message. The AI will respond and tell a funny joke if it is online. 

- Returns:
  - (dict or str): If in development mode (`dev=True`), returns the full JSON response or an error message. Otherwise, returns the AI's response or an error message.

### Generate method: `generate(prompt, provider="openai", beta=True)`

Generate individual text based on a prompt.

- `prompt` (str): The text prompt for the AI.
- `provider` (str, optional): The provider for text generation (default is "openai").
- `beta` (bool, optional): Whether to use the beta version (default is `True`).

### Chat method: `chat(messages, provider="openai", beta=True)`

Engage in a chat conversation with AI.

- `messages` (list): List of message objects for the conversation. (Same formatting as with OpenAI's package!)
- `provider` (str, optional): The provider for chat completion (default is "openai").
- `beta` (bool, optional): Whether to use the beta version (default is `True`).

### Document Analysis: `document_analysis(document_url: str, prompt: str, beta=True)`

Analyze documents or images with AI.

- `document_url` (str): The URL of the document or image to analyze.
- `prompt` (str): A prompt for the analysis.
- `beta` (bool, optional): Whether to use the beta version (default is `True`).

### Contend Moderation: `moderations(prompt, beta=True)`

Perform content moderation on text.

- `prompt` (str): The text to be moderated.
- `beta` (bool, optional): Whether to use the beta version (default is `True`).

### Image Generation: `image(prompt, provider="openai", beta=True)`

Generate images based on a text prompt.

- `prompt` (str): The text prompt for image generation.
- `provider` (str, optional): The provider for image generation (default is "openai").
- `beta` (bool, optional): Whether to use the beta version (default is `True`).

### Audio Transcription: `transcribe(file_url, beta=True)`

Transcribe an audio file from its URL.

- `file_url` (str): The URL of the audio file.
- `beta` (bool, optional): Whether to use the beta version (default is `True`).

### Audio Translation: `translate(file_url, beta=True)`

Translate an audio file from its URL.

- `file_url` (str): The URL of the audio file.
- `beta` (bool, optional): Whether to use the beta version (default is `True`).

### Other: `custom(owner, endpoint, body, subdomain)`

Use a custom API endpoint.

- `owner` (str): The owner/provider of the custom endpoint.
- `endpoint` (str): The custom endpoint to call.
- `body` (dict): The request body as a dictionary.
- `subdomain` (str): The subdomain to use for the custom request. (i.e. "rp" (if you know you know 😉))

**Note:** For more details and usage examples, refer to the [PurGPT API documentation.](https://purgpt.xyz)

---

# Quickstart

```py
import purgpt
import os

token = "" #replace with your actuall token 

ai = purgpt.PurGPT(token)

print(ai.generate("Say hello"))
```

## Thats all! 
If you have any questions, feel free to reach out to [`@thecatsmoo`](https://tcm.gay) on Discord!

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "PurGPT.py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "purgpt,AI",
    "author": "TheCatsMoo",
    "author_email": "tcm@tcm.gay",
    "download_url": "https://files.pythonhosted.org/packages/28/44/25d98e421d2625cc24b28221bf32919f1fbcc67ece2388212f868aadb1ba/PurGPT.py-0.0.1.tar.gz",
    "platform": null,
    "description": "# PurGPT.py Documentation\n\nThe `PurGPT.py` Python package provides easy access to the PurGPT API for various natural language processing and AI tasks. This documentation explains the methods and their usage within the `PurGPT` class.\n\nFor full documentation, please visit [https://purgpt.xyz](https://purgpt.xyz)\n\n---\n\n## Getting a token\n\nThink you're worthy to start with PurGPT? We sure do! If you agree with us, simply follow the steps below!\n\n- Head over to the [Discord server](https://discord.gg) <-- Invites are currently paused!\n\nOnce there, click into the [``# bots``](https://discord.com/channels/1117511140440821852/1117527621459267694) channel\n\nRun the `/key` command\n\nThe PurGPT bot will respond with your key. **Do not, under any circumstance, share it with anyone!** It's yours :)\n\nNow that you have your token, you can move on!\n\n## Initializing the class\n\n### `ai = purgpt.PurGPT(token, dev = True)`\n\nInitialize the `PurGPT` class with a token and an optional development mode flag.\n\n- `token` (str): The API token for authentication! \n- `dev` (bool, optional): If set to `True`, the package will return the full JSON response from the request. If `False` (default), it will return important information or an error.\n\n---\n\n## Methods\n\n### Test method: `test()`\n\nTest the API by recieving a test message. The AI will respond and tell a funny joke if it is online. \n\n- Returns:\n  - (dict or str): If in development mode (`dev=True`), returns the full JSON response or an error message. Otherwise, returns the AI's response or an error message.\n\n### Generate method: `generate(prompt, provider=\"openai\", beta=True)`\n\nGenerate individual text based on a prompt.\n\n- `prompt` (str): The text prompt for the AI.\n- `provider` (str, optional): The provider for text generation (default is \"openai\").\n- `beta` (bool, optional): Whether to use the beta version (default is `True`).\n\n### Chat method: `chat(messages, provider=\"openai\", beta=True)`\n\nEngage in a chat conversation with AI.\n\n- `messages` (list): List of message objects for the conversation. (Same formatting as with OpenAI's package!)\n- `provider` (str, optional): The provider for chat completion (default is \"openai\").\n- `beta` (bool, optional): Whether to use the beta version (default is `True`).\n\n### Document Analysis: `document_analysis(document_url: str, prompt: str, beta=True)`\n\nAnalyze documents or images with AI.\n\n- `document_url` (str): The URL of the document or image to analyze.\n- `prompt` (str): A prompt for the analysis.\n- `beta` (bool, optional): Whether to use the beta version (default is `True`).\n\n### Contend Moderation: `moderations(prompt, beta=True)`\n\nPerform content moderation on text.\n\n- `prompt` (str): The text to be moderated.\n- `beta` (bool, optional): Whether to use the beta version (default is `True`).\n\n### Image Generation: `image(prompt, provider=\"openai\", beta=True)`\n\nGenerate images based on a text prompt.\n\n- `prompt` (str): The text prompt for image generation.\n- `provider` (str, optional): The provider for image generation (default is \"openai\").\n- `beta` (bool, optional): Whether to use the beta version (default is `True`).\n\n### Audio Transcription: `transcribe(file_url, beta=True)`\n\nTranscribe an audio file from its URL.\n\n- `file_url` (str): The URL of the audio file.\n- `beta` (bool, optional): Whether to use the beta version (default is `True`).\n\n### Audio Translation: `translate(file_url, beta=True)`\n\nTranslate an audio file from its URL.\n\n- `file_url` (str): The URL of the audio file.\n- `beta` (bool, optional): Whether to use the beta version (default is `True`).\n\n### Other: `custom(owner, endpoint, body, subdomain)`\n\nUse a custom API endpoint.\n\n- `owner` (str): The owner/provider of the custom endpoint.\n- `endpoint` (str): The custom endpoint to call.\n- `body` (dict): The request body as a dictionary.\n- `subdomain` (str): The subdomain to use for the custom request. (i.e. \"rp\" (if you know you know \ud83d\ude09))\n\n**Note:** For more details and usage examples, refer to the [PurGPT API documentation.](https://purgpt.xyz)\n\n---\n\n# Quickstart\n\n```py\nimport purgpt\nimport os\n\ntoken = \"\" #replace with your actuall token \n\nai = purgpt.PurGPT(token)\n\nprint(ai.generate(\"Say hello\"))\n```\n\n## Thats all! \nIf you have any questions, feel free to reach out to [`@thecatsmoo`](https://tcm.gay) on Discord!\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "PurGPT.py, the wrapper for the PurGPT API",
    "version": "0.0.1",
    "project_urls": null,
    "split_keywords": [
        "purgpt",
        "ai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "109380f27af944cdffe02de7b00701bc032857a01e50c93a0bc01a3d22338a70",
                "md5": "3a385fe85072f193c6dbbf8e44db2fc7",
                "sha256": "7cf9899ce4147442b894ccdaae641a549ba3f7e463bbfbfec65bd92cbdc3b50c"
            },
            "downloads": -1,
            "filename": "PurGPT.py-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a385fe85072f193c6dbbf8e44db2fc7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6224,
            "upload_time": "2023-10-23T20:54:44",
            "upload_time_iso_8601": "2023-10-23T20:54:44.795532Z",
            "url": "https://files.pythonhosted.org/packages/10/93/80f27af944cdffe02de7b00701bc032857a01e50c93a0bc01a3d22338a70/PurGPT.py-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "284425d98e421d2625cc24b28221bf32919f1fbcc67ece2388212f868aadb1ba",
                "md5": "6787db37d8345657b08eadba2d97b9c5",
                "sha256": "7cf94b0b703e3d3f26315b996b471b3d6326112aca040804ab91e7f151fc7b67"
            },
            "downloads": -1,
            "filename": "PurGPT.py-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6787db37d8345657b08eadba2d97b9c5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6441,
            "upload_time": "2023-10-23T20:55:56",
            "upload_time_iso_8601": "2023-10-23T20:55:56.407710Z",
            "url": "https://files.pythonhosted.org/packages/28/44/25d98e421d2625cc24b28221bf32919f1fbcc67ece2388212f868aadb1ba/PurGPT.py-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-23 20:55:56",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "purgpt.py"
}
        
Elapsed time: 0.14195s