SpeechStack
Submit a template
← All templatestemplates / two-way-conversational-speech-assistant
Customupdated Jun 7, 2025 · other · support

Two-Way Conversational Speech Assistant

A voice assistant template that enables natural two-way conversations over phone calls using websocket connections to orchestrate real-time audio streaming between callers and AI. Demonstrates interrupt handling and AI preemption capabilities for smooth conversational experiences.

No demo yetView sourceFork template
The numbers
latency
cost / min
frameworkCustom
The stack
telephonyTwilio Voice
speech-to-textOpenAI Whisper
llmGPT-4o
text-to-speechOpenAI TTS-1
System prompt
No prompt published.
Config
config.json
{
  "voice_id": null,
  "temperature": null,
  "barge_in": true,
  "interruption_threshold_ms": null,
  "tools": [],
  "ai_speaks_first": false,
  "interrupt_handling": "input_audio_buffer.speech_started triggers Twilio Media Streams buffer clear and OpenAI conversation.item.truncate"
}
Tags
twilioopenai-realtime-apimedia-streamswebsocketinterrupt-handlingpython
Voice Notes

Voice AI recipes, picks, and analysis.

Get the useful new templates plus the occasional teardown of what’s working in production voice AI.

contributed by @pkamp3 · MIT · source: github discoverylanguages: en-US