Async Python client for the Nexus AI infrastructure API
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ai_layer_client-0.2.0.tar.gz
(4.2 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 ai_layer_client-0.2.0.tar.gz.
File metadata
- Download URL: ai_layer_client-0.2.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08fdc94bbd812ec61e27c8487cc74c59e35c717bb678279dfdb6e7949e9e9cb6
|
|
| MD5 |
4845af43cc43b87059b499660ae51a64
|
|
| BLAKE2b-256 |
63de1e7a1e013f948c7fffaceb71f927122f0d077adb5e6f9f10a324e30eb7ad
|
File details
Details for the file ai_layer_client-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ai_layer_client-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8de00424ddaaa6a50cc481ab8ab1aa87cd79739519f8ab34d7c4fb4b3197c469
|
|
| MD5 |
0c5a665793e26b7c9a07f8917cc1743e
|
|
| BLAKE2b-256 |
0061e7a33bde0b84d7e3daab09a83ae31e5c35a620f98a9f6eefd1f09382d4b8
|