Created
March 5, 2026 21:18
-
-
Save j0nscalet/cc60efe5d7faac900da4cafd3d4feee5 to your computer and use it in GitHub Desktop.
Telnyx LiveKit Agent Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from livekit.agents import AgentSession, AutoSubscribe, WorkerOptions, cli, llm | |
| from livekit.plugins import openai, telnyx | |
| async def entrypoint(ctx): | |
| await ctx.connect(auto_subscribe=AutoSubscribe.AUDIO_ONLY) | |
| session = AgentSession( | |
| stt=telnyx.STT( | |
| transcription_engine="deepgram", | |
| base_url="wss://api.telnyx.com/v2/speech-to-text/transcription?transcription_model=deepgram/nova-3", | |
| ), | |
| tts=telnyx.TTS(voice="Minimax.speech-02-hd.Wise_Woman"), | |
| llm=openai.LLM.with_telnyx(model="Qwen/Qwen3-235B-A22B"), | |
| ) | |
| await session.start( | |
| room=ctx.room, | |
| agent=llm.ChatContext().append( | |
| role="system", | |
| text="You are a helpful voice assistant powered by Telnyx.", | |
| ), | |
| ) | |
| if __name__ == "__main__": | |
| cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment