Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

floxoris-0.1.3-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

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

Hashes for floxoris-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c343f03593b97851bad4648ce5d7bf572c893b8c0392d4a9dcf6aade32f1456d
MD5 c1e94881da4c7cd1a83deee93054dd9f
BLAKE2b-256 14f26d82f65aac416fcd379c6073a6fc74b184299cd52c0452ba329925c78766

See more details on using hashes here.

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

Hashes for floxoris-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 608ef8474cfb1d45547f9820a8e9795b44caf7ac3adb602f1b8f4eace6b93b8c
MD5 7ec9f98e628161ba981cf2dcced1bd84
BLAKE2b-256 3833dd07cf371278c179a6b835c315338c99ad1bb3e60ac7d200e89a9cc96ba3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page