Installation

View as Markdown

Install agentduet 1.0.0 and configure connector credentials. Requires Python 3.12+.

Step 1: Install

pip install agentduet==1.0.0

Or the latest stable release:

pip install agentduet

Import as agentduet. Core installs only websockets, httpx, and abxbus.

Add the provider SDK your bridge uses (for example google-genai, openai-agents, or aws-sdk-bedrock-runtime). Integration tutorials list the exact packages for each model.

Step 2: Verify

python -c "import agentduet; print(agentduet.__version__)"
# expect 1.0.0 (or a newer release)

Step 3: Credentials

Get an API key and connector UUID at agentduet.com, then put them in your environment (or a .env next to your script):

export AGENTDUET_API_KEY=your-connector-api-key
export AGENTDUET_CONNECTOR_UUID=your-connector-uuid

API key (typical)

import os
from agentduet import SessionManagerConfig, CallAudioConfig
config = SessionManagerConfig.create(
api_key=os.getenv("AGENTDUET_API_KEY"),
connector_uuid=os.getenv("AGENTDUET_CONNECTOR_UUID"),
call_audio=CallAudioConfig(sample_rate=16000),
)

mTLS (production)

Use client certificates instead of an API key. Same SessionManager surface afterward.

import asyncio
import logging
import os
from agentduet import (
CallAudioConfig,
CallClosedError,
IncomingCallNotification,
SessionManager,
SessionManagerConfig,
new_session_id,
)
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
async def main() -> None:
config = SessionManagerConfig.create(
cert_path=os.environ["CERT_PATH"], # e.g. /etc/certs/client.pem
key_path=os.environ["KEY_PATH"], # e.g. /etc/certs/client.key
call_audio=CallAudioConfig(sample_rate=16000),
)
async with SessionManager(config) as sm:
logger.info("Connected (mTLS). Waiting for calls...")
@sm.on_incoming_call
async def on_call(noti: IncomingCallNotification):
session = await sm.open_session(new_session_id(), noti.subscriber)
call = await session.process_call(noti)
if not await call.answer():
logger.error("answer failed for %s", call.id)
return
try:
async for chunk in call.caller.audio_stream():
await call.send_audio(chunk)
except CallClosedError:
pass
await sm.run_forever()
if __name__ == "__main__":
asyncio.run(main())

SessionManagerConfig.create(...) accepts either (api_key + connector_uuid) or (cert_path + key_path). There is no separate sandbox helper.

Optional: VoiceAgent adapters

If you want the high-level VoiceAgent runner instead of a manual PCM bridge, install agentduet-adapters for the provider you call (gemini, grok, qwen, nova-sonic), or pip install "agentduet[adapters]" to try all of them.

The adapters package is still a pre-release. Installing it by name needs --pre:

pip install --pre "agentduet-adapters[gemini]"

The agentduet[adapters] extra does not, because its requirement already pins a pre-release version. Prefer the direct agentduet-adapters[...] install for production: [adapters] pulls every provider’s SDK, so a Gemini-only service would also ship AWS and Qwen dependencies.

Integrations in this docs set use the direct SDK bridge.

Notes

  • Pin ==1.0.0 in production until you deliberately upgrade.
  • Match CallAudioConfig.sample_rate to your model (often 24000 for Live / Realtime bridges).

Next Step