Skip to main content

nexus-client

Async Python client for the Nexus AI infrastructure API.

Install

pip install nexus-client

Quick start

import asyncio
from nexus_client import AILayerClient

async def main():
    client = AILayerClient(
        base_url="https://your-nexus-host/api",
        api_key="your-api-key",
    )

    agent = await client.create_agent(
        name="assistant",
        model="openai/gpt-4o-mini",
        system_prompt="You are a helpful assistant.",
    )
    thread = await client.create_thread(agent_id=agent["id"])

    async for event in client.stream_chat(
        agent_id=agent["id"],
        thread_id=thread["id"],
        message={"role": "user", "content": [{"type": "text", "text": "Hello!"}]},
    ):
        if event.type == "delta" and event.text:
            print(event.text, end="", flush=True)

asyncio.run(main())

See the full docs for all methods and stream event types.

Release files for ai-layer-client 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-layer-client 0.2.0
File Size Uploaded
ai_layer_client-0.2.0.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-layer-client 0.2.0
File Interpreter ABI Platform
ai_layer_client-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / ai_layer_client-0.2.0.tar.gz

Download URL ai_layer_client-0.2.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
08fdc94bbd812ec61e27c8487cc74c59e35c717bb678279dfdb6e7949e9e9cb6
BLAKE2b-256 checksum
How to use checksums
63de1e7a1e013f948c7fffaceb71f927122f0d077adb5e6f9f10a324e30eb7ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Release files / ai_layer_client-0.2.0-py3-none-any.whl

Download URL ai_layer_client-0.2.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8de00424ddaaa6a50cc481ab8ab1aa87cd79739519f8ab34d7c4fb4b3197c469
BLAKE2b-256 checksum
How to use checksums
0061e7a33bde0b84d7e3daab09a83ae31e5c35a620f98a9f6eefd1f09382d4b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.15

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page