Skip to main content

Thin client SDK for the Multilingual Voice Agent service

Project description

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

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

Usage

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:).

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

sst_voice_agent-0.2.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

sst_voice_agent-0.2.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file sst_voice_agent-0.2.1.tar.gz.

File metadata

  • Download URL: sst_voice_agent-0.2.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sst_voice_agent-0.2.1.tar.gz
Algorithm Hash digest
SHA256 105aa0c81f3a3adf520cdabf4b507b278b938d608431d69cbed4a4323517bdfe
MD5 0ff18e1f71367076b1702b66dbe88137
BLAKE2b-256 9ef23025a26c36f11a2097c493c85d208e99c8947faf594eadad4bbcc0ffdf07

See more details on using hashes here.

File details

Details for the file sst_voice_agent-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sst_voice_agent-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6e50b2652f434804ef440fa7b260bd822fd31a95b38a8c7d3f8042d0550e16c
MD5 8d6c034550e8eed1d7fab2fe76d80d3b
BLAKE2b-256 e0db147d762a2e61f87570ec41a63f9ed53c367bb63c19cf4a4ce03c26894d4e

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