reliant-py
SDK oficial Python para o Reliant — LLM Reliability Layer.
Instalação
pip install reliant-py
Início rápido
from reliant import Reliant
client = Reliant(
api_key="rel_...", # Dashboard → Configurações
user_id="seu-user-id", # Dashboard → Configurações
base_url="https://reliant-production.up.railway.app",
)
# Executar com validação garantida
result = client.execute(
prompt="Extraia os dados: João Silva, joao@email.com",
schema_id="id-do-seu-schema",
provider="anthropic",
model="claude-sonnet-4-20250514",
)
print(result["output"]) # {"name": "João Silva", "email": "joao@email.com"}
print(result["metadata"]["attempts"]) # 1
print(result["metadata"]["latency_ms"]) # 743
Providers suportados
anthropic— Claude Sonnet, Opus, Haikuopenai— GPT-4o, GPT-4o-minigemini— Gemini 1.5 Pro, Flashgroq— Llama 3, Mixtralmistral— Mistral Large, Small
Métodos
execute()
result = client.execute(
prompt="seu prompt",
schema_id="sch_...",
provider="anthropic",
model="claude-sonnet-4-20250514",
max_retries=3,
)
# result["success"] → bool
# result["output"] → dict com o output validado
# result["status"] → "success" | "fallback" | "failed"
# result["metadata"]["execution_id"]
# result["metadata"]["attempts"]
# result["metadata"]["latency_ms"]
# result["metadata"]["tokens_used"]
list_schemas() / get_schema() / create_schema()
schemas = client.list_schemas()
schema = client.get_schema("id-do-schema")
new_schema = client.create_schema(
name="Extração de Contato",
slug="contact-extraction",
definition={
"type": "object",
"required": ["name", "email"],
"properties": {
"name": {"type": "string"},
"email": {"type": "string"},
}
},
safe_fallback={"name": None, "email": None},
)
list_executions() / get_execution()
executions = client.list_executions(limit=20, status="failed")
execution = client.get_execution("exec_...")
get_metrics()
metrics = client.get_metrics(days=30)
print(metrics["success_rate"]) # 98.5
print(metrics["total_executions"]) # 1420
print(metrics["estimated_cost_usd"]) # 0.0842
Tratamento de erros
from reliant import Reliant, ReliantException
try:
result = client.execute(...)
except ReliantException as e:
print(f"Erro {e.status_code}: {e}")
Requisitos
- Python >= 3.7
- Sem dependências externas
Metadata
Release files for reliant-py 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reliant_py-1.0.0.tar.gz | 2.6 kB | Without provenance | Details for reliant_py-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reliant_py-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for reliant_py-1.0.0-py3-none-any.whl |
Total release size: 5.1 kB
Release files / reliant_py-1.0.0.tar.gz
| Download URL | reliant_py-1.0.0.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4ef4cdc3712384a79382ad3ade1fb29c2a18f7b89b2212a58bf8aee4869a090
|
|
BLAKE2b-256 checksum How to use checksums |
bbe1f3a894f8c613eb88425fcd8ed3c1c094cbf4a03b1609401109c8b39e2af7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / reliant_py-1.0.0-py3-none-any.whl
| Download URL | reliant_py-1.0.0-py3-none-any.whl |
|---|---|
| Size | 2.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5508aec262a09cd4cc5d46f135670e9074be257620082d6d1a943bc375e75e9
|
|
BLAKE2b-256 checksum How to use checksums |
6a687753d8a92ad5ee7d07f734aed2c461bd59950cd5a82782b2f18bb5fcef23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for reliant-py 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.