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.2.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.2-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sst_voice_agent-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 9d7d39d97015ea6f3747f4460a7759ff6476d194127bcc26b6256e31138228bb
MD5 469252c588590f7e3b0e52993b473a2d
BLAKE2b-256 a5997028702b2d0933f65e5c2a4c3086ccd6ace828b8e659bdf4e64422d44a90

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sst_voice_agent-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 166eed32cd4699b4b103f120e57d11c1779221dc30a80cfab5a6c96f738705ad
MD5 f21bc994727ce5110066fec71e5a0098
BLAKE2b-256 97375b12a235d4a3154ab69a3b120d2eb3a9ad5e6f352e7a1ca727329a15c3d1

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