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>
  • 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.0.tar.gz (4.3 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.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file floxoris-0.1.0.tar.gz.

File metadata

  • Download URL: floxoris-0.1.0.tar.gz
  • Upload date:
  • Size: 4.3 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.0.tar.gz
Algorithm Hash digest
SHA256 c7ba5d4ecab435cf151041a50c6d84880a5056619b66e2bf25a865b36fb68e68
MD5 10f8a8568a5bb910495d635aed37dcea
BLAKE2b-256 d789798251ee7089284f7758eaa47489571107c34bf299142033d6902c9722c8

See more details on using hashes here.

File details

Details for the file floxoris-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: floxoris-0.1.0-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

Hashes for floxoris-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e450581aeb7c91193bd79ad88a6b547669df0c84a989004b7e618983d6e01984
MD5 c5d6bb302c9b3d26cb100803722ada0b
BLAKE2b-256 2d8ba86672d0db3c1c94bb9344040c0fb8cc1bc6d06182d3b437067ffaf45f73

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