Metadata-Version: 2.4
Name: sst-voice-agent
Version: 0.2.2
Summary: Thin client SDK for the Multilingual Voice Agent service
Author-email: Puja / Shri Sai Tech <puja@sstus.net>
License: MIT
Project-URL: Homepage, https://sstus.net
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27

# sst-voice-agent (client SDK)

Thin Python client for the Multilingual Voice Agent service. One dependency
(`httpx`), one object, methods that mirror the API.

## Install

```bash
pip install ./sdk          # from this repo
# or, once published to your internal index:
# pip install sst-voice-agent
```

## Usage

```python
from sst_voice_agent import VoiceAgent

agent = VoiceAgent(base_url="http://localhost:8000", api_key="sk-...")

# Text chat (RAG controlled per call)
print(agent.chat("What is your refund policy?").text)
print(agent.chat("Tell me a joke", use_knowledge_base=False).text)

# STT only
with open("question.wav", "rb") as f:
    result = agent.stt(f.read())
    print(result.text, result.detected_language)

# TTS only
audio = agent.tts("សួស្តី", language="km")          # bytes (WAV)
open("reply.wav", "wb").write(audio)

# Full voice pipeline
with open("question.wav", "rb") as f:
    out = agent.converse(f.read())
print(out.transcript, "->", out.text, f"({out.detected_language})")
if out.audio_bytes:
    open("answer.wav", "wb").write(out.audio_bytes)
```

The client retries idempotent failures, raises `VoiceAgentError` on HTTP
errors, and can be used as a context manager (`with VoiceAgent(...) as a:`).
