![ClashAI Wide-Banner](https://i.ibb.co/5czjY5n/Clash-AI-Wide-Banner-No-Background.png)
# ๐ | ClashAI Python Package
**ClashAI Python Package for easy API integration!**
## Installation
```python
pip install clashai
```
## ๐ญ | Chat Completions
```python
import clashaipy
client = clashaipy.Client(api_key="[YOUR API KEY]")
completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "Hello, World!",
}
]
)
print(completion['choices'][0]['message']['content'])
```
## ๐ท | Image Recognition
```py
import clashaipy
client = clashaipy.Client(api_key="[YOUR API KEY]")
response = client.chat.completions.create(
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Whatโs in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
},
},
],
}
]
)
print(response['choices'][0]['message']['content'])
```
Raw data
{
"_id": null,
"home_page": null,
"name": "clashaipy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "clash-ai, clashai, api, clashapi, clashai, ai, gpt, llama, mixtral, gemini, clashaipy",
"author": "Julianwe17, invalidsian",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/4f/65/985a514c6368acd36f8228bd1842d58c76a2f9e00a1123e9114d5deef60c/clashaipy-1.0.8.tar.gz",
"platform": null,
"description": "![ClashAI Wide-Banner](https://i.ibb.co/5czjY5n/Clash-AI-Wide-Banner-No-Background.png)\r\n# \ud83d\ude80 | ClashAI Python Package\r\n**ClashAI Python Package for easy API integration!**\r\n\r\n## Installation\r\n```python\r\npip install clashai\r\n```\r\n\r\n## \ud83d\udcad | Chat Completions\r\n\r\n```python\r\nimport clashaipy\r\n\r\nclient = clashaipy.Client(api_key=\"[YOUR API KEY]\")\r\ncompletion = client.chat.completions.create(\r\n messages=[\r\n {\r\n \"role\": \"user\",\r\n \"content\": \"Hello, World!\",\r\n }\r\n ]\r\n)\r\n\r\nprint(completion['choices'][0]['message']['content'])\r\n```\r\n\r\n## \ud83d\udcf7 | Image Recognition\r\n\r\n```py\r\nimport clashaipy\r\n\r\nclient = clashaipy.Client(api_key=\"[YOUR API KEY]\")\r\n\r\nresponse = client.chat.completions.create(\r\n messages=[\r\n {\r\n \"role\": \"user\",\r\n \"content\": [\r\n {\"type\": \"text\", \"text\": \"What\u2019s in this image?\"},\r\n {\r\n \"type\": \"image_url\",\r\n \"image_url\": {\r\n \"url\": \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\",\r\n },\r\n },\r\n ],\r\n }\r\n ]\r\n)\r\n\r\nprint(response['choices'][0]['message']['content'])\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An API wrapper for the ClashAI API",
"version": "1.0.8",
"project_urls": {
"ClashAI": "https://clashai.eu",
"Documentation": "https://clashai.readthedocs.io",
"GitHub": "https://github.com/clashai/clashai"
},
"split_keywords": [
"clash-ai",
" clashai",
" api",
" clashapi",
" clashai",
" ai",
" gpt",
" llama",
" mixtral",
" gemini",
" clashaipy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "41ff54b98aab7d834eb578f8be6de6b7b1c200b1760eb6bba65f7864783824ae",
"md5": "b49f48def9eca60bff74dbd0df3db97d",
"sha256": "c3167cdb6b127e54f79eaee68e2d9464012c84e85ac0eb13207513c6b7db85f9"
},
"downloads": -1,
"filename": "clashaipy-1.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b49f48def9eca60bff74dbd0df3db97d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 3659,
"upload_time": "2025-01-05T13:42:03",
"upload_time_iso_8601": "2025-01-05T13:42:03.539783Z",
"url": "https://files.pythonhosted.org/packages/41/ff/54b98aab7d834eb578f8be6de6b7b1c200b1760eb6bba65f7864783824ae/clashaipy-1.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4f65985a514c6368acd36f8228bd1842d58c76a2f9e00a1123e9114d5deef60c",
"md5": "42e2e26f100970581f315497dab16f40",
"sha256": "f09f4030d668fc919f07d91270ea6bb5c2d3aba9e9da521b6d5a1b8280cca57d"
},
"downloads": -1,
"filename": "clashaipy-1.0.8.tar.gz",
"has_sig": false,
"md5_digest": "42e2e26f100970581f315497dab16f40",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 2872,
"upload_time": "2025-01-05T13:42:06",
"upload_time_iso_8601": "2025-01-05T13:42:06.590703Z",
"url": "https://files.pythonhosted.org/packages/4f/65/985a514c6368acd36f8228bd1842d58c76a2f9e00a1123e9114d5deef60c/clashaipy-1.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-05 13:42:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "clashai",
"github_project": "clashai",
"github_not_found": true,
"lcname": "clashaipy"
}