Библиотека для использования RuModeratorAI (https://moderator.pysols.ru)
Project description
RuModeratorAI
Библиотека для использования RuModeratorAI API (https://moderator.pysols.ru).
Установка
pip install rumoderatorai
Пример использования
from rumoderatorai import Client
import asyncio
from PIL import Image
import os
async def main():
async with Client(
api_key=os.getenv("RUMODERATORAI_API_KEY")
) as client:
text_response = await client.get_text_class("Hello, world!")
print(text_response)
profile_response = await client.get_profile_class(
username="test",
first_name="test",
last_name="test",
description="test",
is_premium=False,
)
print(profile_response)
image = Image.open("tests/image.png")
image_response = await client.get_image_class(image)
print(image_response)
stats_response = await client.get_stats()
print(stats_response)
key_info_response = await client.get_key_info()
print(key_info_response)
prediction_response = await client.get_prediction(unique_id=text_response.unique_id)
print(prediction_response)
ips_response = await client.get_ips()
print(ips_response)
prices_response = await client.get_prices()
print(prices_response)
asyncio.run(main())
Или можно использовать без async with:
from rumoderatorai import Client
import asyncio
from PIL import Image
import os
async def main():
client = Client(
api_key=os.getenv("RUMODERATORAI_API_KEY"),
)
await client.init()
text_response = await client.get_text_class("Hello, world!")
print(text_response)
profile_response = await client.get_profile_class(
username="test",
first_name="test",
last_name="test",
description="test",
is_premium=False,
)
print(profile_response)
image = Image.open("tests/image.png")
image_response = await client.get_image_class(image)
print(image_response)
stats_response = await client.get_stats()
print(stats_response)
key_info_response = await client.get_key_info()
print(key_info_response)
prediction_response = await client.get_prediction(unique_id=text_response.unique_id)
print(prediction_response)
ips_response = await client.get_ips()
print(ips_response)
prices_response = await client.get_prices()
print(prices_response)
await client.close()
asyncio.run(main())
Примечание: Не забудьте установить переменную окружения RUMODERATORAI_API_KEY перед запуском кода.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rumoderatorai-0.1.4.tar.gz
(6.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rumoderatorai-0.1.4.tar.gz.
File metadata
- Download URL: rumoderatorai-0.1.4.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd5711ec8452072639d822672d3a5a3858643d43640e8519f04c01b1d3154c9d
|
|
| MD5 |
35be51317c69408fac9c511fda16a1a8
|
|
| BLAKE2b-256 |
5cd0ba9bb468fea7fb74599465420129cec042c1d1ed2d7a65dea7430d7455ae
|
File details
Details for the file rumoderatorai-0.1.4-py3-none-any.whl.
File metadata
- Download URL: rumoderatorai-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2da0cceb6732a7f91a45418a70cdce925ce4f716faf4b0250aedaaeff343e6d
|
|
| MD5 |
9967bfcabeff7f7950a25f35692e11df
|
|
| BLAKE2b-256 |
65fb3b9dc9374cde2b4fd5eb928a96098bf6149cceaf4905101897395e7dc860
|