Quick Start
Minimal programs for inbound voice, WhatsApp reply, and outbound dial using
agentduet 1.0.0.
Prerequisites
- Python 3.12+ and
pip install agentduet==1.0.0 AGENTDUET_API_KEYandAGENTDUET_CONNECTOR_UUIDfrom agentduet.com
Incoming calls and WhatsApp messages arrive at the connector. Register
handlers on SessionManager. Each notification includes addressing
(subscriber, participant). Open a short-lived Session, then act:
- Call →
session.process_call(noti)returns a readyCall - Message →
session.send_message(SendWAMessage(...))sends the reply
session_id is any unique string. Reuse it to continue a conversation; create a
new one with new_session_id() to start fresh.
Step 1: Answer a call (echo)
The following program answers every inbound call and echoes caller audio. Use
it to verify connector and media connectivity before attaching a model.
Step 2: Reply to a WhatsApp message
Register @sm.on_incoming_message on the same SessionManager. Open a session
for msg.subscriber and send. WhatsApp must be configured on the connector.
msg.payload is the raw WhatsApp webhook payload. Inspect it to decide how to
reply. Full channel notes: WhatsApp Messaging.
Step 3: Authentication refresher
API key (dev / most setups):
mTLS:
Full mTLS echo program: Installation - mTLS.
Step 4: Place a call
Outbound audio in is on callee, not caller. Set AGENTDUET_SUBSCRIBER (your connector calling identity) and DESTINATION_NUMBER.
Step 5: Attach a realtime model
Replace the echo loop with a bidirectional bridge to a speech model. Integration tutorials:
On barge-in, call await call.clear_send_audio_buffer(). Do not use private
interrupt helpers.
