Skip to main content

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://neonloops.com",  # optional, defaults to https://neonloops.com
)

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://neonloops.com",  # optional, defaults to https://neonloops.com
)

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 https://neonloops.com 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.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

neonloops-0.1.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file neonloops-0.1.1.tar.gz.

File metadata

  • Download URL: neonloops-0.1.1.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

Hashes for neonloops-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5d2557c3c06960b6b53a0ab5157fa5a3102302659b9ad9365fe1a9e84963d303
MD5 2304d2d97530771cfed2521b73a14416
BLAKE2b-256 6d79d80465a059beadce093fbdc2f9c4b5a02afa12b6a15bea4f9709ac470de0

See more details on using hashes here.

File details

Details for the file neonloops-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: neonloops-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for neonloops-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68d36912606231306b406ccd5e5d4744d3693a123c37a8efce111866c1fc431c
MD5 3f5dc4aa1976c4170ec38c26c421041a
BLAKE2b-256 43964515d677702eb3090c8d60f96fb4943495190a871f2fb290089074c6cd1e

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