Python SDK for DVGateway — real-time voice AI integration
Project description
dvgateway
DVGateway Python SDK — AI 음성 서비스를 실시간 전화 통화에 연결합니다.
설치
# 기본 SDK
pip install dvgateway
# AI 어댑터 포함 (Anthropic, OpenAI)
pip install dvgateway[adapters]
빠른 시작
import asyncio
import os
from dvgateway import DVGatewayClient
from dvgateway.adapters.stt import DeepgramAdapter
from dvgateway.adapters.llm import AnthropicAdapter
from dvgateway.adapters.tts import ElevenLabsAdapter
async def main():
gw = DVGatewayClient(
base_url="http://localhost:8080",
auth={"type": "apiKey", "api_key": os.environ["DV_API_KEY"]},
)
await (
gw.pipeline()
.stt(DeepgramAdapter(api_key=os.environ["DEEPGRAM_API_KEY"], language="ko"))
.llm(AnthropicAdapter(api_key=os.environ["ANTHROPIC_API_KEY"], model="claude-sonnet-4-6"))
.tts(ElevenLabsAdapter(api_key=os.environ["ELEVENLABS_API_KEY"]))
.start()
)
asyncio.run(main())
Comfort Noise — AI 처리 중 Dead Air 방지
게이트웨이에서 GW_COMFORT_NOISE_ENABLED=true를 설정하면,
AI 처리 중 무음 구간에 배경 소음이 자동으로 주입됩니다.
파이프라인 빌더 사용 시 자동 동작 (별도 코드 불필요):
# thinking:start/stop 시그널이 자동 전송됩니다
await (
gw.pipeline()
.stt(DeepgramAdapter(api_key="...", language="ko"))
.llm(AnthropicAdapter(api_key="...", model="claude-sonnet-4-6"))
.tts(ElevenLabsAdapter(api_key="..."))
.start()
)
수동 제어:
# WebSocket 시그널 (저레이턴시)
audio_stream = gw.stream_audio(linked_id)
await audio_stream.send_thinking_start() # 배경 소음 시작
# ... AI 처리 ...
await audio_stream.send_thinking_stop() # 배경 소음 중단
# REST API
await gw.start_thinking(linked_id)
await gw.stop_thinking(linked_id)
요구사항
- Python 3.10+
- aiohttp >= 3.9.0
- websockets >= 12.0
라이선스
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dvgateway-1.2.2.tar.gz
(50.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
dvgateway-1.2.2-py3-none-any.whl
(67.7 kB
view details)
File details
Details for the file dvgateway-1.2.2.tar.gz.
File metadata
- Download URL: dvgateway-1.2.2.tar.gz
- Upload date:
- Size: 50.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02fc1f9e2852e51c902a17c2c8961a899067cae8496fae527451bf093feb2624
|
|
| MD5 |
c7a7841e51de2873b5f8443bf6040a5e
|
|
| BLAKE2b-256 |
5e993a202174b19315d20469f580b419da270f509eefa1444475cd3985ebbf4f
|
File details
Details for the file dvgateway-1.2.2-py3-none-any.whl.
File metadata
- Download URL: dvgateway-1.2.2-py3-none-any.whl
- Upload date:
- Size: 67.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
496ecd924b6da118f76f8a35518ee5ca069519521647a0594a8645a7eaf8ac85
|
|
| MD5 |
9f4a5e9285937d8230b5ee1c183f4dfc
|
|
| BLAKE2b-256 |
5c3690a39376bd0ef8148f3d26685afdf0d60665bf11229b9545c7f47ca0c4bb
|