cloudflare-ai


Namecloudflare-ai JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/alexraskin/cloudflare-ai-py
SummaryCloudflare AI Python SDK
upload_time2024-02-05 02:28:20
maintainer
docs_urlNone
authoralexraskin
requires_python
licenseMIT License
keywords module cloudflare library package python cloudflareai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cloudflare AI Python Wrapper

This is an Async Python wrapper for the Cloudflare AI API. It is a work in progress and is not yet ready for production use.
This does not include all of the Cloudflare AI API endpoints. If you would like to add more, please open a pull request.

If you have any updates or suggestions, please open an issue or pull request. :)

## Installation

```bash
pip install cloudflare-ai
```

## Usage

```python
import asyncio

from CloudflareAI import CloudflareAI, AiTextToImageModels, AiTextGenerationModels, AiImageClassificationModels


async def main():
    ai = CloudflareAI(
        Cloudflare_API_Key=<Your Token>,
        Cloudflare_Account_Identifier=<Account ID>,
    )
    image = await ai.ImageClassification(
        image_path="image.jpg", model_name=AiImageClassificationModels.RESNET_50
    )

    text = await ai.TextGeneration(
        prompt="You are helpful",
        system_prompt="Hello, my name is Alex",
        model_name=AiTextGenerationModels.CODE_LLAMA_7B,
    )
    image = await ai.TextToImage(prompt="a Cat", model_name=AiTextToImageModels.XL_BASE)

asyncio.run(main())
```

## License

Mozilla Public License Version 2.0 (MPL-2.0) - See LICENSE for more information.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/alexraskin/cloudflare-ai-py",
    "name": "cloudflare-ai",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "module,Cloudflare,library,package,python,CloudflareAI",
    "author": "alexraskin",
    "author_email": "<root@alexraskin.com>",
    "download_url": "https://files.pythonhosted.org/packages/c9/2b/a4cc69682b3fc84ee2ab7681db87273f61e369bac8cef6ba777848490404/cloudflare_ai-0.0.6.tar.gz",
    "platform": null,
    "description": "# Cloudflare AI Python Wrapper\n\nThis is an Async Python wrapper for the Cloudflare AI API. It is a work in progress and is not yet ready for production use.\nThis does not include all of the Cloudflare AI API endpoints. If you would like to add more, please open a pull request.\n\nIf you have any updates or suggestions, please open an issue or pull request. :)\n\n## Installation\n\n```bash\npip install cloudflare-ai\n```\n\n## Usage\n\n```python\nimport asyncio\n\nfrom CloudflareAI import CloudflareAI, AiTextToImageModels, AiTextGenerationModels, AiImageClassificationModels\n\n\nasync def main():\n    ai = CloudflareAI(\n        Cloudflare_API_Key=<Your Token>,\n        Cloudflare_Account_Identifier=<Account ID>,\n    )\n    image = await ai.ImageClassification(\n        image_path=\"image.jpg\", model_name=AiImageClassificationModels.RESNET_50\n    )\n\n    text = await ai.TextGeneration(\n        prompt=\"You are helpful\",\n        system_prompt=\"Hello, my name is Alex\",\n        model_name=AiTextGenerationModels.CODE_LLAMA_7B,\n    )\n    image = await ai.TextToImage(prompt=\"a Cat\", model_name=AiTextToImageModels.XL_BASE)\n\nasyncio.run(main())\n```\n\n## License\n\nMozilla Public License Version 2.0 (MPL-2.0) - See LICENSE for more information.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Cloudflare AI Python SDK",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/alexraskin/cloudflare-ai-py"
    },
    "split_keywords": [
        "module",
        "cloudflare",
        "library",
        "package",
        "python",
        "cloudflareai"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ad0f00f0f640d08bb8ecd23eb02ab087cefdd8f0eab8040795c0635dab3b6cca",
                "md5": "898159cebcd52b15ae80da9262c8d007",
                "sha256": "4e2ecfc5d1512ba49e1e49d657b71fdeac83f5c1537d91195ba1afaf2e400b17"
            },
            "downloads": -1,
            "filename": "cloudflare_ai-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "898159cebcd52b15ae80da9262c8d007",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 14026,
            "upload_time": "2024-02-05T02:28:18",
            "upload_time_iso_8601": "2024-02-05T02:28:18.893270Z",
            "url": "https://files.pythonhosted.org/packages/ad/0f/00f0f640d08bb8ecd23eb02ab087cefdd8f0eab8040795c0635dab3b6cca/cloudflare_ai-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c92ba4cc69682b3fc84ee2ab7681db87273f61e369bac8cef6ba777848490404",
                "md5": "4045f44fed16ddf50ffe41ecd6adcf0a",
                "sha256": "bca6c12d9eb6a8ec7878087b5373680d744517f9ba1a019b98c5846d43cef1a3"
            },
            "downloads": -1,
            "filename": "cloudflare_ai-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "4045f44fed16ddf50ffe41ecd6adcf0a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10007,
            "upload_time": "2024-02-05T02:28:20",
            "upload_time_iso_8601": "2024-02-05T02:28:20.474765Z",
            "url": "https://files.pythonhosted.org/packages/c9/2b/a4cc69682b3fc84ee2ab7681db87273f61e369bac8cef6ba777848490404/cloudflare_ai-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-05 02:28:20",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alexraskin",
    "github_project": "cloudflare-ai-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "cloudflare-ai"
}
        
Elapsed time: 0.25720s