Python SDK for Neonloops — run AI workflows via API
Project description
neonloops
Python SDK for Neonloops — run AI workflows via API.
Installation
pip install neonloops
Quick Start
Async (recommended)
import asyncio
from neonloops import Runner, RunInput
runner = Runner(
api_key="nl_sk_...",
base_url="https://your-app.vercel.app",
)
async def main():
result = await runner.run(
workflow_id="wf_abc123",
input=[RunInput(role="user", content="Hello, run my workflow!")],
)
print(result.output)
print(result.metadata.tokens)
asyncio.run(main())
Sync
from neonloops import Runner, RunInput
runner = Runner(
api_key="nl_sk_...",
base_url="https://your-app.vercel.app",
)
result = runner.run_sync(
workflow_id="wf_abc123",
input=[RunInput(role="user", content="Hello!")],
)
print(result.output)
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key |
str |
— | Required. Your Neonloops API key (nl_sk_...) |
base_url |
str |
http://localhost:3000 |
Base URL of your Neonloops instance |
project_id |
str |
None |
Default project ID to scope requests |
timeout |
float |
120.0 |
Request timeout in seconds |
max_retries |
int |
2 |
Max retries for 429/5xx errors |
Error Handling
from neonloops import Runner, NeonloopsApiError, NeonloopsTimeoutError
try:
result = await runner.run(
workflow_id="wf_abc123",
input=[RunInput(role="user", content="Hello")],
)
except NeonloopsApiError as e:
print(f"API error {e.status}: {e}")
except NeonloopsTimeoutError as e:
print(f"Timeout: {e}")
License
MIT
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
neonloops-0.1.0.tar.gz
(5.6 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 neonloops-0.1.0.tar.gz.
File metadata
- Download URL: neonloops-0.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46da357dfe3017a907e346596c3bd2009b021db90358cd4d5c9b7188c2772a54
|
|
| MD5 |
ddcb7d2181b833d13be2c61fab6566e4
|
|
| BLAKE2b-256 |
54721aec8d45ab20ae033ad84431ca35e24735ca4c6823e5ba9118246e51dbb9
|
File details
Details for the file neonloops-0.1.0-py3-none-any.whl.
File metadata
- Download URL: neonloops-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6614d61229c7f52bb0957ac147dff7a082428ffb49eda9d103ec0a94e5ed325c
|
|
| MD5 |
853c598de3801cf1129aa793fff31604
|
|
| BLAKE2b-256 |
216a9101ff0618c55d3678a410b56cdec3fbdd73b254ac59b91a194f0b57eb99
|