Skip to main content

A Python client library for interacting with the Voxta conversational AI platform via SignalR.

Project description

Voxta Client

Build PyPI version Python versions License: MIT Ruff

A core library for interacting with the Voxta conversational AI platform using Python. This client enables real-time communication with Voxta characters using the SignalR protocol.

Documentation

Full documentation is available at dion-labs.github.io/voxta-client.

Compatibility

  • Voxta Server: Designed for and tested with v1.2.1.
  • Python: Supports 3.9+.

Features

  • Real-time Interaction: Full support for Voxta's SignalR/WebSockets protocol.
  • Event-Driven: Simple callback system for handling server events (messages, state changes, etc.).
  • Session Management: Easy handling of chat sessions, character selection, and context updates.
  • Lightweight: Minimal dependencies, built for performance and reliability.

Protocol Support Matrix

This client implements the Voxta SignalR protocol. Below is the current support status compared to the full server capabilities.

Category Feature Protocol Method Status
Core Authentication authenticate ✅ Supported
App Registration registerApp ✅ Supported
Chat Subscription subscribeToChat ✅ Supported
Messaging Start Chat startChat ✅ Supported
Resume Chat resumeChat ✅ Supported
Send Message send ✅ Supported
Character Speech Req characterSpeechRequest ✅ Supported
Control Interrupt interrupt ✅ Supported
Pause pause ✅ Supported
Inspect Session inspect ✅ Supported
Context Update Context updateContext ✅ Supported
Actions/Events updateContext ✅ Supported
Role Management enableRoles ✅ Supported
Media Playback Sync speechPlaybackStart/Complete ✅ Supported
Audio Streaming WebSocketStream (PCM) ❌ Not Planned
Vision / Images visionCapture ❌ Not Planned

Installation

pip install voxta-client

Quick Start

import asyncio
from voxta_client import VoxtaClient

async def main():
    # 1. Initialize the client
    client = VoxtaClient("http://localhost:5384")
    
    # Set up event listeners
    @client.on("message")
    async def on_message(payload):
        if payload.get("senderType") == "Character":
            print(f"\nCharacter: {payload.get('text')}")

    # 2. Negotiate authentication
    print("Negotiating connection...")
    token, cookies = client.negotiate()
    
    # 3. Connect (runs the message loop in the background)
    connection_task = asyncio.create_task(client.connect(token, cookies))
    
    # Wait for the client to be ready (connected and session pinned)
    # The 'ready' event is triggered once a sessionId is acquired
    ready_event = asyncio.Event()
    client.on("ready", lambda _: ready_event.set())
    
    print("Connecting to Voxta...")
    await ready_event.wait()
    print(f"Connected! Session ID: {client.session_id}")

    # 4. Send a message
    print("Sending message...")
    await client.send_message("Hello! Tell me a short story.")
    
    # Wait for response
    await asyncio.sleep(10)
    
    # Clean up
    await client.close()
    await connection_task

if __name__ == "__main__":
    asyncio.run(main())

Development

This project uses uv for dependency management and Ruff for linting.

Setup

# Clone the repository
git clone https://github.com/dion-labs/voxta-client.git
cd voxta-client

# Install dependencies and setup venv
uv sync --all-extras

# Install pre-commit hooks
uv run pre-commit install

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

voxta_client-0.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

voxta_client-0.1.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: voxta_client-0.1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.26

File hashes

Hashes for voxta_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29431f35d75042e1b21f17095ca0f0708b8fb6f1d392e305b7392c9f1c42ca4c
MD5 8ac6cff0e89ba5fdc096139389ca29e6
BLAKE2b-256 fe98dbb14631358fbeccb2f68f7c1ce7d25092ba3ecc05e15316c9d65c1558b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for voxta_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 906554df60cb83d3aaf49683092edb1d09fef68689a205546de6d389bf7f5d2c
MD5 ae300070efadded035832702309fff32
BLAKE2b-256 ecbfbbf166d2d4bbaf1cfd5f24ddedda7da16a67ea1ae6604844dc96f1847389

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