Metadata-Version: 2.5
Name: anva
Version: 0.4.0
Summary: Official Python SDK for Anva — live AI avatars for your product.
Project-URL: Homepage, https://anva.ai
Project-URL: Documentation, https://anva.ai/docs
Project-URL: Source, https://github.com/Anva-avatars/anva-sdk
Author-email: Anva <anva.ai.2026@gmail.com>
License: MIT
License-File: LICENSE
Keywords: ai,anva,avatar,voice,webrtc
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Provides-Extra: ws
Requires-Dist: websockets>=12; extra == 'ws'
Description-Content-Type: text/markdown

# anva — Python SDK

Install with `pip install "anva[ws]==0.4.0"`.
The REST client uses the standard library. Realtime uses `websockets`' sync API.

```python
import os
from anva import Anva, AnvaError
client = Anva(os.environ["ANVA_KEY"])
capabilities = client.capabilities()
session = client.create_session(
    preset_id="YOUR_PRESET_ID", service_mode="byo_llm")
# Attach session["embed_url"] in your browser.
try:
    with client.connect(session["session_id"]) as stream:
        for event in stream:
            if event["type"] == "turn.request":
                turn_id = event["payload"]["turn_id"]
                # Replace the immediate sample with your cancellable LLM worker.
                stream.turn_delta(turn_id, "Hello from your application.")
                stream.turn_done(turn_id)
finally:
    client.end_session(session["session_id"])
```

Use one reader per connection; perform slow LLM work in a separate cancellable
worker so it can react to `turn.cancel`. `send_message` is user input, not
verbatim assistant speech. `AnvaError` includes `status`, `code`, `message`,
and `details`. Realtime command failures remain structured events.

All five service modes are supported as request values, subject to deployment
capabilities. PCM methods accept `bytes`, `bytearray` or byte-oriented `memoryview`:
24kHz signed16 little-endian mono, maximum 24,000 bytes per chunk. Read the
repository README for sample offsets, backpressure and real playback requirements.
