Skip to main content

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


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.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

ai_layer_client-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file ai_layer_client-0.1.0.tar.gz.

File metadata

  • Download URL: ai_layer_client-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for ai_layer_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69ddc56d131d8d5b10cad3e4cde06552725e1cb799265d0b924708ca5d1646f8
MD5 90b0eea130a2aaa51323e837b15ad807
BLAKE2b-256 6faeb4bb1c053692a7ffcfba77c205523f8965ec4887fd2f3bd1084b8ec50348

See more details on using hashes here.

File details

Details for the file ai_layer_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_layer_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a567335c108c0dbab974cd8a0dd69f0312135b551f0eeeb7328102e53a48048a
MD5 14eeb564a65721a549dd081490570774
BLAKE2b-256 cfc114d8209fe337239eef49a234b9d0f24f0a9668c397034f48e1f28c378d93

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