livekit-plugins-telnyx for native STT and TTS.
Voice assistant example
This example is based on LiveKit’s agents examples repo, modified to use Telnyx for LLM inference.Set up and activate a virtual env
Install requirements
Download files
This downloads model weights for voice-activity detection:Agent code
The following code uses Telnyx for LLM inference viaopenai.LLM.with_telnyx(), with Telnyx STT and TTS.
Set environment variables
Run the agent worker
Test with a LiveKit frontend
Use the LiveKit Agents Playground to test your agent without building a frontend.Telnyx STT & TTS plugin
Thelivekit-plugins-telnyx package provides native Telnyx STT and TTS plugins for LiveKit agents.
STT
Usetelnyx.STT() for real-time speech-to-text via Telnyx’s WebSocket streaming API:
TTS
Usetelnyx.TTS() for real-time text-to-speech. Pass a voice parameter to select a specific voice: