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.2.tar.gz
(4.4 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.2.tar.gz.
File metadata
- Download URL: floxoris-0.1.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74b88f191860dbfab2f6086b8ff171da23f6810a6999de833674c78a07269e4f
|
|
| MD5 |
ccd54299b2e5cd8f1bf8eb0fd09611ff
|
|
| BLAKE2b-256 |
4e16d01f90f775f88e940202943bc1beb9d0940a55a8e4bb7be0b7e8b07ff9d8
|
File details
Details for the file floxoris-0.1.2-py3-none-any.whl.
File metadata
- Download URL: floxoris-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.5 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 |
343a10a637c7100fda792de6cc23f96496bd6d6ddf3435e985f773934119ff37
|
|
| MD5 |
edcb9d7d123ba2d0397de9157d96a108
|
|
| BLAKE2b-256 |
71a1699b9c7178617edff619ee713b2701358dc6c3996c82e538afc0982c0ec0
|