Async Python SDK for the Floxoris AI API gateway.
Project description
floxoris
Minimal async Python SDK for the Floxoris AI API gateway.
Install
pip install floxoris
Quickstart
import floxoris
floxoris.api_key = "ak-fs-..."
result = await floxoris.moderate("ти дебіл")
print(result.label) # "toxic"
print(result.toxic_score) # 0.89
print(result.safe_score) # 0.10
Specify a model explicitly:
import floxoris
floxoris.api_key = "ak-fs-..."
result = await floxoris.moderate(
"hello world",
model="floxoris/harmony-v0",
)
Use the explicit client when you want to control connection lifecycle:
from floxoris import AsyncClient
async with AsyncClient(api_key="ak-fs-...") as client:
result = await client.moderate("text here")
Configuration
Module-level configuration:
import floxoris
floxoris.api_key = "ak-fs-..."
floxoris.base_url = "https://floxoris.xyz"
floxoris.default_model = "floxoris/harmony-v0"
The SDK:
- sends
Authorization: Bearer <api_key> - posts moderation requests to the Floxoris gateway
POST /requests - retries once automatically on
5xx - raises typed exceptions for auth, rate limit, and API failures
Response model
from dataclasses import dataclass
@dataclass
class ModerationResult:
label: str
class_id: int
safe_score: float
toxic_score: float
latency_ms: float | None
model: str
Exceptions
from floxoris import APIError, AuthError, FloxorisError, RateLimitError
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
floxoris-0.1.3.tar.gz
(4.9 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 floxoris-0.1.3.tar.gz.
File metadata
- Download URL: floxoris-0.1.3.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c343f03593b97851bad4648ce5d7bf572c893b8c0392d4a9dcf6aade32f1456d
|
|
| MD5 |
c1e94881da4c7cd1a83deee93054dd9f
|
|
| BLAKE2b-256 |
14f26d82f65aac416fcd379c6073a6fc74b184299cd52c0452ba329925c78766
|
File details
Details for the file floxoris-0.1.3-py3-none-any.whl.
File metadata
- Download URL: floxoris-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
608ef8474cfb1d45547f9820a8e9795b44caf7ac3adb602f1b8f4eace6b93b8c
|
|
| MD5 |
7ec9f98e628161ba981cf2dcced1bd84
|
|
| BLAKE2b-256 |
3833dd07cf371278c179a6b835c315338c99ad1bb3e60ac7d200e89a9cc96ba3
|