├── tests ├── __init__.py ├── .gitignore ├── long.mp3 ├── change-sophie.opus ├── change-sophie.wav ├── Dockerfile.tests ├── long_synthesize_multi_tokens.txt ├── .gitattributes ├── long_synthesize.txt ├── Dockerfile.toxiproxy ├── long_transcript.txt ├── test_aio.py └── Makefile ├── livekit-agents ├── livekit │ └── agents │ │ ├── py.typed │ │ ├── resources │ │ ├── __init__.py │ │ ├── .gitattributes │ │ ├── hold_music.ogg │ │ ├── city-ambience.ogg │ │ ├── crowded-room.ogg │ │ ├── forest-ambience.ogg │ │ ├── keyboard-typing.ogg │ │ ├── keyboard-typing2.ogg │ │ ├── office-ambience.ogg │ │ └── NOTICE │ │ ├── beta │ │ ├── __init__.py │ │ ├── workflows │ │ │ ├── __init__.py │ │ │ └── utils.py │ │ └── tools │ │ │ └── send_dtmf.py │ │ ├── voice │ │ ├── ivr │ │ │ └── __init__.py │ │ ├── recorder_io │ │ │ └── __init__.py │ │ ├── transcription │ │ │ ├── __init__.py │ │ │ └── _utils.py │ │ ├── _utils.py │ │ ├── avatar │ │ │ └── __init__.py │ │ └── room_io │ │ │ └── __init__.py │ │ ├── log.py │ │ ├── llm │ │ └── _provider_format │ │ │ ├── __init__.py │ │ │ └── mistralai.py │ │ ├── ipc │ │ ├── inference_executor.py │ │ ├── __init__.py │ │ └── job_executor.py │ │ ├── inference │ │ ├── __init__.py │ │ └── _utils.py │ │ ├── cli │ │ └── __init__.py │ │ ├── utils │ │ ├── hw │ │ │ └── __init__.py │ │ ├── bounded_dict.py │ │ ├── aio │ │ │ ├── debug.py │ │ │ ├── wait_group.py │ │ │ ├── utils.py │ │ │ ├── __init__.py │ │ │ └── task_set.py │ │ ├── moving_average.py │ │ ├── codecs │ │ │ └── __init__.py │ │ ├── exp_filter.py │ │ ├── images │ │ │ └── __init__.py │ │ ├── misc.py │ │ ├── http_server.py │ │ └── __init__.py │ │ ├── version.py │ │ ├── telemetry │ │ └── __init__.py │ │ ├── tokenize │ │ └── __init__.py │ │ ├── metrics │ │ └── __init__.py │ │ ├── stt │ │ └── __init__.py │ │ ├── tts │ │ └── __init__.py │ │ └── inference_runner.py └── README.md ├── examples ├── .gitignore ├── avatar_agents │ ├── bithuman │ │ ├── requirements.txt │ │ ├── avatar.jpg │ │ └── agent_cloud.py │ ├── hedra │ │ ├── requirements.txt │ │ ├── avatar.jpg │ │ └── agent_worker.py │ ├── audio_wave │ │ ├── requirements.txt │ │ └── README.md │ ├── simli │ │ ├── README.md │ │ └── agent_worker.py │ ├── tavus │ │ ├── README.md │ │ └── agent_worker.py │ ├── anam │ │ └── README.md │ ├── liveavatar │ │ ├── README.md │ │ └── agent_worker.py │ ├── avatartalk │ │ └── README.md │ └── bey │ │ └── agent_worker.py ├── voice_agents │ ├── llamaindex-rag │ │ ├── .gitignore │ │ └── README.md │ ├── requirements.txt │ ├── error_message.ogg │ ├── mcp │ │ └── server.py │ ├── nvidia_test.py │ └── resume_interrupted_agent.py ├── other │ ├── text-to-speech │ │ ├── README.md │ │ └── requirements.txt │ ├── legacy_api.py │ └── transcription │ │ └── README.md ├── .env.example ├── drive-thru │ └── bg_noise.mp3 ├── bank-ivr │ └── __snapshots__ │ │ └── format_transactions.snap ├── minimal_worker.py └── primitives │ └── e2ee.py ├── livekit-plugins ├── livekit-blingfire │ ├── livekit │ │ └── blingfire │ │ │ ├── py.typed │ │ │ └── version.py │ ├── README.md │ ├── test_import.py │ ├── .gitignore │ ├── pyproject.toml │ └── CMakeLists.txt ├── livekit-plugins-browser │ ├── src │ │ ├── helper_main_win.cpp │ │ ├── helper_main_linux.cpp │ │ ├── .gitignore │ │ ├── dummy.cpp │ │ ├── browser_handle.cpp │ │ ├── helper_main_mac.mm │ │ └── resources │ │ │ ├── lkcefapp-Info.plist │ │ │ └── lkcefhelper-Info.plist │ ├── livekit │ │ └── plugins │ │ │ └── browser │ │ │ ├── py.typed │ │ │ ├── resources │ │ │ └── __init__.py │ │ │ ├── log.py │ │ │ └── version.py │ ├── README.md │ ├── pyproject.toml │ ├── .gitignore │ └── .clang-format ├── livekit-plugins-anam │ ├── livekit │ │ └── plugins │ │ │ └── anam │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── errors.py │ │ │ ├── types.py │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-aws │ └── livekit │ │ └── plugins │ │ └── aws │ │ ├── py.typed │ │ ├── log.py │ │ ├── experimental │ │ └── realtime │ │ │ └── __init__.py │ │ ├── version.py │ │ └── models.py ├── livekit-plugins-azure │ ├── livekit │ │ └── plugins │ │ │ └── azure │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-bey │ ├── livekit │ │ └── plugins │ │ │ └── bey │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-clova │ ├── livekit │ │ └── plugins │ │ │ └── clova │ │ │ ├── py.typed │ │ │ ├── constants.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── common.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-fal │ ├── livekit │ │ └── plugins │ │ │ └── fal │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ ├── README.md │ └── pyproject.toml ├── livekit-plugins-groq │ ├── livekit │ │ └── plugins │ │ │ └── groq │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ ├── README.md │ └── pyproject.toml ├── livekit-plugins-hedra │ ├── livekit │ │ └── plugins │ │ │ └── hedra │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-hume │ ├── livekit │ │ └── plugins │ │ │ └── hume │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ ├── README.md │ └── pyproject.toml ├── livekit-plugins-lmnt │ ├── livekit │ │ └── plugins │ │ │ └── lmnt │ │ │ ├── py.typed │ │ │ ├── models.py │ │ │ └── version.py │ ├── README.md │ └── pyproject.toml ├── livekit-plugins-nltk │ ├── livekit │ │ └── plugins │ │ │ └── nltk │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-rime │ ├── livekit │ │ └── plugins │ │ │ └── rime │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── langs.py │ │ │ ├── models.py │ │ │ └── version.py │ ├── README.md │ └── pyproject.toml ├── livekit-plugins-simli │ ├── livekit │ │ └── plugins │ │ │ └── simli │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-tavus │ ├── livekit │ │ └── plugins │ │ │ └── tavus │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-baseten │ ├── livekit │ │ └── plugins │ │ │ └── baseten │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-gladia │ └── livekit │ │ └── plugins │ │ └── gladia │ │ ├── py.typed │ │ ├── log.py │ │ └── version.py ├── livekit-plugins-google │ └── livekit │ │ └── plugins │ │ └── google │ │ ├── py.typed │ │ ├── log.py │ │ ├── realtime │ │ └── __init__.py │ │ ├── tools.py │ │ ├── beta │ │ └── __init__.py │ │ └── version.py ├── livekit-plugins-gradium │ ├── livekit │ │ └── plugins │ │ │ └── gradium │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-inworld │ └── livekit │ │ └── plugins │ │ └── inworld │ │ ├── py.typed │ │ ├── log.py │ │ └── version.py ├── livekit-plugins-minimal │ ├── livekit │ │ └── plugins │ │ │ └── minimal │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-minimax │ ├── livekit │ │ └── plugins │ │ │ └── minimax │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-openai │ ├── livekit │ │ └── plugins │ │ │ └── openai │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── realtime │ │ │ └── __init__.py │ │ │ ├── utils.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-sarvam │ ├── livekit │ │ └── plugins │ │ │ └── sarvam │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-silero │ ├── livekit │ │ └── plugins │ │ │ └── silero │ │ │ ├── py.typed │ │ │ ├── resources │ │ │ ├── .gitattributes │ │ │ ├── __init__.py │ │ │ └── silero_vad.onnx │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-soniox │ ├── livekit │ │ └── plugins │ │ │ └── soniox │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-spitch │ ├── livekit │ │ └── plugins │ │ │ └── spitch │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-anthropic │ ├── livekit │ │ └── plugins │ │ │ └── anthropic │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-assemblyai │ ├── livekit │ │ └── plugins │ │ │ └── assemblyai │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-avatartalk │ ├── livekit │ │ └── plugins │ │ │ └── avatartalk │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-bithuman │ ├── livekit │ │ └── plugins │ │ │ └── bithuman │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-cartesia │ ├── livekit │ │ └── plugins │ │ │ └── cartesia │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── constants.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-deepgram │ ├── livekit │ │ └── plugins │ │ │ └── deepgram │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-elevenlabs │ ├── livekit │ │ └── plugins │ │ │ └── elevenlabs │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-fishaudio │ ├── livekit │ │ └── plugins │ │ │ └── fishaudio │ │ │ ├── py.typed │ │ │ ├── version.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-langchain │ ├── livekit │ │ └── plugins │ │ │ └── langchain │ │ │ ├── py.typed │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-mistralai │ ├── livekit │ │ └── plugins │ │ │ └── mistralai │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-neuphonic │ ├── livekit │ │ └── plugins │ │ │ └── neuphonic │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ └── version.py │ ├── README.md │ └── pyproject.toml ├── livekit-plugins-smallestai │ ├── livekit │ │ └── plugins │ │ │ └── smallestai │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-speechify │ ├── livekit │ │ └── plugins │ │ │ └── speechify │ │ │ ├── py.typed │ │ │ ├── version.py │ │ │ ├── log.py │ │ │ └── models.py │ └── README.md ├── livekit-plugins-ultravox │ └── livekit │ │ └── plugins │ │ └── ultravox │ │ ├── py.typed │ │ ├── log.py │ │ ├── models.py │ │ ├── realtime │ │ └── __init__.py │ │ └── version.py ├── livekit-plugins-upliftai │ ├── livekit │ │ └── plugins │ │ │ └── upliftai │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-fireworksai │ ├── livekit │ │ └── plugins │ │ │ └── fireworksai │ │ │ ├── py.typed │ │ │ ├── log.py │ │ │ └── version.py │ └── README.md ├── livekit-plugins-speechmatics │ └── livekit │ │ └── plugins │ │ └── speechmatics │ │ ├── py.typed │ │ ├── log.py │ │ └── version.py ├── livekit-plugins-turn-detector │ └── livekit │ │ └── plugins │ │ └── turn_detector │ │ ├── py.typed │ │ ├── log.py │ │ ├── models.py │ │ ├── version.py │ │ ├── __init__.py │ │ └── english.py ├── livekit-plugins-resemble │ └── livekit │ │ └── plugins │ │ └── resemble │ │ ├── py.typed │ │ ├── log.py │ │ ├── models.py │ │ └── version.py ├── livekit-plugins-rtzr │ └── livekit │ │ └── plugins │ │ └── rtzr │ │ ├── version.py │ │ ├── log.py │ │ └── __init__.py ├── livekit-plugins-xai │ ├── livekit │ │ └── plugins │ │ │ └── xai │ │ │ ├── log.py │ │ │ ├── realtime │ │ │ ├── types.py │ │ │ └── __init__.py │ │ │ ├── version.py │ │ │ └── __init__.py │ └── README.md ├── livekit-plugins-nvidia │ ├── livekit │ │ └── plugins │ │ │ └── nvidia │ │ │ ├── log.py │ │ │ ├── auth.py │ │ │ └── version.py │ └── README.md └── livekit-plugins-liveavatar │ ├── livekit │ └── plugins │ │ └── liveavatar │ │ ├── log.py │ │ ├── __init__.py │ │ └── version.py │ └── README.md ├── .github ├── banner_dark.png ├── banner_light.png ├── next-release │ └── changeset-9584d6ff.md ├── ISSUE_TEMPLATE │ └── config.yml └── workflows │ └── auto-assign.yml ├── .gitattributes └── NOTICE /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | **/test_vad*.wav -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | google.json 2 | .env -------------------------------------------------------------------------------- /livekit-plugins/livekit-blingfire/livekit/blingfire/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/src/helper_main_win.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/__init__.py: -------------------------------------------------------------------------------- 1 | # ignore 2 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anam/livekit/plugins/anam/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-azure/livekit/plugins/azure/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bey/livekit/plugins/bey/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-clova/livekit/plugins/clova/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fal/livekit/plugins/fal/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-groq/livekit/plugins/groq/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hedra/livekit/plugins/hedra/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hume/livekit/plugins/hume/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-lmnt/livekit/plugins/lmnt/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nltk/livekit/plugins/nltk/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rime/livekit/plugins/rime/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-simli/livekit/plugins/simli/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-tavus/livekit/plugins/tavus/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-baseten/livekit/plugins/baseten/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/livekit/plugins/browser/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-google/livekit/plugins/google/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gradium/livekit/plugins/gradium/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-inworld/livekit/plugins/inworld/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimal/livekit/plugins/minimal/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimax/livekit/plugins/minimax/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-sarvam/livekit/plugins/sarvam/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-soniox/livekit/plugins/soniox/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-spitch/livekit/plugins/spitch/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anthropic/livekit/plugins/anthropic/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-avatartalk/livekit/plugins/avatartalk/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bithuman/livekit/plugins/bithuman/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/src/helper_main_linux.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fishaudio/livekit/plugins/fishaudio/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-langchain/livekit/plugins/langchain/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-mistralai/livekit/plugins/mistralai/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-neuphonic/livekit/plugins/neuphonic/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-smallestai/livekit/plugins/smallestai/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechify/livekit/plugins/speechify/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-upliftai/livekit/plugins/upliftai/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/avatar_agents/bithuman/requirements.txt: -------------------------------------------------------------------------------- 1 | bithuman~=0.5.3 2 | opencv-python -------------------------------------------------------------------------------- /examples/avatar_agents/hedra/requirements.txt: -------------------------------------------------------------------------------- 1 | livekit-agents-hedra 2 | Pillow 3 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-blingfire/README.md: -------------------------------------------------------------------------------- 1 | # BlingFire bindings for LiveKit Agents -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/src/.gitignore: -------------------------------------------------------------------------------- 1 | Debug/ 2 | Release/ 3 | lib* -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fireworksai/livekit/plugins/fireworksai/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/src/dummy.cpp: -------------------------------------------------------------------------------- 1 | int main() { 2 | return 0; 3 | } -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/avatar_agents/audio_wave/requirements.txt: -------------------------------------------------------------------------------- 1 | fastapi 2 | uvicorn 3 | opencv-python 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/py.typed: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.github/banner_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/HEAD/.github/banner_dark.png -------------------------------------------------------------------------------- /.github/banner_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/HEAD/.github/banner_light.png -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rtzr/livekit/plugins/rtzr/version.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.3.8" 2 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/.gitattributes: -------------------------------------------------------------------------------- 1 | *.ogg filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.mp3 filter=lfs diff=lfs merge=lfs -text 2 | *.ogg filter=lfs diff=lfs merge=lfs -text 3 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/beta/__init__.py: -------------------------------------------------------------------------------- 1 | from . import workflows 2 | 3 | __all__ = ["workflows"] 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fishaudio/livekit/plugins/fishaudio/version.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.3.8" 2 | -------------------------------------------------------------------------------- /examples/voice_agents/llamaindex-rag/.gitignore: -------------------------------------------------------------------------------- 1 | chat-engine-storage/ 2 | query-engine-storage/ 3 | retrieval-engine-storage/ -------------------------------------------------------------------------------- /examples/avatar_agents/hedra/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/HEAD/examples/avatar_agents/hedra/avatar.jpg -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/voice/ivr/__init__.py: -------------------------------------------------------------------------------- 1 | from .ivr_activity import IVRActivity 2 | 3 | __all__ = ["IVRActivity"] 4 | -------------------------------------------------------------------------------- /examples/avatar_agents/bithuman/avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/HEAD/examples/avatar_agents/bithuman/avatar.jpg -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anam/README.md: -------------------------------------------------------------------------------- 1 | # livekit-plugins-anam 2 | Support for the [Anam](https://anam.ai/) virtual avatar. 3 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/livekit/plugins/browser/resources/__init__.py: -------------------------------------------------------------------------------- 1 | """Used by importlib.resources and setuptools""" 2 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/resources/.gitattributes: -------------------------------------------------------------------------------- 1 | **/*.onnx filter=lfs diff=lfs merge=lfs -text 2 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/resources/__init__.py: -------------------------------------------------------------------------------- 1 | """Used by importlib.resources and setuptools""" 2 | -------------------------------------------------------------------------------- /examples/other/text-to-speech/README.md: -------------------------------------------------------------------------------- 1 | # Text-to-speech 2 | 3 | This small example shows how you can generate real-time audio data from text. -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anam/livekit/plugins/anam/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.anam") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bey/livekit/plugins/bey/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.bey") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fal/livekit/plugins/fal/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.fal") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-groq/livekit/plugins/groq/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.groq") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hume/livekit/plugins/hume/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.hume") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nltk/livekit/plugins/nltk/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.nltk") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rime/livekit/plugins/rime/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.rime") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rtzr/livekit/plugins/rtzr/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.rtzr") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-xai/livekit/plugins/xai/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.xai") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-azure/livekit/plugins/azure/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.azure") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-clova/livekit/plugins/clova/constants.py: -------------------------------------------------------------------------------- 1 | CLOVA_INPUT_SAMPLE_RATE = 16000 2 | LIVEKIT_INPUT_SAMPLE_RATE = 48000 3 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-clova/livekit/plugins/clova/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.clova") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hedra/livekit/plugins/hedra/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.hedra") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-simli/livekit/plugins/simli/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.simli") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-tavus/livekit/plugins/tavus/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.tavus") 4 | -------------------------------------------------------------------------------- /examples/.env.example: -------------------------------------------------------------------------------- 1 | LIVEKIT_API_SECRET="" 2 | LIVEKIT_API_KEY="" 3 | LIVEKIT_URL="" -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-baseten/livekit/plugins/baseten/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.baseten") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/README.md: -------------------------------------------------------------------------------- 1 | # Browser plugin for LiveKit Agents 2 | 3 | Chromium Embedded Framework (CEF) for LiveKit Agents 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/livekit/plugins/browser/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.browser") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.gladia") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-google/livekit/plugins/google/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.google") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gradium/livekit/plugins/gradium/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.gradium") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-inworld/livekit/plugins/inworld/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.inworld") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimal/livekit/plugins/minimal/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.minimal") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimax/livekit/plugins/minimax/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.minimax") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nvidia/livekit/plugins/nvidia/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.nvidia") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.openai") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.silero") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-soniox/livekit/plugins/soniox/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.soniox") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-spitch/livekit/plugins/spitch/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.spitch") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anthropic/livekit/plugins/anthropic/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.anthropic") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bithuman/livekit/plugins/bithuman/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.bithuman") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.cartesia") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.deepgram") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fishaudio/livekit/plugins/fishaudio/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.fishaudio") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-mistralai/livekit/plugins/mistralai/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.mistralai") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-neuphonic/livekit/plugins/neuphonic/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.neuphonic") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.resemble") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.ultravox") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-upliftai/livekit/plugins/upliftai/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.upliftai") 4 | -------------------------------------------------------------------------------- /tests/long.mp3: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a420326dbf4f37675bf14ae260fff776aee428ced887fc97e0936c36b96589f6 3 | size 559968 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.assemblyai") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-avatartalk/livekit/plugins/avatartalk/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.avatartalk") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.elevenlabs") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-liveavatar/livekit/plugins/liveavatar/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.liveavatar") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rime/livekit/plugins/rime/langs.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSLangs = Literal["eng", "spa", "fra", "ger", "hin"] 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fireworksai/livekit/plugins/fireworksai/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.fireworksai") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-sarvam/livekit/plugins/sarvam/log.py: -------------------------------------------------------------------------------- 1 | # Simple logger for the plugin 2 | import logging 3 | 4 | logger = logging.getLogger(__name__) 5 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.speechmatics") 4 | -------------------------------------------------------------------------------- /tests/change-sophie.opus: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7a2eb5667dc35714b4cb70324d3722f89580885ee5e51be5f2c793e7893d9a24 3 | size 48905 4 | -------------------------------------------------------------------------------- /tests/change-sophie.wav: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:16a978d4be2506cca5e25c5b7aa5b0e53451049d979684d9168c1a81beb4babd 3 | size 570264 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anam/livekit/plugins/anam/errors.py: -------------------------------------------------------------------------------- 1 | class AnamException(Exception): 2 | """Custom exception for Anam API errors.""" 3 | 4 | pass 5 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/models.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class Precision(str, Enum): 5 | PCM_16 = "PCM_16" 6 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.turn_detector") 4 | -------------------------------------------------------------------------------- /examples/drive-thru/bg_noise.mp3: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:09c8c8f934d872b076f86ac0fe9cb429d02eb9a6cb222f7600e0c60b474bf5bc 3 | size 352802 4 | -------------------------------------------------------------------------------- /examples/voice_agents/requirements.txt: -------------------------------------------------------------------------------- 1 | livekit-agents[openai, cartesia, elevenlabs, deepgram, silero, turn-detector, mcp]>=1.0 2 | python-dotenv>=1.0 3 | duckduckgo-search>=8.0 -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | DEV_LEVEL = 23 4 | logging.addLevelName(DEV_LEVEL, "DEV") 5 | 6 | logger = logging.getLogger("livekit.agents") 7 | -------------------------------------------------------------------------------- /.github/next-release/changeset-9584d6ff.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-speechmatics": patch 4 | --- 5 | 6 | Speaker ID using Speechmatics STT (#2625) 7 | -------------------------------------------------------------------------------- /examples/voice_agents/error_message.ogg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:86e2cf797ca02bdb3c0a5da2908dcfd6b67c78faf9bd38f4ec14dbabeaef4aad 3 | size 31864 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-neuphonic/livekit/plugins/neuphonic/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSLangCodes = Literal["en", "nl", "es", "de", "hi", "en-hi", "ar"] 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gradium/livekit/plugins/gradium/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSEncoding = Literal["pcm_s16le",] 4 | STTEncoding = Literal["pcm_s16le",] 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: LiveKit Slack Community 4 | url: https://livekit.io/join-Slack 5 | about: Ask and answer questions -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/llm/_provider_format/__init__.py: -------------------------------------------------------------------------------- 1 | from . import anthropic, aws, google, mistralai, openai 2 | 3 | __all__ = ["openai", "google", "aws", "anthropic", "mistralai"] 4 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/hold_music.ogg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cfb2a77542ac01011f41593a5fe9b919ee898343bcc66d72499b77b2640def28 3 | size 702469 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-smallestai/livekit/plugins/smallestai/log.py: -------------------------------------------------------------------------------- 1 | # Simple logger for the plugin 2 | import logging 3 | 4 | logger = logging.getLogger("livekit.plugins.smallestai") 5 | -------------------------------------------------------------------------------- /examples/bank-ivr/__snapshots__/format_transactions.snap: -------------------------------------------------------------------------------- 1 | 2025-10-08 — PAYROLL DEP - HORIZON TECH ($3,250.00) 2 | 2025-10-05 — ZELLE TO ALEX R ($-120.45) 3 | 2025-10-04 — COFFEE ROASTERS ($-5.85) 4 | 5 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/city-ambience.ogg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:520910965ef316130ac7240d86fd985613769c85a22d629f3d9d316accb4623f 3 | size 393503 4 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/crowded-room.ogg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4a3c8c476f176b59cbcfedc212e65b4c8b0cb9b1b7555fcf09c4e7fadf8e867f 3 | size 318878 4 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/forest-ambience.ogg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6692987291acdec983db399e08d5a4dd55627bbdf1ac59b86e8988999facee5d 3 | size 399708 4 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/keyboard-typing.ogg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:56258677554c75019be52f8a16e8494ee5bccfb74c01f490b5a1befd48cbbeae 3 | size 73576 4 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/keyboard-typing2.ogg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1b8244f26ae315561aefdbb09387bf16388c3380d74c2e1f0008be0998169954 3 | size 28046 4 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/office-ambience.ogg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:967a445f505e202d3ec03968cff71846284c3b70d4353b3096ce9121d34224c3 3 | size 190410 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-blingfire/test_import.py: -------------------------------------------------------------------------------- 1 | """Simple import test for cibuildwheel""" 2 | 3 | from livekit import blingfire 4 | 5 | print("Successfully imported livekit.blingfire", blingfire) 6 | -------------------------------------------------------------------------------- /tests/Dockerfile.tests: -------------------------------------------------------------------------------- 1 | FROM python:3.9-slim 2 | 3 | ENV PYTHONUNBUFFERED=1 4 | 5 | RUN apt-get update && apt-get install -y curl strace procps 6 | 7 | RUN pip install --no-cache-dir uv 8 | 9 | WORKDIR /app -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fishaudio/livekit/plugins/fishaudio/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | OutputFormat = Literal["wav", "pcm", "mp3"] 4 | 5 | LatencyMode = Literal["normal", "balanced"] 6 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/voice/recorder_io/__init__.py: -------------------------------------------------------------------------------- 1 | from .recorder_io import RecorderAudioInput, RecorderAudioOutput, RecorderIO 2 | 3 | __all__ = ["RecorderIO", "RecorderAudioInput", "RecorderAudioOutput"] 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-xai/livekit/plugins/xai/realtime/types.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | GrokVoices = Literal[ 4 | "Ara", 5 | "Eve", 6 | "Leo", 7 | "Rex", 8 | "Sal", 9 | ] 10 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/NOTICE: -------------------------------------------------------------------------------- 1 | keyboard-typing.ogg by Anton -- https://freesound.org/s/137/ -- License: Attribution 4.0 2 | keyboard-typing2.opg by Anton -- https://freesound.org/s/137/ -- License: Attribution 4.0 3 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/resources/silero_vad.onnx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:597d30b3ec076608d059477bb14cfeffdf951bf5cae370d38f65d33bbfe82004 3 | size 2327524 4 | -------------------------------------------------------------------------------- /examples/other/text-to-speech/requirements.txt: -------------------------------------------------------------------------------- 1 | livekit-agents>=0.12.18 2 | livekit-plugins-openai>=0.12.2 3 | livekit-plugins-cartesia>=0.4.11 4 | livekit-plugins-elevenlabs>=0.8.1 5 | livekit-plugins-speechify>=0.1.0 6 | python-dotenv~=1.0 7 | -------------------------------------------------------------------------------- /tests/long_synthesize_multi_tokens.txt: -------------------------------------------------------------------------------- 1 | Multi 2 | counterproductive, reestablishing, misunderstanding, nontraditional, unbelievable, self-awareness, interconnectivity, recontextualizing, oversimplification, decentralization, hyperactive, underrepresented -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anam/livekit/plugins/anam/types.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | 3 | 4 | @dataclass 5 | class PersonaConfig: 6 | """Configuration for Anam avatar persona""" 7 | 8 | name: str 9 | avatarId: str 10 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/ipc/inference_executor.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import Protocol 4 | 5 | 6 | class InferenceExecutor(Protocol): 7 | async def do_inference(self, method: str, data: bytes) -> bytes | None: ... 8 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bithuman/README.md: -------------------------------------------------------------------------------- 1 | # BitHuman plugin for LiveKit Agents 2 | 3 | Support for avatars with [bitHuman](https://www.bithuman.ai/)'s local runtime SDK. 4 | 5 | See https://docs.livekit.io/agents/integrations/avatar/bithuman/ for more information. 6 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-xai/README.md: -------------------------------------------------------------------------------- 1 | # xAI plugin for LiveKit Agents 2 | 3 | Support for the [xAI](https://x.ai/) realtime model. 4 | 5 | See [https://docs.livekit.io/agents/integrations/xai/](https://docs.livekit.io/agents/integrations/xai/) for more information. 6 | 7 | -------------------------------------------------------------------------------- /tests/.gitattributes: -------------------------------------------------------------------------------- 1 | long.mp3 filter=lfs diff=lfs merge=lfs -text 2 | change-sophie.wav filter=lfs diff=lfs merge=lfs -text 3 | change-sophie.opus filter=lfs diff=lfs merge=lfs -text 4 | hearts.rgba filter=lfs diff=lfs merge=lfs -text 5 | hearts.jpg filter=lfs diff=lfs merge=lfs -text 6 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nltk/README.md: -------------------------------------------------------------------------------- 1 | # NLTK plugin for LiveKit Agents 2 | 3 | Support for [NLTK](https://www.nltk.org/)-based text processing. Currently featuring a `SentenceTokenizer`. 4 | 5 | ## Installation 6 | 7 | ```bash 8 | pip install livekit-plugins-nltk 9 | ``` 10 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-google/livekit/plugins/google/realtime/__init__.py: -------------------------------------------------------------------------------- 1 | from .api_proto import ClientEvents, LiveAPIModels, Voice 2 | from .realtime_api import RealtimeModel 3 | 4 | __all__ = [ 5 | "RealtimeModel", 6 | "ClientEvents", 7 | "LiveAPIModels", 8 | "Voice", 9 | ] 10 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-simli/README.md: -------------------------------------------------------------------------------- 1 | # Simli Avatar plugin for LiveKit Agents 2 | 3 | Support for the [Simi](https://simli.com/) virtual avatar. 4 | 5 | See [https://docs.livekit.io/agents/integrations/avatar/simli/](https://docs.livekit.io/agents/integrations/avatar/simli/) for more information. 6 | 7 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-tavus/README.md: -------------------------------------------------------------------------------- 1 | # Tavus virtual avatar plugin for LiveKit Agents 2 | 3 | Support for the [Tavus](https://tavus.io/) virtual avatar. 4 | 5 | See [https://docs.livekit.io/agents/integrations/avatar/tavus/](https://docs.livekit.io/agents/integrations/avatar/tavus/) for more information. 6 | 7 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61.0"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [tool.cibuildwheel.macos] 6 | repair-wheel-command = "" # getting issues with unresolved files 7 | 8 | [tool.cibuildwheel] 9 | before-build = "pip install pybind11[global]" -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-smallestai/livekit/plugins/smallestai/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSModels = Literal[ 4 | "lightning", 5 | "lightning-large", 6 | "lightning-v2", 7 | ] 8 | 9 | TTSEncoding = Literal[ 10 | "pcm", 11 | "mp3", 12 | "wav", 13 | "mulaw", 14 | ] 15 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/inference/__init__.py: -------------------------------------------------------------------------------- 1 | from .llm import LLM, LLMModels, LLMStream 2 | from .stt import STT, STTModels 3 | from .tts import TTS, TTSModels 4 | 5 | __all__ = [ 6 | "STT", 7 | "TTS", 8 | "LLM", 9 | "LLMStream", 10 | "STTModels", 11 | "TTSModels", 12 | "LLMModels", 13 | ] 14 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/cli/__init__.py: -------------------------------------------------------------------------------- 1 | from .cli import AgentsConsole, run_app 2 | 3 | __all__ = ["run_app", "AgentsConsole"] 4 | 5 | # Cleanup docs of unexported modules 6 | _module = dir() 7 | NOT_IN_ALL = [m for m in _module if m not in __all__] 8 | 9 | __pdoc__ = {} 10 | 11 | for n in NOT_IN_ALL: 12 | __pdoc__[n] = False 13 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-avatartalk/README.md: -------------------------------------------------------------------------------- 1 | # AvatarTalk virtual avatar plugin for LiveKit Agents 2 | 3 | Support for the [AvatarTalk](https://avatartalk.ai/) virtual avatar. 4 | 5 | See [https://docs.livekit.io/agents/integrations/avatar/avatartalk/](https://docs.livekit.io/agents/integrations/avatar/avatartalk/) for more information. 6 | 7 | -------------------------------------------------------------------------------- /examples/voice_agents/mcp/server.py: -------------------------------------------------------------------------------- 1 | from mcp.server.fastmcp import FastMCP 2 | 3 | mcp = FastMCP("Demo 🚀") 4 | 5 | 6 | @mcp.tool() 7 | def get_weather(location: str) -> str: 8 | return f"The weather in {location} is a perfect sunny 70°F today. Enjoy your day!" 9 | 10 | 11 | if __name__ == "__main__": 12 | mcp.run(transport="sse") 13 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-liveavatar/README.md: -------------------------------------------------------------------------------- 1 | # HeyGen virtual avatar plugin for LiveKit Agents 2 | 3 | Support for the [Heygen LiveAvatar](https://www.liveavatar.com/) virtual avatar. 4 | 5 | See [https://docs.livekit.io/agents/integrations/avatar/liveavatar/](https://docs.livekit.io/agents/integrations/avatar/liveavatar/) for more information. 6 | 7 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rime/livekit/plugins/rime/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSModels = Literal["mistv2", "arcana"] 4 | 5 | # https://docs.rime.ai/api-reference/voices 6 | ArcanaVoices = Literal[ 7 | "luna", "celeste", "orion", "ursa", "astra", "esther", "estelle", "andromeda" 8 | ] 9 | 10 | DefaultMistv2Voice = "cove" 11 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-blingfire/.gitignore: -------------------------------------------------------------------------------- 1 | CMakeLists.txt.user 2 | CMakeCache.txt 3 | CMakeFiles 4 | CMakeScripts 5 | Testing 6 | Makefile 7 | cmake_install.cmake 8 | install_manifest.txt 9 | compile_commands.json 10 | CTestTestfile.cmake 11 | _deps 12 | /build 13 | /third_party/cef/ 14 | /src/Release 15 | /src/*.plist 16 | /*.plist 17 | /libcef_dll_wrapper 18 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | EOUModelType = Literal["en", "multilingual"] 4 | MODEL_REVISIONS: dict[EOUModelType, str] = { 5 | "en": "v1.2.2-en", 6 | "multilingual": "v0.4.1-intl", 7 | } 8 | HG_MODEL = "livekit/turn-detector" 9 | ONNX_FILENAME = "model_q8.onnx" 10 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.aws") 4 | smithy_logger = logging.getLogger("smithy_aws_event_stream.aio") 5 | smithy_logger.setLevel(logging.INFO) 6 | bedrock_client_logger = logging.getLogger("aws_sdk_bedrock_runtime.client") 7 | bedrock_client_logger.setLevel(logging.INFO) 8 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/.gitignore: -------------------------------------------------------------------------------- 1 | CMakeLists.txt.user 2 | CMakeCache.txt 3 | CMakeFiles 4 | CMakeScripts 5 | Testing 6 | Makefile 7 | cmake_install.cmake 8 | install_manifest.txt 9 | compile_commands.json 10 | CTestTestfile.cmake 11 | _deps 12 | /build 13 | /third_party/cef/ 14 | /src/Release 15 | /src/*.plist 16 | /*.plist 17 | /libcef_dll_wrapper 18 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-google/livekit/plugins/google/tools.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from google.genai.types import ( 4 | GoogleMaps, 5 | GoogleSearch, 6 | GoogleSearchRetrieval, 7 | ToolCodeExecution, 8 | UrlContext, 9 | ) 10 | 11 | _LLMTool = Union[GoogleSearchRetrieval, ToolCodeExecution, GoogleSearch, UrlContext, GoogleMaps] 12 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-liveavatar/livekit/plugins/liveavatar/__init__.py: -------------------------------------------------------------------------------- 1 | """LiveAvatar avatar plugin for LiveKit Agents 2 | 3 | Provides LiveAvatar interactive avatar integration similar to Tavus. 4 | """ 5 | 6 | from .api import LiveAvatarException 7 | from .avatar import AvatarSession 8 | 9 | __all__ = [ 10 | "LiveAvatarException", 11 | "AvatarSession", 12 | ] 13 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | UltravoxModel = Literal[ 4 | "fixie-ai/ultravox", 5 | "fixie-ai/ultravox-gemma3-27b-preview", 6 | "fixie-ai/ultravox-llama3.3-70b", 7 | "fixie-ai/ultravox-qwen3-32b-preview", 8 | ] 9 | UltravoxVoice = Literal[ 10 | "Mark", 11 | "Jessica", 12 | ] 13 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/src/browser_handle.cpp: -------------------------------------------------------------------------------- 1 | #include "browser_handle.hpp" 2 | 3 | void BrowserHandle::SetSize(int width, int height) { 4 | width_ = width; 5 | height_ = height; 6 | 7 | if (browser_) 8 | browser_->GetHost()->WasResized(); 9 | } 10 | 11 | 12 | void BrowserHandle::Close() { 13 | if (browser_) 14 | browser_->GetHost()->CloseBrowser(true); 15 | } 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/__init__.py: -------------------------------------------------------------------------------- 1 | from .. import realtime 2 | from .gemini_tts import TTS as GeminiTTS 3 | 4 | __all__ = ["GeminiTTS", "realtime"] 5 | 6 | # Cleanup docs of unexported modules 7 | _module = dir() 8 | NOT_IN_ALL = [m for m in _module if m not in __all__] 9 | 10 | __pdoc__ = {} 11 | 12 | for n in NOT_IN_ALL: 13 | __pdoc__[n] = False 14 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realtime/__init__.py: -------------------------------------------------------------------------------- 1 | from .realtime_model import RealtimeModel, RealtimeSession 2 | from .types import MODALITIES, REALTIME_MODELS, SONIC1_VOICES, SONIC2_VOICES 3 | 4 | __all__ = [ 5 | "RealtimeSession", 6 | "RealtimeModel", 7 | "MODALITIES", 8 | "REALTIME_MODELS", 9 | "SONIC1_VOICES", 10 | "SONIC2_VOICES", 11 | ] 12 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fireworksai/README.md: -------------------------------------------------------------------------------- 1 | # Fireworks AI plugin for LiveKit Agents 2 | 3 | Support for speech-to-text api with [Fireworks AI](https://fireworks.ai/). 4 | 5 | ## Installation 6 | 7 | ```bash 8 | pip install livekit-plugins-fireworksai 9 | ``` 10 | 11 | ## Pre-requisites 12 | 13 | You'll need an API key from Fireworks AI. It can be set as an environment variable: `FIREWORKS_API_KEY` 14 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-blingfire/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61.0", "pybind11"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [tool.cibuildwheel.macos] 6 | repair-wheel-command = "" # getting issues with unresolved files 7 | 8 | [tool.cibuildwheel] 9 | before-build = "pip install pybind11[global]" 10 | skip = "*-musllinux_*" 11 | test-command = "python {project}/test_import.py" 12 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/src/helper_main_mac.mm: -------------------------------------------------------------------------------- 1 | #include "include/cef_app.h" 2 | #include "include/wrapper/cef_library_loader.h" 3 | 4 | int main(int argc, char* argv[]) { 5 | CefScopedLibraryLoader library_loader; 6 | if (!library_loader.LoadInHelper()) { 7 | return 1; 8 | } 9 | 10 | CefMainArgs main_args(argc, argv); 11 | return CefExecuteProcess(main_args, nullptr, nullptr); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-xai/livekit/plugins/xai/realtime/__init__.py: -------------------------------------------------------------------------------- 1 | from openai.types.beta.realtime.session import TurnDetection 2 | 3 | from livekit.plugins.openai.realtime import RealtimeSession 4 | 5 | from .realtime_model import RealtimeModel 6 | from .types import GrokVoices 7 | 8 | __all__ = [ 9 | "GrokVoices", 10 | "RealtimeModel", 11 | "RealtimeSession", 12 | "TurnDetection", 13 | ] 14 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-baseten/livekit/plugins/baseten/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | LLMModels = Literal[ 4 | "deepseek-ai/DeepSeek-R1", 5 | "deepseek-ai/DeepSeek-V3-0324", 6 | "meta-llama/Llama-4-Scout-17B-16E-Instruct", 7 | "meta-llama/Llama-4-Maverick-17B-128E-Instruct", 8 | "moonshotai/Kimi-K2-Instruct", 9 | "openai/gpt-oss-120b", 10 | "Qwen/Qwen3-235B-A22B-Instruct-2507", 11 | ] 12 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-silero/README.md: -------------------------------------------------------------------------------- 1 | # Silero VAD plugin for LiveKit Agents 2 | 3 | Support for VAD-based turn detection. 4 | 5 | See [https://docs.livekit.io/agents/build/turns/vad/](https://docs.livekit.io/agents/build/turns/vad/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-silero 11 | ``` 12 | 13 | This plugin contains model files that would need to be downloaded prior to use. 14 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/voice/transcription/__init__.py: -------------------------------------------------------------------------------- 1 | from ._utils import find_micro_track_id 2 | from .synchronizer import TranscriptSynchronizer 3 | 4 | __all__ = [ 5 | "TranscriptSynchronizer", 6 | "find_micro_track_id", 7 | ] 8 | 9 | # Cleanup docs of unexported modules 10 | _module = dir() 11 | NOT_IN_ALL = [m for m in _module if m not in __all__] 12 | 13 | __pdoc__ = {} 14 | 15 | for n in NOT_IN_ALL: 16 | __pdoc__[n] = False 17 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-smallestai/README.md: -------------------------------------------------------------------------------- 1 | # LiveKit Plugins Smallest AI 2 | 3 | LiveKit Agent Framework plugin for speech synthesis with the [Smallest AI](https://smallest.ai/) API ([documentation](https://waves-docs.smallest.ai/)). 4 | 5 | ## Installation 6 | 7 | ```bash 8 | pip install livekit-plugins-smallestai 9 | ``` 10 | 11 | ## Pre-requisites 12 | 13 | You'll need an API key from Smallest AI. It can be set as an environment variable: `SMALLEST_API_KEY` -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/hw/__init__.py: -------------------------------------------------------------------------------- 1 | from .cpu import CGroupV2CPUMonitor, CPUMonitor, DefaultCPUMonitor, get_cpu_monitor 2 | 3 | __all__ = [ 4 | "get_cpu_monitor", 5 | "CPUMonitor", 6 | "CGroupV2CPUMonitor", 7 | "DefaultCPUMonitor", 8 | ] 9 | 10 | # Cleanup docs of unexported modules 11 | _module = dir() 12 | NOT_IN_ALL = [m for m in _module if m not in __all__] 13 | 14 | __pdoc__ = {} 15 | 16 | for n in NOT_IN_ALL: 17 | __pdoc__[n] = False 18 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/constants.py: -------------------------------------------------------------------------------- 1 | from .version import __version__ 2 | 3 | API_AUTH_HEADER = "X-API-Key" 4 | API_VERSION_HEADER = "Cartesia-Version" 5 | API_VERSION = "2025-04-16" 6 | API_VERSION_WITH_EMBEDDINGS_AND_EXPERIMENTAL_CONTROLS = "2024-11-13" 7 | MODEL_ID_WITH_EMBEDDINGS_AND_EXPERIMENTAL_CONTROLS = "sonic-2-2025-03-07" 8 | USER_AGENT = f"LiveKit Agents Cartesia Plugin/{__version__}" 9 | REQUEST_ID_HEADER = "X-Request-Id" 10 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fal/README.md: -------------------------------------------------------------------------------- 1 | # fal plugin for LiveKit Agents 2 | 3 | Support for speech-to-text with [fal.ai](https://fal.ai/). 4 | 5 | See [https://docs.livekit.io/agents/integrations/stt/fal/](https://docs.livekit.io/agents/integrations/stt/fal/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-fal 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from fal. It can be set as an environment variable: `FAL_KEY` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimax/README.md: -------------------------------------------------------------------------------- 1 | # MiniMax TTS plugin for LiveKit Agents 2 | 3 | Support for [MiniMax](https://www.minimaxi.com/)'s voice AI services in LiveKit Agents. 4 | 5 | More information is available in the docs for the [TTS]() integrations. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-minimax-ai 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from MiniMax. It can be set as an environment variable: `MINIMAX_API_KEY` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-clova/livekit/plugins/clova/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | ClovaSttLanguages = Literal["ko-KR", "en-US", "enko", "ja", "zh-cn", "zh-tw"] 4 | 5 | ClovaSpeechAPIType = Literal["recognizer/object-storage", "recognizer/url", "recognizer/upload"] 6 | 7 | clova_languages_mapping = { 8 | "en": "en-US", 9 | "ko-KR": "ko-KR", 10 | "en-US": "en-US", 11 | "enko": "enko", 12 | "ja": "ja", 13 | "zh-cn": "zh-cn", 14 | "zh-tw": "zh-tw", 15 | } 16 | -------------------------------------------------------------------------------- /tests/long_synthesize.txt: -------------------------------------------------------------------------------- 1 | The people who are crazy enough to think they can change the world are the ones who do. 2 | The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. 3 | Never doubt that a small group of thoughtful, committed citizens can change the world; indeed, it's the only thing that ever has. 4 | Do not go where the path may lead, go instead where there is no path and leave a trail. 5 | 6 | -------------------------------------------------------------------------------- /examples/other/legacy_api.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from dotenv import load_dotenv 4 | 5 | from livekit.agents import JobContext, WorkerOptions, cli 6 | 7 | logger = logging.getLogger("minimal-worker") 8 | logger.setLevel(logging.INFO) 9 | 10 | load_dotenv() 11 | 12 | 13 | async def entrypoint(ctx: JobContext): 14 | await ctx.connect() 15 | logger.info(f"connected to the room {ctx.room.name}") 16 | 17 | 18 | if __name__ == "__main__": 19 | cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint)) 20 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rime/README.md: -------------------------------------------------------------------------------- 1 | # Rime plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with the [Rime](https://rime.ai/) API. 4 | 5 | See [https://docs.livekit.io/agents/integrations/tts/rime/](https://docs.livekit.io/agents/integrations/tts/rime/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-rime 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from Rime. It can be set as an environment variable: `RIME_API_KEY` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimal/README.md: -------------------------------------------------------------------------------- 1 | # Minimal example plugin for LiveKit Agents 2 | 3 | This is a minimal example of a LiveKit plugin for Agents. 4 | 5 | ### Developer note 6 | 7 | When copying this directory over to create a new `livekit-plugins` package, make sure it's nested within the `livekit-plugins` folder and that the `"name"` field in `package.json` follows the proper naming convention for CI: 8 | 9 | ```json 10 | { 11 | "name": "livekit-plugins-", 12 | "private": true 13 | } 14 | ``` 15 | -------------------------------------------------------------------------------- /tests/Dockerfile.toxiproxy: -------------------------------------------------------------------------------- 1 | FROM golang:1.23-alpine AS builder 2 | 3 | RUN apk add --no-cache git make 4 | 5 | WORKDIR /build 6 | 7 | RUN git clone https://github.com/Shopify/toxiproxy.git . 8 | 9 | RUN make build 10 | 11 | RUN ls -al dist 12 | 13 | FROM alpine:3.18 14 | 15 | RUN apk add --no-cache ca-certificates 16 | RUN apk add --no-cache curl 17 | 18 | COPY --from=builder /build/dist/toxiproxy-server /usr/local/bin/toxiproxy-server 19 | COPY --from=builder /build/dist/toxiproxy-cli /usr/local/bin/toxiproxy-cli 20 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hedra/README.md: -------------------------------------------------------------------------------- 1 | # Hedra plugin for LiveKit Agents 2 | 3 | Support for avatar generation and animation with [Hedra](https://hedra.ai/). 4 | 5 | See [https://docs.livekit.io/agents/integrations/avatar/hedra/](https://docs.livekit.io/agents/integrations/avatar/hedra/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-hedra 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from Hedra. It can be set as an environment variable: `HEDRA_API_KEY` -------------------------------------------------------------------------------- /examples/minimal_worker.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from dotenv import load_dotenv 4 | 5 | from livekit.agents import AgentServer, JobContext, cli 6 | 7 | logger = logging.getLogger("minimal-worker") 8 | logger.setLevel(logging.INFO) 9 | 10 | load_dotenv() 11 | 12 | server = AgentServer() 13 | 14 | 15 | @server.rtc_session() 16 | async def entrypoint(ctx: JobContext): 17 | await ctx.connect() 18 | logger.info(f"connected to the room {ctx.room.name}") 19 | 20 | 21 | if __name__ == "__main__": 22 | cli.run_app(server) 23 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anthropic/README.md: -------------------------------------------------------------------------------- 1 | # Anthropic plugin for LiveKit Agents 2 | 3 | Support for the Claude family of LLMs from Anthropic. 4 | 5 | See [https://docs.livekit.io/agents/integrations/llm/anthropic/](https://docs.livekit.io/agents/integrations/llm/anthropic/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-anthropic 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from Anthropic. It can be set as an environment variable: `ANTHROPIC_API_KEY` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-clova/README.md: -------------------------------------------------------------------------------- 1 | # Clova plugin for LiveKit Agents 2 | 3 | Support for speech-to-text with [Clova](https://api.ncloud-docs.com/docs/). 4 | 5 | See https://docs.livekit.io/agents/integrations/stt/clova/ for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-clova 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You need invoke url and secret key from Naver cloud platform -> Clova Speech and set as environment variables: `CLOVA_STT_INVOKE_URL` & `CLOVA_STT_SECRET_KEY` 16 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/inference/_utils.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import datetime 4 | 5 | from livekit import api 6 | 7 | 8 | def create_access_token(api_key: str | None, api_secret: str | None, ttl: float = 600) -> str: 9 | grant = api.access_token.InferenceGrants(perform=True) 10 | return ( 11 | api.AccessToken(api_key, api_secret) 12 | .with_identity("agent") 13 | .with_inference_grants(grant) 14 | .with_ttl(datetime.timedelta(seconds=ttl)) 15 | .to_jwt() 16 | ) 17 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-assemblyai/README.md: -------------------------------------------------------------------------------- 1 | # AssemblyAI plugin for LiveKit Agents 2 | 3 | Support for Streaming Speech-to-Text from AssemblyAI. 4 | 5 | See [https://docs.livekit.io/agents/integrations/stt/assemblyai/](https://docs.livekit.io/agents/integrations/stt/assemblyai/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-assemblyai 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need to specify an AssemblyAI API Key. It can be set as environment variable: `ASSEMBLYAI_API_KEY`. 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-clova/livekit/plugins/clova/common.py: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | from pydub import AudioSegment # type: ignore[import-untyped] 4 | 5 | 6 | def resample_audio(audio_bytes: bytes, original_sample_rate: int, target_sample_rate: int) -> bytes: 7 | resampled_audio = AudioSegment.from_raw( 8 | io.BytesIO(audio_bytes), 9 | sample_width=2, 10 | frame_rate=original_sample_rate, 11 | channels=1, 12 | ).set_frame_rate(target_sample_rate) 13 | return resampled_audio.raw_data # type: ignore 14 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-elevenlabs/README.md: -------------------------------------------------------------------------------- 1 | # ElevenLabs plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with [ElevenLabs](https://elevenlabs.io/). 4 | 5 | See [https://docs.livekit.io/agents/integrations/tts/elevenlabs/](https://docs.livekit.io/agents/integrations/tts/elevenlabs/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-elevenlabs 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from ElevenLabs. It can be set as an environment variable: `ELEVEN_API_KEY` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hume/README.md: -------------------------------------------------------------------------------- 1 | # Hume AI TTS plugin for LiveKit Agents 2 | 3 | Support for text-to-speech with [Hume](https://www.hume.ai/). 4 | 5 | See [https://docs.livekit.io/agents/integrations/tts/hume/](https://docs.livekit.io/agents/integrations/tts/hume/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-hume 11 | ``` 12 | 13 | You will need an API Key from Hume, it can be set as an environment variable: `HUME_API_KEY`. You can get it from [here](https://platform.hume.ai/settings/keys) 14 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-lmnt/README.md: -------------------------------------------------------------------------------- 1 | # LMNT plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with [LMNT](https://lmnt.com/) in LiveKit Agents. 4 | 5 | See the [LMNT TTS docs](https://docs.livekit.io/agents/integrations/tts/lmnt/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-lmnt 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from LMNT. It can be set as an environment variable: `LMNT_API_KEY`. You can get it from [here](https://app.lmnt.com/account#api-keys) 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-neuphonic/README.md: -------------------------------------------------------------------------------- 1 | # Neuphonic plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with [Neuphonic](https://neuphonic.com). 4 | 5 | See [https://docs.livekit.io/agents/integrations/tts/neuphonic/](https://docs.livekit.io/agents/integrations/tts/neuphonic/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-neuphonic 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from Neuphonic. It can be set as an environment variable: `NEUPHONIC_API_TOKEN` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-mistralai/README.md: -------------------------------------------------------------------------------- 1 | # MistralAI Plugin for LiveKit Agents 2 | 3 | Support for MistralAI LLM, ChatModels 4 | 5 | See [https://docs.livekit.io/agents/integrations/mistral/](https://docs.livekit.io/agents/integrations/mistral/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-mistral 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from MistralAI. It can be set as an environment variable: 16 | 17 | ```bash 18 | export MISTRAL_API_KEY=your_api_key_here 19 | ``` 20 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/__init__.py: -------------------------------------------------------------------------------- 1 | from .realtime_model import RealtimeModel, RealtimeSession 2 | from .realtime_model_beta import RealtimeModelBeta, RealtimeSessionBeta 3 | 4 | __all__ = [ 5 | "RealtimeSession", 6 | "RealtimeModel", 7 | "RealtimeModelBeta", 8 | "RealtimeSessionBeta", 9 | ] 10 | 11 | # Cleanup docs of unexported modules 12 | _module = dir() 13 | NOT_IN_ALL = [m for m in _module if m not in __all__] 14 | 15 | __pdoc__ = {} 16 | 17 | for n in NOT_IN_ALL: 18 | __pdoc__[n] = False 19 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechify/README.md: -------------------------------------------------------------------------------- 1 | # Speechify TTS plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with the [Speechify](https://www.speechify.ai/) API. 4 | 5 | See [https://docs.livekit.io/agents/integrations/tts/speechify/](https://docs.livekit.io/agents/integrations/tts/speechify/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-speechify 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from Speechify. It can be set as an environment variable: `SPEECHIFY_API_KEY` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-groq/README.md: -------------------------------------------------------------------------------- 1 | # Groq plugin for LiveKit Agents 2 | 3 | Support for STT, TTS, and LLM with [Groq](https://www.groq.com/) fast inference. 4 | 5 | See [https://docs.livekit.io/agents/integrations/groq/](https://docs.livekit.io/agents/integrations/groq/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-groq 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | For credentials, you'll need a Groq Cloud account and obtain the correct credentials. Credentials can be passed directly or via GROQ_API_KEY environment variable 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-lmnt/livekit/plugins/lmnt/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | LMNTAudioFormats = Literal["aac", "mp3", "mulaw", "raw", "wav"] 4 | LMNTLanguages = Literal[ 5 | "auto", 6 | "de", 7 | "en", 8 | "es", 9 | "fr", 10 | "hi", 11 | "id", 12 | "it", 13 | "ja", 14 | "ko", 15 | "nl", 16 | "pl", 17 | "pt", 18 | "ru", 19 | "sv", 20 | "th", 21 | "tr", 22 | "uk", 23 | "vi", 24 | "zh", 25 | ] 26 | LMNTModels = Literal["blizzard", "aurora"] 27 | LMNTSampleRate = Literal[8000, 16000, 24000] 28 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anthropic/livekit/plugins/anthropic/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | # https://docs.anthropic.com/en/docs/about-claude/model-deprecations#model-status 4 | 5 | ChatModels = Literal[ 6 | "claude-3-5-sonnet-20240620", # deprecated 7 | "claude-3-opus-20240229", # deprecated 8 | "claude-3-5-sonnet-20241022", # deprecated 9 | "claude-3-haiku-20240307", 10 | "claude-3-5-haiku-20241022", 11 | "claude-3-7-sonnet-20250219", 12 | "claude-sonnet-4-20250514", 13 | "claude-opus-4-20250514", 14 | "claude-opus-4-1-20250805", 15 | ] 16 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2023 LiveKit, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/voice/_utils.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from opentelemetry.trace import Span 4 | 5 | from livekit import rtc 6 | 7 | from ..telemetry import trace_types 8 | 9 | 10 | def _set_participant_attributes(span: Span, participant: rtc.Participant) -> None: 11 | span.set_attributes( 12 | { 13 | trace_types.ATTR_PARTICIPANT_ID: participant.sid, 14 | trace_types.ATTR_PARTICIPANT_IDENTITY: participant.identity, 15 | trace_types.ATTR_PARTICIPANT_KIND: rtc.ParticipantKind.Name(participant.kind), 16 | } 17 | ) 18 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-cartesia/README.md: -------------------------------------------------------------------------------- 1 | # Cartesia plugin for LiveKit Agents 2 | 3 | Support for [Cartesia](https://cartesia.ai/)'s voice AI services in LiveKit Agents. 4 | 5 | More information is available in the docs for the [STT](https://docs.livekit.io/agents/integrations/stt/cartesia/) and [TTS](https://docs.livekit.io/agents/integrations/tts/cartesia/) integrations. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-cartesia 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from Cartesia. It can be set as an environment variable: `CARTESIA_API_KEY` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-spitch/README.md: -------------------------------------------------------------------------------- 1 | # Spitch plugin for LiveKit Agents 2 | 3 | Support for [Spitch](https://spitch.app/)'s African-language voice AI services in LiveKit Agents. 4 | 5 | More information is available in the docs for the [STT](https://docs.livekit.io/agents/integrations/stt/spitch/) and [TTS](https://docs.livekit.io/agents/integrations/tts/spitch/) integrations. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-spitch 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from Spitch. It can be set as an environment variable: `SPITCH_API_KEY` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-deepgram/README.md: -------------------------------------------------------------------------------- 1 | # Deepgram plugin for LiveKit Agents 2 | 3 | Support for [Deepgram](https://deepgram.com/)'s voice AI services in LiveKit Agents. 4 | 5 | More information is available in the docs for the [STT](https://docs.livekit.io/agents/integrations/stt/deepgram/) and [TTS](https://docs.livekit.io/agents/integrations/tts/deepgram/) integrations. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-deepgram 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from DeepGram. It can be set as an environment variable: `DEEPGRAM_API_KEY` 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nvidia/README.md: -------------------------------------------------------------------------------- 1 | # NVIDIA plugin for LiveKit Agents 2 | 3 | Support for [NVIDIA Riva](https://developer.nvidia.com/riva)'s speech AI services in LiveKit Agents. 4 | 5 | More information is available in the [NVIDIA Riva documentation](https://developer.nvidia.com/riva). 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-nvidia 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You can either: 16 | 17 | 1. Use an API key from NVIDIA. It can be set as an environment variable: `NVIDIA_API_KEY` 18 | 2. Use you self hosted [Nim](https://developer.nvidia.com/nim) server. 19 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/utils.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import os 4 | from collections.abc import Awaitable 5 | from typing import Callable, Union 6 | 7 | from livekit.agents.inference.llm import to_fnc_ctx 8 | 9 | AsyncAzureADTokenProvider = Callable[[], Union[str, Awaitable[str]]] 10 | 11 | 12 | def get_base_url(base_url: str | None) -> str: 13 | if not base_url: 14 | base_url = os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1") 15 | return base_url 16 | 17 | 18 | __all__ = ["get_base_url", "to_fnc_ctx", "AsyncAzureADTokenProvider"] 19 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/beta/workflows/__init__.py: -------------------------------------------------------------------------------- 1 | from .address import GetAddressResult, GetAddressTask 2 | from .dtmf_inputs import GetDtmfResult, GetDtmfTask 3 | from .email_address import GetEmailResult, GetEmailTask 4 | from .task_group import TaskGroup, TaskGroupResult 5 | from .warm_transfer import WarmTransferResult, WarmTransferTask 6 | 7 | __all__ = [ 8 | "GetEmailTask", 9 | "GetEmailResult", 10 | "GetAddressTask", 11 | "GetAddressResult", 12 | "GetDtmfTask", 13 | "GetDtmfResult", 14 | "TaskGroup", 15 | "TaskGroupResult", 16 | "WarmTransferTask", 17 | "WarmTransferResult", 18 | ] 19 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bey/README.md: -------------------------------------------------------------------------------- 1 | # Beyond Presence plugin for LiveKit Agents 2 | 3 | Support for [Beyond Presence](https://docs.bey.dev) virtual avatars. 4 | 5 | See [https://docs.livekit.io/agents/integrations/avatar/bey/](https://docs.livekit.io/agents/integrations/avatar/bey/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-bey 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | Create a developer API key from the [creator dashboard](https://app.bey.chat) and set the `BEY_API_KEY` environment variable with it: 16 | 17 | ```bash 18 | export BEY_API_KEY= 19 | ``` 20 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/ipc/__init__.py: -------------------------------------------------------------------------------- 1 | from . import ( 2 | channel, 3 | inference_proc_executor, 4 | job_executor, 5 | job_proc_executor, 6 | job_thread_executor, 7 | proc_pool, 8 | proto, 9 | ) 10 | 11 | __all__ = [ 12 | "channel", 13 | "inference_proc_executor", 14 | "job_executor", 15 | "job_proc_executor", 16 | "job_thread_executor", 17 | "proc_pool", 18 | "proto", 19 | ] 20 | 21 | # Cleanup docs of unexported modules 22 | _module = dir() 23 | NOT_IN_ALL = [m for m in _module if m not in __all__] 24 | 25 | __pdoc__ = {} 26 | 27 | for n in NOT_IN_ALL: 28 | __pdoc__[n] = False 29 | -------------------------------------------------------------------------------- /examples/avatar_agents/simli/README.md: -------------------------------------------------------------------------------- 1 | # LiveKit Simli Avatar Agent 2 | 3 | This example demonstrates how to create a animated avatar using [Simli](https://app.simli.com/). 4 | 5 | ## Usage 6 | 7 | * Update the environment: 8 | 9 | ```bash 10 | # Simli Config 11 | export SIMLI_API_KEY="..." 12 | export SIMLI_FACE_ID="..." 13 | 14 | # OpenAI config (or other models, tts, stt) 15 | export OPENAI_API_KEY="..." 16 | 17 | # LiveKit config 18 | export LIVEKIT_API_KEY="..." 19 | export LIVEKIT_API_SECRET="..." 20 | export LIVEKIT_URL="..." 21 | ``` 22 | 23 | * Start the agent worker: 24 | 25 | ```bash 26 | python examples/avatar_agents/simli/agent_worker.py dev 27 | ``` 28 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-mistralai/livekit/plugins/mistralai/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | ChatModels = Literal[ 4 | "mistral-medium-latest", 5 | "mistral-large-latest", 6 | "mistral-medium-2508", 7 | "mistral-large-2411", 8 | "mistral-medium-2505", 9 | "ministral-3b-2410", 10 | "ministral-8b-2410", 11 | "mistral-large-2411", 12 | "mistral-large-2512", 13 | "ministral-14b-2512", 14 | "ministral-8b-2512", 15 | "ministral-3b-2512", 16 | "mistral-small-2407", 17 | ] 18 | 19 | STTModels = Literal[ 20 | "voxtral-small-2507", "voxtral-mini-2507", "voxtral-mini-latest", "voxtral-small-latest" 21 | ] 22 | -------------------------------------------------------------------------------- /examples/avatar_agents/tavus/README.md: -------------------------------------------------------------------------------- 1 | # LiveKit Tavus Avatar Agent 2 | 3 | This example demonstrates how to create a animated avatar using [Tavus](https://platform.tavus.io/). 4 | 5 | ## Usage 6 | 7 | * Update the environment: 8 | 9 | ```bash 10 | # Tavus Config 11 | export TAVUS_API_KEY="..." 12 | export TAVUS_REPLICA_ID="..." 13 | 14 | # OpenAI config (or other models, tts, stt) 15 | export OPENAI_API_KEY="..." 16 | 17 | # LiveKit config 18 | export LIVEKIT_API_KEY="..." 19 | export LIVEKIT_API_SECRET="..." 20 | export LIVEKIT_URL="..." 21 | ``` 22 | 23 | * Start the agent worker: 24 | 25 | ```bash 26 | python examples/avatar_agents/tavus/agent_worker.py dev 27 | ``` 28 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/llm/_provider_format/mistralai.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import Literal 4 | 5 | from livekit.agents import llm 6 | 7 | from .openai import to_chat_ctx as openai_to_chat_ctx 8 | 9 | 10 | def to_chat_ctx( 11 | chat_ctx: llm.ChatContext, *, inject_dummy_user_message: bool = True 12 | ) -> tuple[list[dict], Literal[None]]: 13 | messages, _ = openai_to_chat_ctx(chat_ctx, inject_dummy_user_message=inject_dummy_user_message) 14 | 15 | if inject_dummy_user_message and (not messages or messages[-1]["role"] not in ["user", "tool"]): 16 | messages.append({"role": "user", "content": ""}) 17 | return messages, None 18 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-azure/README.md: -------------------------------------------------------------------------------- 1 | # Azure plugin for LiveKit Agents 2 | 3 | Support for Azure AI including Azure Speech. For Azure OpenAI, see the [OpenAI plugin](https://github.com/livekit/agents/tree/main/livekit-plugins/livekit-plugins-openai). 4 | 5 | See [https://docs.livekit.io/agents/integrations/azure/](https://docs.livekit.io/agents/integrations/azure/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-azure 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need to specify an Azure Speech Key and a Deployment Region. They can be set as environment variables: `AZURE_SPEECH_KEY` and `AZURE_SPEECH_REGION`, respectively. 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-baseten/README.md: -------------------------------------------------------------------------------- 1 | # Baseten plugin for LiveKit Agents 2 | 3 | Support for [Baseten](https://baseten.co/)-hosted models in LiveKit Agents. 4 | 5 | More information is available in the docs for the [TTS](https://docs.livekit.io/agents/integrations/tts/baseten/) and [STT](https://docs.livekit.io/agents/integrations/stt/baseten/) integrations. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-baseten 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from Baseten. It can be set as an environment variable: `BASETEN_API_KEY` 16 | 17 | You also need to deploy a model to Baseten and will need your model endpoint to configure the plugin. -------------------------------------------------------------------------------- /livekit-plugins/livekit-blingfire/livekit/blingfire/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.1.0" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gradium/README.md: -------------------------------------------------------------------------------- 1 | # Gradium plugin for LiveKit Agents 2 | 3 | Support for [Gradium](https://gradium.ai/)-hosted models in LiveKit Agents. 4 | 5 | More information is available in the docs for the 6 | [TTS](https://docs.livekit.io/agents/integrations/tts/gradium/) and [STT](https://docs.livekit.io/agents/integrations/stt/gradium/) integrations. 7 | 8 | ## Installation 9 | 10 | ```bash 11 | pip install livekit-plugins-gradium 12 | ``` 13 | 14 | ## Pre-requisites 15 | 16 | You'll need an API key from Gradium. It can be set as an environment variable: `GRADIUM_API_KEY`. 17 | 18 | You also need to deploy a model to Gradium and will need your model endpoint to configure the plugin. 19 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/realtime/__init__.py: -------------------------------------------------------------------------------- 1 | from .events import ( 2 | ClientToolInvocationEvent, 3 | ClientToolResultEvent, 4 | DebugEvent, 5 | PingEvent, 6 | PlaybackClearBufferEvent, 7 | PongEvent, 8 | SetOutputMediumEvent, 9 | UserTextMessageEvent, 10 | ) 11 | from .realtime_model import RealtimeModel, RealtimeSession 12 | 13 | __all__ = [ 14 | "RealtimeModel", 15 | "RealtimeSession", 16 | "ClientToolInvocationEvent", 17 | "ClientToolResultEvent", 18 | "DebugEvent", 19 | "UserTextMessageEvent", 20 | "PingEvent", 21 | "PlaybackClearBufferEvent", 22 | "PongEvent", 23 | "SetOutputMediumEvent", 24 | ] 25 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bey/livekit/plugins/bey/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/.clang-format: -------------------------------------------------------------------------------- 1 | # Defines the Chromium style for automatic reformatting. 2 | # http://clang.llvm.org/docs/ClangFormatStyleOptions.html 3 | BasedOnStyle: Chromium 4 | --- 5 | Language: ObjC 6 | BasedOnStyle: Google 7 | BinPackParameters: false 8 | BinPackArguments: false 9 | ColumnLimit: 100 10 | ObjCBlockIndentWidth: 2 11 | AllowAllParametersOfDeclarationOnNextLine: true 12 | AlignOperands: false 13 | AlwaysBreakBeforeMultilineStrings: false 14 | AllowShortFunctionsOnASingleLine: Inline 15 | BreakBeforeTernaryOperators: false 16 | IndentWrappedFunctionNames: true 17 | ContinuationIndentWidth: 4 18 | ObjCSpaceBeforeProtocolList: true 19 | --- 20 | Language: Cpp 21 | IncludeBlocks: Regroup -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fal/livekit/plugins/fal/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-groq/livekit/plugins/groq/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nvidia/livekit/plugins/nvidia/auth.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | import riva.client 4 | 5 | from livekit.agents.utils import is_given 6 | 7 | 8 | def create_riva_auth( 9 | *, 10 | api_key: Optional[str], 11 | function_id: str, 12 | server: str, 13 | use_ssl: bool = True, 14 | ) -> riva.client.Auth: 15 | metadata_args = [] 16 | 17 | if is_given(api_key) and api_key: 18 | metadata_args.append(["authorization", f"Bearer {api_key}"]) 19 | 20 | metadata_args.append(["function-id", function_id]) 21 | 22 | return riva.client.Auth( 23 | uri=server, 24 | use_ssl=use_ssl, 25 | metadata_args=metadata_args, 26 | ) 27 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-xai/livekit/plugins/xai/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anam/livekit/plugins/anam/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-azure/livekit/plugins/azure/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-clova/livekit/plugins/clova/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-google/livekit/plugins/google/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hedra/livekit/plugins/hedra/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hume/livekit/plugins/hume/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-lmnt/livekit/plugins/lmnt/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nltk/livekit/plugins/nltk/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nvidia/livekit/plugins/nvidia/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rime/livekit/plugins/rime/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-sarvam/livekit/plugins/sarvam/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-simli/livekit/plugins/simli/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-soniox/livekit/plugins/soniox/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-spitch/livekit/plugins/spitch/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-tavus/livekit/plugins/tavus/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /examples/avatar_agents/anam/README.md: -------------------------------------------------------------------------------- 1 | # LiveKit Anam Avatar Agent 2 | 3 | This example demonstrates how to create a animated avatar using [Anam](https://lab.anam.ai/). 4 | 5 | Create your avatar [here](https://lab.anam.dev/avatars) 6 | 7 | ## Usage 8 | 9 | * Update the environment: 10 | 11 | ```bash 12 | # Anam Config 13 | export ANAM_API_KEY="..." 14 | export ANAM_AVATAR_ID="..." 15 | 16 | # OpenAI config (or other models, tts, stt) 17 | export OPENAI_API_KEY="..." 18 | 19 | # LiveKit config 20 | export LIVEKIT_API_KEY="..." 21 | export LIVEKIT_API_SECRET="..." 22 | export LIVEKIT_URL="..." 23 | ``` 24 | 25 | * Start the agent worker: 26 | 27 | ```bash 28 | python examples/avatar_agents/anam/agent_worker.py dev 29 | ``` 30 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-baseten/livekit/plugins/baseten/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bithuman/livekit/plugins/bithuman/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/livekit/plugins/browser/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gradium/livekit/plugins/gradium/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-inworld/livekit/plugins/inworld/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimal/livekit/plugins/minimal/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimax/livekit/plugins/minimax/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-resemble/livekit/plugins/resemble/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-ultravox/livekit/plugins/ultravox/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-upliftai/livekit/plugins/upliftai/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anthropic/livekit/plugins/anthropic/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-avatartalk/livekit/plugins/avatartalk/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSModels = Literal[ 4 | "eleven_monolingual_v1", 5 | "eleven_multilingual_v1", 6 | "eleven_multilingual_v2", 7 | "eleven_turbo_v2", 8 | "eleven_turbo_v2_5", 9 | "eleven_flash_v2_5", 10 | "eleven_flash_v2", 11 | "eleven_v3", 12 | ] 13 | 14 | TTSEncoding = Literal[ 15 | "mp3_22050_32", 16 | "mp3_44100", 17 | "mp3_44100_32", 18 | "mp3_44100_64", 19 | "mp3_44100_96", 20 | "mp3_44100_128", 21 | "mp3_44100_192", 22 | ] 23 | 24 | STTRealtimeSampleRates = Literal[ 25 | 8000, 26 | 16000, 27 | 22050, 28 | 24000, 29 | 44100, 30 | 48000, 31 | ] 32 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fireworksai/livekit/plugins/fireworksai/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-langchain/livekit/plugins/langchain/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-liveavatar/livekit/plugins/liveavatar/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-neuphonic/livekit/plugins/neuphonic/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-smallestai/livekit/plugins/smallestai/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechify/livekit/plugins/speechify/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /examples/avatar_agents/liveavatar/README.md: -------------------------------------------------------------------------------- 1 | # LiveKit LiveAvatar Avatar Agent 2 | 3 | This example demonstrates how to create a animated avatar using [LiveAvatar by HeyGen](https://www.liveavatar.com/). 4 | 5 | ## Usage 6 | 7 | * Update the environment: 8 | 9 | ```bash 10 | # LiveAvatar Config 11 | export LIVEAVATAR_API_KEY="..." 12 | export LIVEAVATAR_AVATAR_ID="..." 13 | 14 | # STT + LLM + TTS config 15 | export OPENAI_API_KEY="..." 16 | export DEEPGRAM_API_KEY="..." 17 | 18 | # LiveKit config 19 | export LIVEKIT_API_KEY="..." 20 | export LIVEKIT_API_SECRET="..." 21 | export LIVEKIT_URL="..." 22 | ``` 23 | 24 | * Start the agent worker: 25 | 26 | ```bash 27 | python examples/avatar_agents/liveavatar/agent_worker.py dev 28 | ``` 29 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-mistralai/livekit/plugins/mistralai/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | __version__ = "1.3.8" 17 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "1.3.8" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-xai/livekit/plugins/xai/__init__.py: -------------------------------------------------------------------------------- 1 | """xAI plugin for LiveKit Agents""" 2 | 3 | from . import realtime 4 | from .version import __version__ 5 | 6 | __all__ = [ 7 | "realtime", 8 | "__version__", 9 | ] 10 | 11 | 12 | from livekit.agents import Plugin 13 | 14 | from .log import logger 15 | 16 | 17 | class XAIPlugin(Plugin): 18 | def __init__(self) -> None: 19 | super().__init__(__name__, __version__, __package__, logger) 20 | 21 | 22 | Plugin.register_plugin(XAIPlugin()) 23 | 24 | # Cleanup docs of unexported modules 25 | _module = dir() 26 | NOT_IN_ALL = [m for m in _module if m not in __all__] 27 | 28 | __pdoc__ = {} 29 | 30 | for n in NOT_IN_ALL: 31 | __pdoc__[n] = False 32 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/bounded_dict.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from collections import OrderedDict 4 | from typing import TypeVar 5 | 6 | K = TypeVar("K") 7 | V = TypeVar("V") 8 | 9 | 10 | class BoundedDict(OrderedDict[K, V]): 11 | def __init__(self, maxsize: int | None = None): 12 | super().__init__() 13 | self.maxsize = maxsize 14 | if self.maxsize is not None and self.maxsize <= 0: 15 | raise ValueError("maxsize must be greater than 0") 16 | 17 | def __setitem__(self, key: K, value: V) -> None: 18 | super().__setitem__(key, value) 19 | 20 | while self.maxsize is not None and len(self) > self.maxsize: 21 | self.popitem(last=False) 22 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/telemetry/__init__.py: -------------------------------------------------------------------------------- 1 | from . import http_server, metrics, trace_types, utils 2 | from .traces import ( 3 | _chat_ctx_to_otel_events, 4 | _setup_cloud_tracer, 5 | _upload_session_report, 6 | set_tracer_provider, 7 | tracer, 8 | ) 9 | 10 | __all__ = [ 11 | "tracer", 12 | "metrics", 13 | "trace_types", 14 | "http_server", 15 | "set_tracer_provider", 16 | "utils", 17 | "_setup_cloud_tracer", 18 | "_upload_session_report", 19 | "_chat_ctx_to_otel_events", 20 | ] 21 | 22 | # Cleanup docs of unexported modules 23 | _module = dir() 24 | NOT_IN_ALL = [m for m in _module if m not in __all__] 25 | 26 | __pdoc__ = {} 27 | 28 | for n in NOT_IN_ALL: 29 | __pdoc__[n] = False 30 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/aio/debug.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import asyncio 4 | import time 5 | from asyncio.base_events import _format_handle # type: ignore 6 | from typing import Any 7 | 8 | from ...log import logger 9 | 10 | 11 | def hook_slow_callbacks(slow_duration: float) -> None: 12 | _run = asyncio.events.Handle._run 13 | 14 | def instrumented(self: Any) -> Any: 15 | start = time.monotonic() 16 | val = _run(self) 17 | dt = time.monotonic() - start 18 | if dt >= slow_duration: 19 | logger.warning("Running %s took too long: %.2f seconds", _format_handle(self), dt) 20 | return val 21 | 22 | asyncio.events.Handle._run = instrumented # type: ignore 23 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/voice/avatar/__init__.py: -------------------------------------------------------------------------------- 1 | from ._datastream_io import DataStreamAudioOutput, DataStreamAudioReceiver 2 | from ._queue_io import QueueAudioOutput 3 | from ._runner import AvatarOptions, AvatarRunner 4 | from ._types import AudioReceiver, AudioSegmentEnd, VideoGenerator 5 | 6 | __all__ = [ 7 | "AvatarRunner", 8 | "AvatarOptions", 9 | "VideoGenerator", 10 | "AudioReceiver", 11 | "AudioSegmentEnd", 12 | "QueueAudioOutput", 13 | "DataStreamAudioReceiver", 14 | "DataStreamAudioOutput", 15 | ] 16 | 17 | # Cleanup docs of unexported modules 18 | _module = dir() 19 | NOT_IN_ALL = [m for m in _module if m not in __all__] 20 | 21 | __pdoc__ = {} 22 | 23 | for n in NOT_IN_ALL: 24 | __pdoc__[n] = False 25 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-blingfire/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.31) 2 | project(lk_blingfire) 3 | 4 | set(CMAKE_CXX_STANDARD 17) 5 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 6 | 7 | find_package(Python REQUIRED COMPONENTS Interpreter Development.Module) 8 | find_package(pybind11 REQUIRED) 9 | 10 | message(STATUS "Using Python: ${PYTHON_EXECUTABLE}") 11 | 12 | include(FetchContent) 13 | FetchContent_Declare(blingfire 14 | GIT_REPOSITORY https://github.com/microsoft/BlingFire) 15 | FetchContent_MakeAvailable(blingfire) 16 | 17 | include_directories(${blingfire_SOURCE_DIR}) 18 | 19 | pybind11_add_module(lk_blingfire src/main.cpp) 20 | target_link_libraries(lk_blingfire PRIVATE blingfiretokdll_static fsaClient) 21 | -------------------------------------------------------------------------------- /examples/avatar_agents/avatartalk/README.md: -------------------------------------------------------------------------------- 1 | # LiveKit AvatarTalk Avatar Agent 2 | 3 | This example demonstrates how to create a animated avatar using [AvatarTalk](https://avatartalk.ai/). 4 | 5 | ## Usage 6 | 7 | * Update the environment: 8 | 9 | ```bash 10 | # AvatarTalk Config 11 | export AVATARTALK_API_KEY="..." 12 | export AVATARTALK_API_URL="..." 13 | export AVATARTALK_AVATAR="..." 14 | export AVATARTALK_EMOTION="..." 15 | 16 | # OpenAI config (or other models, tts, stt) 17 | export OPENAI_API_KEY="..." 18 | 19 | # LiveKit config 20 | export LIVEKIT_API_KEY="..." 21 | export LIVEKIT_API_SECRET="..." 22 | export LIVEKIT_URL="..." 23 | ``` 24 | 25 | * Start the agent worker: 26 | 27 | ```bash 28 | python examples/avatar_agents/avatartalk/agent_worker.py dev 29 | ``` 30 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fishaudio/README.md: -------------------------------------------------------------------------------- 1 | # Fish Audio plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with [Fish Audio](https://fish.audio/). 4 | 5 | - Docs: `https://docs.fish.audio/` 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-fishaudio 11 | ``` 12 | 13 | ## Prerequisites 14 | 15 | Obtain an API key from Fish Audio. 16 | 17 | Set the API key as an environment variable: 18 | 19 | ``` 20 | FISH_API_KEY= 21 | ``` 22 | 23 | ## Usage 24 | 25 | ```python 26 | from livekit.agents import AgentSession 27 | from livekit.plugins import fishaudio 28 | 29 | # Basic usage with env-based credentials 30 | tts = fishaudio.TTS() 31 | 32 | session = AgentSession( 33 | tts=tts, 34 | # ... stt, llm, etc. 35 | ) 36 | ``` 37 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-mistralai/livekit/plugins/mistralai/__init__.py: -------------------------------------------------------------------------------- 1 | """LiveKit plugin for Mistral AI models. Supports Chat and STT models""" 2 | 3 | from livekit.agents import Plugin 4 | 5 | from .llm import LLM 6 | from .log import logger 7 | from .stt import STT 8 | from .version import __version__ 9 | 10 | __all__ = ["LLM", "STT", "__version__"] 11 | 12 | 13 | class MistralAIPlugin(Plugin): 14 | def __init__(self) -> None: 15 | super().__init__(__name__, __version__, __package__, logger) 16 | 17 | 18 | Plugin.register_plugin(MistralAIPlugin()) 19 | 20 | # Cleanup docs of unexported modules 21 | _module = dir() 22 | NOT_IN_ALL = [m for m in _module if m not in __all__] 23 | 24 | __pdoc__ = {} 25 | 26 | for n in NOT_IN_ALL: 27 | __pdoc__[n] = False 28 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechify/livekit/plugins/speechify/log.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import logging 16 | 17 | logger = logging.getLogger("livekit.plugins.speechify") 18 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/tokenize/__init__.py: -------------------------------------------------------------------------------- 1 | from . import basic, blingfire, utils 2 | from .token_stream import BufferedSentenceStream, BufferedWordStream 3 | from .tokenizer import ( 4 | SentenceStream, 5 | SentenceTokenizer, 6 | TokenData, 7 | WordStream, 8 | WordTokenizer, 9 | ) 10 | 11 | __all__ = [ 12 | "SentenceTokenizer", 13 | "SentenceStream", 14 | "WordTokenizer", 15 | "WordStream", 16 | "TokenData", 17 | "BufferedSentenceStream", 18 | "BufferedWordStream", 19 | "basic", 20 | "blingfire", 21 | "utils", 22 | ] 23 | 24 | 25 | # Cleanup docs of unexported modules 26 | _module = dir() 27 | NOT_IN_ALL = [m for m in _module if m not in __all__] 28 | 29 | __pdoc__ = {} 30 | 31 | for n in NOT_IN_ALL: 32 | __pdoc__[n] = False 33 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/metrics/__init__.py: -------------------------------------------------------------------------------- 1 | from .base import ( 2 | AgentMetrics, 3 | EOUMetrics, 4 | LLMMetrics, 5 | RealtimeModelMetrics, 6 | STTMetrics, 7 | TTSMetrics, 8 | VADMetrics, 9 | ) 10 | from .usage_collector import UsageCollector, UsageSummary 11 | from .utils import log_metrics 12 | 13 | __all__ = [ 14 | "LLMMetrics", 15 | "AgentMetrics", 16 | "VADMetrics", 17 | "EOUMetrics", 18 | "STTMetrics", 19 | "TTSMetrics", 20 | "RealtimeModelMetrics", 21 | "UsageSummary", 22 | "UsageCollector", 23 | "log_metrics", 24 | ] 25 | 26 | # Cleanup docs of unexported modules 27 | _module = dir() 28 | NOT_IN_ALL = [m for m in _module if m not in __all__] 29 | 30 | __pdoc__ = {} 31 | 32 | for n in NOT_IN_ALL: 33 | __pdoc__[n] = False 34 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-sarvam/README.md: -------------------------------------------------------------------------------- 1 | # Sarvam.ai Plugin for LiveKit Agents 2 | 3 | Support for [Sarvam.ai](https://sarvam.ai)'s Indian-language voice AI services in LiveKit Agents. 4 | 5 | ## Features 6 | 7 | - **Speech-to-Text (STT)**: Convert audio to text using Sarvam's "Saarika" models. See the [STT docs](https://docs.livekit.io/agents/integrations/stt/sarvam/) for more information. 8 | - **Text-to-Speech (TTS)**: Convert text to audio using Sarvam's "Bulbul" models. See the [TTS docs](https://docs.livekit.io/agents/integrations/tts/sarvam/) for more information. 9 | 10 | ## Installation 11 | 12 | ```bash 13 | pip install livekit-plugins-sarvam 14 | ``` 15 | 16 | ## Pre-requisites 17 | 18 | You'll need an API key from Sarvam.ai. It can be set as an environment variable: `SARVAM_API_KEY` -------------------------------------------------------------------------------- /tests/long_transcript.txt: -------------------------------------------------------------------------------- 1 | It could not have been ten seconds, and yet it seemed a long time that their hands were clasped together. 2 | He had time to learn every detail of her hand. 3 | He explored the long fingers, the shapely nails, the work-hardened palm with its row of callouses, the smooth flesh under the wrist. 4 | Merely from feeling it he would have known it by sight. 5 | In the same instant it occurred to him that he did not know what colour the girl's eyes were. 6 | They were probably brown, but people with dark hair sometimes had blue eyes. 7 | To turn his head and look at her would have been inconceivable folly. 8 | With hands locked together, invisible among the press of bodies, 9 | they stared steadily in front of them, and instead of the eyes of the girl, the eyes of the aged prisoner gazed mournfully at Winston out of nests of hair. 10 | -------------------------------------------------------------------------------- /examples/other/transcription/README.md: -------------------------------------------------------------------------------- 1 | # Speech-to-text 2 | 3 | This example shows realtime transcription from voice to text. 4 | 5 | It uses OpenAI's Whisper STT API, but supports other STT plugins by changing this line: 6 | 7 | ```python 8 | stt = openai.STT() 9 | ``` 10 | 11 | To render the transcriptions into your client application, refer to the [full documentation](https://docs.livekit.io/agents/voice-agent/transcriptions/). 12 | 13 | ## Running the example 14 | 15 | ```bash 16 | export LIVEKIT_URL=wss://yourhost.livekit.cloud 17 | export LIVEKIT_API_KEY=livekit-api-key 18 | export LIVEKIT_API_SECRET=your-api-secret 19 | export OPENAI_API_KEY=your-api-key 20 | 21 | python3 transcriber.py start 22 | ``` 23 | 24 | Then connect to any room. For an example frontend, you can use LiveKit's [Agents Playground](https://agents-playground.livekit.io/). 25 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-upliftai/README.md: -------------------------------------------------------------------------------- 1 | # Uplift AI plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with [Uplift AI](https://upliftai.org) for underserved languages. 4 | 5 | See [https://docs.upliftai.org/orator_voices](https://docs.upliftai.org/orator_voices) for supported voices and languages. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-upliftai 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need an API key from Uplift AI. It can be set as an environment variable: `UPLIFTAI_API_KEY`. You can get your API key by signing up at [https://upliftai.org](https://upliftai.org). 16 | 17 | 18 | ## Tutorial 19 | 20 | Follow along at [https://docs.upliftai.org/tutorials/livekit-voice-agent](https://docs.upliftai.org/tutorials/livekit-voice-agent) where we build a voice agent using LiveKit and Uplift AI. -------------------------------------------------------------------------------- /.github/workflows/auto-assign.yml: -------------------------------------------------------------------------------- 1 | # .github/workflows/assign-reviewers.yml 2 | name: Auto-assign reviewers 3 | permissions: 4 | contents: read 5 | pull-requests: write 6 | on: 7 | pull_request: 8 | types: [opened, reopened, ready_for_review] 9 | branches: [main] 10 | 11 | jobs: 12 | assign: 13 | if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.fork == false 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/github-script@v7 17 | with: 18 | github-token: ${{ secrets.REVIEW_TOKEN }} 19 | script: | 20 | await github.rest.pulls.requestReviewers({ 21 | owner: context.repo.owner, 22 | repo: context.repo.repo, 23 | pull_number: context.payload.pull_request.number, 24 | team_reviewers: ['agent-devs'] 25 | }); 26 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rtzr/livekit/plugins/rtzr/__init__.py: -------------------------------------------------------------------------------- 1 | """RTZR plugin for LiveKit Agents 2 | 3 | See Streaming STT docs at: https://developers.rtzr.ai/docs/en/ 4 | 5 | Environment variables used: 6 | - `RTZR_CLIENT_ID` / `RTZR_CLIENT_SECRET` for authentication (required) 7 | """ 8 | 9 | from livekit.agents import Plugin 10 | 11 | from .log import logger 12 | from .stt import STT 13 | from .version import __version__ 14 | 15 | __all__ = ["STT", "__version__"] 16 | 17 | 18 | class RTZRPlugin(Plugin): 19 | def __init__(self): 20 | super().__init__(__name__, __version__, __package__, logger) 21 | 22 | 23 | Plugin.register_plugin(RTZRPlugin()) 24 | 25 | # Cleanup docs of unexported modules 26 | _module = dir() 27 | NOT_IN_ALL = [m for m in _module if m not in __all__] 28 | 29 | __pdoc__ = {} 30 | 31 | for n in NOT_IN_ALL: 32 | __pdoc__[n] = False 33 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/aio/wait_group.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | 3 | 4 | class WaitGroup: 5 | """ 6 | asyncio wait group implementation (similar to sync.WaitGroup in go) 7 | """ 8 | 9 | def __init__(self) -> None: 10 | self._counter = 0 11 | self._zero_event = asyncio.Event() 12 | self._zero_event.set() 13 | 14 | def add(self, delta: int = 1) -> None: 15 | new_value = self._counter + delta 16 | if new_value < 0: 17 | raise ValueError("WaitGroup counter cannot go negative.") 18 | 19 | self._counter = new_value 20 | 21 | if self._counter == 0: 22 | self._zero_event.set() 23 | else: 24 | self._zero_event.clear() 25 | 26 | def done(self) -> None: 27 | self.add(-1) 28 | 29 | async def wait(self) -> None: 30 | await self._zero_event.wait() 31 | -------------------------------------------------------------------------------- /tests/test_aio.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | 3 | from livekit.agents.utils import aio 4 | 5 | 6 | async def test_channel(): 7 | tx = rx = aio.Chan[int]() 8 | sum = 0 9 | 10 | async def test_task(): 11 | nonlocal sum 12 | while True: 13 | try: 14 | sum = sum + await rx.recv() 15 | except aio.ChanClosed: 16 | break 17 | 18 | t = asyncio.create_task(test_task()) 19 | for _ in range(10): 20 | await tx.send(1) 21 | 22 | tx.close() 23 | await t 24 | assert sum == 10 25 | 26 | 27 | async def test_interval(): 28 | interval = aio.interval(0.1) 29 | 30 | _ = asyncio.get_event_loop() 31 | async for i in interval: 32 | if i == 3: 33 | break 34 | 35 | 36 | async def test_sleep(): 37 | await aio.sleep(0) 38 | 39 | sleep = aio.sleep(5) 40 | sleep.reset(0.1) 41 | await sleep 42 | -------------------------------------------------------------------------------- /tests/Makefile: -------------------------------------------------------------------------------- 1 | PLUGIN ?= 2 | PYTEST_ARGS ?= 3 | 4 | .PHONY: test up down 5 | 6 | up: 7 | @if [ -f ../.env ]; then \ 8 | echo "Found .env file. Using it..."; \ 9 | docker compose --env-file ../.env build; \ 10 | docker compose --env-file ../.env up -d; \ 11 | else \ 12 | echo "No .env file found. Running without it..."; \ 13 | docker compose build; \ 14 | docker compose up -d; \ 15 | fi 16 | 17 | down: 18 | docker compose down 19 | 20 | test: up 21 | @docker compose exec app bash -c "\ 22 | until curl -sf http://toxiproxy:8474/proxies; do \ 23 | echo 'Waiting for toxiproxy...'; \ 24 | sleep 1; \ 25 | done" 26 | echo 'Toxiproxy is ready' 27 | 28 | docker compose exec app uv sync --all-extras --dev 29 | docker compose exec -e PLUGIN="$(PLUGIN)" app uv run pytest -s --color=yes --tb=short --log-cli-level=DEBUG tests/test_tts.py --show-capture=all $(PYTEST_ARGS) 30 | $(MAKE) down 31 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/aio/utils.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import functools 3 | from typing import Any 4 | 5 | 6 | async def cancel_and_wait(*futures: asyncio.Future[Any]) -> None: 7 | loop = asyncio.get_running_loop() 8 | waiters = [] 9 | 10 | for fut in futures: 11 | waiter = loop.create_future() 12 | cb = functools.partial(_release_waiter, waiter) 13 | waiters.append((waiter, cb)) 14 | fut.add_done_callback(cb) 15 | fut.cancel() 16 | 17 | try: 18 | for waiter, _ in waiters: 19 | await waiter 20 | finally: 21 | for i, fut in enumerate(futures): 22 | _, cb = waiters[i] 23 | fut.remove_done_callback(cb) 24 | 25 | 26 | def _release_waiter(waiter: asyncio.Future[Any], *_: Any) -> None: 27 | if not waiter.done(): 28 | waiter.set_result(None) 29 | 30 | 31 | gracefully_cancel = cancel_and_wait 32 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/moving_average.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | 4 | class MovingAverage: 5 | def __init__(self, window_size: int) -> None: 6 | self._hist: list[float] = [0] * window_size 7 | self._sum: float = 0 8 | self._count: int = 0 9 | 10 | def add_sample(self, sample: float) -> None: 11 | self._count += 1 12 | index = self._count % len(self._hist) 13 | if self._count > len(self._hist): 14 | self._sum -= self._hist[index] 15 | self._sum += sample 16 | self._hist[index] = sample 17 | 18 | def get_avg(self) -> float: 19 | if self._count == 0: 20 | return 0 21 | return self._sum / self.size() 22 | 23 | def reset(self) -> None: 24 | self._count = 0 25 | self._sum = 0 26 | 27 | def size(self) -> int: 28 | return min(self._count, len(self._hist)) 29 | -------------------------------------------------------------------------------- /examples/primitives/e2ee.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from dotenv import load_dotenv 4 | 5 | from livekit import rtc 6 | from livekit.agents import AgentServer, JobContext, cli 7 | 8 | logger = logging.getLogger("e2ee-example") 9 | logger.setLevel(logging.INFO) 10 | 11 | load_dotenv() 12 | 13 | server = AgentServer() 14 | 15 | 16 | @server.rtc_session() 17 | async def entrypoint(ctx: JobContext): 18 | e2ee_config = rtc.E2EEOptions( 19 | key_provider_options=rtc.KeyProviderOptions( 20 | shared_key=b"my_shared_key", 21 | # ratchet_salt=b"my_salt", 22 | ), 23 | encryption_type=rtc.EncryptionType.GCM, 24 | ) 25 | 26 | # Connect to the room with end-to-end encryption (E2EE) 27 | # Only clients possessing the same shared key will be able to decode the published tracks 28 | await ctx.connect(e2ee=e2ee_config) 29 | 30 | 31 | if __name__ == "__main__": 32 | cli.run_app(server) 33 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-langchain/README.md: -------------------------------------------------------------------------------- 1 | # LangChain plugin for LiveKit Agents 2 | 3 | This plugin integrates capabilites from LangChain within LiveKit Agents 4 | 5 | ## Installation 6 | 7 | ```bash 8 | pip install livekit-plugins-langchain 9 | ``` 10 | 11 | ## Usage 12 | 13 | ### Using LangGraph workflows 14 | 15 | You can bring over any existing workflow in LangGraph as an Agents LLM with `langchain.LLMAdapter`. For example: 16 | 17 | ```python 18 | from langgraph.graph import StateGraph 19 | from livekit.agents import Agent, AgentSession, JobContext 20 | from livekit.plugins import langchain 21 | 22 | ... 23 | 24 | def entrypoint(ctx: JobContext): 25 | graph = StateGraph(...).compile() 26 | 27 | session = AgentSession( 28 | vad=..., 29 | stt=..., 30 | tts=..., 31 | ) 32 | 33 | await session.start( 34 | agent=Agent(llm=langchain.LLMAdapter(graph)), 35 | ) 36 | ... 37 | ``` 38 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/aio/__init__.py: -------------------------------------------------------------------------------- 1 | from . import debug, duplex_unix, itertools 2 | from .channel import Chan, ChanClosed, ChanReceiver, ChanSender 3 | from .interval import Interval, interval 4 | from .sleep import Sleep, SleepFinished, sleep 5 | from .task_set import TaskSet 6 | from .utils import cancel_and_wait, gracefully_cancel 7 | from .wait_group import WaitGroup 8 | 9 | __all__ = [ 10 | "ChanClosed", 11 | "Chan", 12 | "ChanSender", 13 | "ChanReceiver", 14 | "Interval", 15 | "interval", 16 | "Sleep", 17 | "SleepFinished", 18 | "sleep", 19 | "TaskSet", 20 | "WaitGroup", 21 | "debug", 22 | "cancel_and_wait", 23 | "duplex_unix", 24 | "itertools", 25 | "gracefully_cancel", 26 | ] 27 | 28 | # Cleanup docs of unexported modules 29 | _module = dir() 30 | NOT_IN_ALL = [m for m in _module if m not in __all__] 31 | 32 | __pdoc__ = {} 33 | 34 | for n in NOT_IN_ALL: 35 | __pdoc__[n] = False 36 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/codecs/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from .decoder import AudioStreamDecoder, StreamBuffer 16 | 17 | __all__ = ["AudioStreamDecoder", "StreamBuffer"] 18 | 19 | # Cleanup docs of unexported modules 20 | _module = dir() 21 | NOT_IN_ALL = [m for m in _module if m not in __all__] 22 | 23 | __pdoc__ = {} 24 | 25 | for n in NOT_IN_ALL: 26 | __pdoc__[n] = False 27 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/exp_filter.py: -------------------------------------------------------------------------------- 1 | class ExpFilter: 2 | def __init__(self, alpha: float, max_val: float = -1.0) -> None: 3 | self._alpha = alpha 4 | self._filtered = -1.0 5 | self._max_val = max_val 6 | 7 | def reset(self, alpha: float = -1.0) -> None: 8 | if alpha != -1.0: 9 | self._alpha = alpha 10 | self._filtered = -1.0 11 | 12 | def apply(self, exp: float, sample: float) -> float: 13 | if self._filtered == -1.0: 14 | self._filtered = sample 15 | else: 16 | a = self._alpha**exp 17 | self._filtered = a * self._filtered + (1 - a) * sample 18 | 19 | if self._max_val != -1.0 and self._filtered > self._max_val: 20 | self._filtered = self._max_val 21 | 22 | return self._filtered 23 | 24 | def filtered(self) -> float: 25 | return self._filtered 26 | 27 | def update_base(self, alpha: float) -> None: 28 | self._alpha = alpha 29 | -------------------------------------------------------------------------------- /examples/voice_agents/llamaindex-rag/README.md: -------------------------------------------------------------------------------- 1 | # RAG Example using LlamaIndex 2 | 3 | This repository showcases three ways to build a voice assistant with Retrieval-Augmented Generation (RAG) using LlamaIndex: 4 | 5 | 1. **`chat_engine.py`**: Utilizes LlamaIndex's `as_chat_engine` for a straightforward, integrated solution. **Trade-off**: Lacks function calling support, limiting advanced interactions. 6 | 7 | 2. **`query_engine.py`**: Uses an LLM that supports function calling (e.g., OpenAI's models) to define custom functions like `query_info` for retrieval. **Trade-off**: Requires additional setup but offers greater flexibility. 8 | 9 | 3. **`retrieval.py`**: Manually injects retrieved context into the system prompt using LlamaIndex's retriever. **Trade-off**: Provides fine-grained control but involves complex prompt engineering. 10 | 11 | **Current recommended way**: Use **`query_engine.py`** for its balance of flexibility and control, enabling function calling and custom behaviors without excessive complexity. 12 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/images/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from .image import EncodeOptions, ResizeOptions, encode 16 | 17 | __all__ = ["EncodeOptions", "ResizeOptions", "encode"] 18 | 19 | # Cleanup docs of unexported modules 20 | _module = dir() 21 | NOT_IN_ALL = [m for m in _module if m not in __all__] 22 | 23 | __pdoc__ = {} 24 | 25 | for n in NOT_IN_ALL: 26 | __pdoc__[n] = False 27 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSSpeechEngine = Literal["standard", "neural", "long-form", "generative"] 4 | TTSLanguages = Literal[ 5 | "arb", 6 | "cmn-CN", 7 | "cy-GB", 8 | "da-DK", 9 | "de-DE", 10 | "en-AU", 11 | "en-GB", 12 | "en-GB-WLS", 13 | "en-IN", 14 | "en-US", 15 | "es-ES", 16 | "es-MX", 17 | "es-US", 18 | "fr-CA", 19 | "fr-FR", 20 | "is-IS", 21 | "it-IT", 22 | "ja-JP", 23 | "hi-IN", 24 | "ko-KR", 25 | "nb-NO", 26 | "nl-NL", 27 | "pl-PL", 28 | "pt-BR", 29 | "pt-PT", 30 | "ro-RO", 31 | "ru-RU", 32 | "sv-SE", 33 | "tr-TR", 34 | "en-NZ", 35 | "en-ZA", 36 | "ca-ES", 37 | "de-AT", 38 | "yue-CN", 39 | "ar-AE", 40 | "fi-FI", 41 | "en-IE", 42 | "nl-BE", 43 | "fr-BE", 44 | "cs-CZ", 45 | "de-CH", 46 | ] 47 | 48 | TTSEncoding = Literal["mp3"] 49 | TTSTextType = Literal["text", "ssml"] 50 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/beta/workflows/utils.py: -------------------------------------------------------------------------------- 1 | from enum import Enum 2 | 3 | 4 | class DtmfEvent(str, Enum): 5 | ONE = "1" 6 | TWO = "2" 7 | THREE = "3" 8 | FOUR = "4" 9 | FIVE = "5" 10 | SIX = "6" 11 | SEVEN = "7" 12 | EIGHT = "8" 13 | NINE = "9" 14 | ZERO = "0" 15 | STAR = "*" 16 | POUND = "#" 17 | A = "A" 18 | B = "B" 19 | C = "C" 20 | D = "D" 21 | 22 | 23 | def dtmf_event_to_code(event: DtmfEvent) -> int: 24 | if event.value.isdigit(): 25 | return int(event.value) 26 | elif event.value == "*": 27 | return 10 28 | elif event.value == "#": 29 | return 11 30 | elif event.value in ["A", "B", "C", "D"]: 31 | # DTMF codes 10-15 are used for letters A-D 32 | return ord(event.value) - ord("A") + 12 33 | else: 34 | raise ValueError(f"Invalid DTMF event: {event}") 35 | 36 | 37 | def format_dtmf(events: list[DtmfEvent]) -> str: 38 | return " ".join(event.value for event in events) 39 | -------------------------------------------------------------------------------- /examples/avatar_agents/audio_wave/README.md: -------------------------------------------------------------------------------- 1 | # LiveKit Mock Avatar Example 2 | 3 | This example demonstrates how to create an animated avatar that responds to audio input using LiveKit's agent system. The avatar worker generates synchronized video based on received audio input. 4 | 5 | ## How it Works 6 | 7 | 1. The agent sends connection info (including token, room name, and URL) to the avatar dispatcher server 8 | 2. The dispatcher launches an avatar worker process for that room 9 | 3. The agent streams audio to the avatar worker using LiveKit's DataStream 10 | 4. The avatar worker: 11 | - Receives the audio stream 12 | - Generates synchronized video frames based on the audio 13 | - Publishes both the audio and video back to the room 14 | 15 | ## Usage 16 | 17 | 1. Start the avatar dispatcher server: 18 | ```bash 19 | python examples/avatar/dispatcher.py [--port 8089] 20 | ``` 21 | 22 | 2. Start the agent worker: 23 | ```bash 24 | python examples/avatar/agent_worker.py dev [--avatar-url http://localhost:8089/launch] 25 | ``` 26 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/beta/tools/send_dtmf.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | 3 | from ... import function_tool 4 | from ...job import get_job_context 5 | from ..workflows.utils import DtmfEvent, dtmf_event_to_code 6 | 7 | DEFAULT_DTMF_PUBLISH_DELAY = 0.3 # seconds to wait between sending DTMF events 8 | 9 | 10 | @function_tool 11 | async def send_dtmf_events( 12 | events: list[DtmfEvent], 13 | ) -> str: 14 | """ 15 | Send a list of DTMF events to the telephony provider. 16 | 17 | Call when: 18 | - User wants to send DTMF events 19 | """ 20 | job_ctx = get_job_context() 21 | 22 | for event in events: 23 | try: 24 | code = dtmf_event_to_code(event) 25 | await job_ctx.room.local_participant.publish_dtmf(code=code, digit=event.value) 26 | await asyncio.sleep(DEFAULT_DTMF_PUBLISH_DELAY) 27 | except Exception as e: 28 | return f"Failed to send DTMF event: {event.value}. Error: {str(e)}" 29 | 30 | return f"Successfully sent DTMF events: {', '.join(events)}" 31 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechify/livekit/plugins/speechify/models.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from typing import Literal 15 | 16 | TTSModels = Literal[ 17 | "simba-english", 18 | "simba-multilingual", 19 | ] 20 | 21 | TTSEncoding = Literal[ 22 | "mp3_24000", 23 | "wav_48000", 24 | "ogg_24000", 25 | "aac_24000", 26 | ] 27 | 28 | VoiceType = Literal["shared", "personal"] 29 | Gender = Literal["male", "female", "neutral"] 30 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/aio/task_set.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import asyncio 4 | from collections.abc import Coroutine 5 | from typing import Any, TypeVar 6 | 7 | _T = TypeVar("_T") 8 | 9 | 10 | class TaskSet: 11 | """Small utility to create tasks in a fire-and-forget fashion.""" 12 | 13 | def __init__(self, loop: asyncio.AbstractEventLoop | None = None) -> None: 14 | self._loop = loop or asyncio.get_event_loop() 15 | self._set = set[asyncio.Task[Any]]() 16 | self._closed = False 17 | 18 | def create_task( 19 | self, coro: Coroutine[Any, Any, _T], name: str | None = None 20 | ) -> asyncio.Task[_T]: 21 | if self._closed: 22 | raise RuntimeError("TaskSet is closed") 23 | 24 | task = self._loop.create_task(coro, name=name) 25 | self._set.add(task) 26 | task.add_done_callback(self._set.remove) 27 | return task 28 | 29 | @property 30 | def tasks(self) -> set[asyncio.Task[Any]]: 31 | return self._set.copy() 32 | -------------------------------------------------------------------------------- /examples/avatar_agents/bey/agent_worker.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | from dotenv import load_dotenv 5 | 6 | from livekit.agents import Agent, AgentServer, AgentSession, JobContext, cli 7 | from livekit.plugins import bey, openai 8 | 9 | logger = logging.getLogger("bey-avatar-example") 10 | logger.setLevel(logging.INFO) 11 | 12 | load_dotenv() 13 | 14 | server = AgentServer() 15 | 16 | 17 | @server.rtc_session() 18 | async def entrypoint(ctx: JobContext): 19 | session = AgentSession( 20 | llm=openai.realtime.RealtimeModel(voice="alloy"), 21 | resume_false_interruption=False, 22 | ) 23 | 24 | avatar_id = os.getenv("BEY_AVATAR_ID") 25 | bey_avatar = bey.AvatarSession(avatar_id=avatar_id) 26 | await bey_avatar.start(session, room=ctx.room) 27 | 28 | await session.start( 29 | agent=Agent(instructions="Talk to me!"), 30 | room=ctx.room, 31 | ) 32 | 33 | session.generate_reply(instructions="say hello to the user") 34 | 35 | 36 | if __name__ == "__main__": 37 | cli.run_app(server) 38 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/stt/__init__.py: -------------------------------------------------------------------------------- 1 | from .fallback_adapter import AvailabilityChangedEvent, FallbackAdapter 2 | from .multi_speaker_adapter import MultiSpeakerAdapter 3 | from .stream_adapter import StreamAdapter, StreamAdapterWrapper 4 | from .stt import ( 5 | STT, 6 | RecognitionUsage, 7 | RecognizeStream, 8 | SpeechData, 9 | SpeechEvent, 10 | SpeechEventType, 11 | SpeechStream, 12 | STTCapabilities, 13 | STTError, 14 | ) 15 | 16 | __all__ = [ 17 | "SpeechEventType", 18 | "SpeechEvent", 19 | "SpeechData", 20 | "RecognizeStream", 21 | "SpeechStream", 22 | "STT", 23 | "STTCapabilities", 24 | "StreamAdapter", 25 | "StreamAdapterWrapper", 26 | "RecognitionUsage", 27 | "FallbackAdapter", 28 | "AvailabilityChangedEvent", 29 | "STTError", 30 | "MultiSpeakerAdapter", 31 | ] 32 | 33 | # Cleanup docs of unexported modules 34 | _module = dir() 35 | NOT_IN_ALL = [m for m in _module if m not in __all__] 36 | 37 | __pdoc__ = {} 38 | 39 | for n in NOT_IN_ALL: 40 | __pdoc__[n] = False 41 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/voice/transcription/_utils.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from livekit import rtc 4 | 5 | from ...utils import shortuuid 6 | 7 | 8 | def find_micro_track_id(room: rtc.Room, identity: str) -> str: 9 | p: rtc.RemoteParticipant | rtc.LocalParticipant | None = room.remote_participants.get(identity) 10 | if identity == room.local_participant.identity: 11 | p = room.local_participant 12 | 13 | if p is None: 14 | raise ValueError(f"participant {identity} not found") 15 | 16 | # find first micro track 17 | track_id = None 18 | for track in p.track_publications.values(): 19 | if track.source == rtc.TrackSource.SOURCE_MICROPHONE: 20 | track_id = track.sid 21 | break 22 | 23 | if track_id is None: 24 | raise ValueError(f"participant {identity} does not have a microphone track") 25 | 26 | return track_id 27 | 28 | 29 | def segment_uuid() -> str: 30 | return shortuuid("SG_") 31 | 32 | 33 | def speech_uuid() -> str: 34 | return shortuuid("SP_") 35 | -------------------------------------------------------------------------------- /livekit-agents/README.md: -------------------------------------------------------------------------------- 1 | # LiveKit Agents for Python 2 | 3 | Realtime framework for production-grade multimodal and voice AI agents. 4 | 5 | See [https://docs.livekit.io/agents/](https://docs.livekit.io/agents/) for quickstarts, documentation, and examples. 6 | 7 | ```python 8 | from dotenv import load_dotenv 9 | 10 | from livekit import agents 11 | from livekit.agents import AgentSession, Agent, RoomInputOptions 12 | from livekit.plugins import openai 13 | 14 | load_dotenv() 15 | 16 | async def entrypoint(ctx: agents.JobContext): 17 | await ctx.connect() 18 | 19 | session = AgentSession( 20 | llm=openai.realtime.RealtimeModel( 21 | voice="coral" 22 | ) 23 | ) 24 | 25 | await session.start( 26 | room=ctx.room, 27 | agent=Agent(instructions="You are a helpful voice AI assistant.") 28 | ) 29 | 30 | await session.generate_reply( 31 | instructions="Greet the user and offer your assistance." 32 | ) 33 | 34 | 35 | if __name__ == "__main__": 36 | agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint)) 37 | ``` 38 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/src/resources/lkcefapp-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | lkcef_app 9 | CFBundleIdentifier 10 | io.livekit.cef 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | lkcef-agents 15 | CFBundlePackageType 16 | APPL 17 | CFBundleSignature 18 | ???? 19 | LSEnvironment 20 | 21 | MallocNanoZone 22 | 0 23 | 24 | LSFileQuarantineEnabled 25 | 26 | LSMinimumSystemVersion 27 | 10.11.0 28 | LSUIElement 29 | 1 30 | NSSupportsAutomaticGraphicsSwitching 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fishaudio/livekit/plugins/fishaudio/__init__.py: -------------------------------------------------------------------------------- 1 | """Fish Audio plugin for LiveKit Agents 2 | 3 | See https://docs.fish.audio for more information. 4 | 5 | Environment variables used: 6 | - `FISH_API_KEY` for authentication (required) 7 | """ 8 | 9 | from fish_audio_sdk.schemas import Backends # type: ignore[import-untyped] 10 | 11 | from livekit.agents import Plugin 12 | 13 | from .log import logger 14 | from .models import LatencyMode, OutputFormat 15 | from .tts import TTS 16 | from .version import __version__ 17 | 18 | __all__ = [ 19 | "TTS", 20 | "Backends", 21 | "OutputFormat", 22 | "LatencyMode", 23 | "__version__", 24 | ] 25 | 26 | 27 | class FishAudioPlugin(Plugin): 28 | def __init__(self) -> None: 29 | super().__init__(__name__, __version__, __package__ or "", logger) 30 | 31 | 32 | Plugin.register_plugin(FishAudioPlugin()) 33 | 34 | # Cleanup docs of unexported modules 35 | _module = dir() 36 | NOT_IN_ALL = [m for m in _module if m not in __all__] 37 | 38 | __pdoc__ = {} 39 | 40 | for n in NOT_IN_ALL: 41 | __pdoc__[n] = False 42 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimal/livekit/plugins/minimal/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Minimal example plugin for LiveKit Agents 16 | 17 | This is a stubbed example plugin. 18 | """ 19 | 20 | from livekit.agents import Plugin 21 | 22 | from .log import logger 23 | from .version import __version__ 24 | 25 | 26 | class MinimalPlugin(Plugin): 27 | def __init__(self) -> None: 28 | super().__init__(__name__, __version__, __package__, logger) 29 | 30 | 31 | Plugin.register_plugin(MinimalPlugin()) 32 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/ipc/job_executor.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from enum import Enum 4 | from typing import Any, Protocol 5 | 6 | from ..job import RunningJobInfo 7 | 8 | 9 | class JobExecutor(Protocol): 10 | @property 11 | def id(self) -> str: ... 12 | 13 | @property 14 | def started(self) -> bool: ... 15 | 16 | @property 17 | def user_arguments(self) -> Any | None: ... 18 | 19 | @user_arguments.setter 20 | def user_arguments(self, value: Any | None) -> None: ... 21 | 22 | @property 23 | def running_job(self) -> RunningJobInfo | None: ... 24 | 25 | @property 26 | def status(self) -> JobStatus: ... 27 | 28 | async def start(self) -> None: ... 29 | 30 | async def join(self) -> None: ... 31 | 32 | async def initialize(self) -> None: ... 33 | 34 | async def aclose(self) -> None: ... 35 | 36 | async def launch_job(self, info: RunningJobInfo) -> None: ... 37 | 38 | def logging_extra(self) -> dict[str, Any]: ... 39 | 40 | 41 | class JobStatus(Enum): 42 | RUNNING = "running" 43 | FAILED = "failed" 44 | SUCCESS = "success" 45 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/misc.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import platform 4 | import re 5 | import time 6 | import uuid 7 | from typing import TypeVar 8 | from urllib.parse import urlparse 9 | 10 | from typing_extensions import TypeGuard 11 | 12 | from ..types import NotGiven, NotGivenOr 13 | 14 | _T = TypeVar("_T") 15 | 16 | 17 | def time_ms() -> int: 18 | return int(time.time() * 1000 + 0.5) 19 | 20 | 21 | def shortuuid(prefix: str = "") -> str: 22 | return prefix + str(uuid.uuid4().hex)[:12] 23 | 24 | 25 | def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: 26 | return not isinstance(obj, NotGiven) 27 | 28 | 29 | def nodename() -> str: 30 | return platform.node() 31 | 32 | 33 | def camel_to_snake_case(name: str) -> str: 34 | return re.sub( 35 | r"([a-z0-9])([A-Z])", r"\1_\2", re.sub(r"([A-Z]+)([A-Z][a-z])", r"\1_\2", name) 36 | ).lower() 37 | 38 | 39 | def is_cloud(url: str) -> bool: 40 | hostname = urlparse(url).hostname 41 | if hostname is None: 42 | return False 43 | return hostname.endswith(".livekit.cloud") or hostname.endswith(".livekit.run") 44 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/tts/__init__.py: -------------------------------------------------------------------------------- 1 | from .fallback_adapter import ( 2 | AvailabilityChangedEvent, 3 | FallbackAdapter, 4 | FallbackChunkedStream, 5 | FallbackSynthesizeStream, 6 | ) 7 | from .stream_adapter import StreamAdapter, StreamAdapterWrapper 8 | from .stream_pacer import SentenceStreamPacer 9 | from .tts import ( 10 | TTS, 11 | AudioEmitter, 12 | ChunkedStream, 13 | SynthesizedAudio, 14 | SynthesizeStream, 15 | TTSCapabilities, 16 | TTSError, 17 | ) 18 | 19 | __all__ = [ 20 | "TTS", 21 | "SynthesizedAudio", 22 | "SynthesizeStream", 23 | "TTSCapabilities", 24 | "StreamAdapterWrapper", 25 | "StreamAdapter", 26 | "ChunkedStream", 27 | "AvailabilityChangedEvent", 28 | "FallbackAdapter", 29 | "FallbackChunkedStream", 30 | "FallbackSynthesizeStream", 31 | "AudioEmitter", 32 | "TTSError", 33 | "SentenceStreamPacer", 34 | ] 35 | 36 | 37 | # Cleanup docs of unexported modules 38 | _module = dir() 39 | NOT_IN_ALL = [m for m in _module if m not in __all__] 40 | 41 | __pdoc__ = {} 42 | 43 | for n in NOT_IN_ALL: 44 | __pdoc__[n] = False 45 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-openai/README.md: -------------------------------------------------------------------------------- 1 | # OpenAI plugin for LiveKit Agents 2 | 3 | Support for OpenAI Realtime API, LLM, TTS, and STT APIs. 4 | 5 | Also includes support for a large number of OpenAI-compatible APIs including [Azure OpenAI](https://docs.livekit.io/agents/integrations/llm/azure-openai/), [Cerebras](https://docs.livekit.io/agents/integrations/cerebras/), [Fireworks](https://docs.livekit.io/agents/integrations/llm/fireworks/), [Perplexity](https://docs.livekit.io/agents/integrations/llm/perplexity/), [Telnyx](https://docs.livekit.io/agents/integrations/llm/telnyx/), [xAI](https://docs.livekit.io/agents/integrations/llm/xai/), [Ollama](https://docs.livekit.io/agents/integrations/llm/ollama/), and [DeepSeek](https://docs.livekit.io/agents/integrations/llm/deepseek/). 6 | 7 | See [https://docs.livekit.io/agents/integrations/openai/](https://docs.livekit.io/agents/integrations/openai/) for more information. 8 | 9 | ## Installation 10 | 11 | ```bash 12 | pip install livekit-plugins-openai 13 | ``` 14 | 15 | ## Pre-requisites 16 | 17 | You'll need an API key from OpenAI. It can be set as an environment variable: `OPENAI_API_KEY` 18 | -------------------------------------------------------------------------------- /examples/avatar_agents/liveavatar/agent_worker.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | from dotenv import load_dotenv 5 | 6 | from livekit.agents import Agent, AgentSession, JobContext, WorkerOptions, cli 7 | from livekit.plugins import deepgram, liveavatar, openai 8 | 9 | logger = logging.getLogger("liveavatar-avatar-example") 10 | logger.setLevel(logging.INFO) 11 | 12 | load_dotenv() 13 | 14 | 15 | async def entrypoint(ctx: JobContext): 16 | session = AgentSession( 17 | stt=deepgram.STT(), 18 | llm=openai.LLM(), 19 | tts=openai.TTS(), 20 | resume_false_interruption=False, 21 | ) 22 | 23 | liveavatar_avatar_id = os.getenv("LIVEAVATAR_AVATAR_ID") 24 | avatar = liveavatar.AvatarSession(avatar_id=liveavatar_avatar_id) 25 | await avatar.start(session, room=ctx.room) 26 | 27 | agent = Agent(instructions="Talk to me!") 28 | 29 | await session.start( 30 | agent=agent, 31 | room=ctx.room, 32 | ) 33 | 34 | session.generate_reply(instructions="say hello to the user") 35 | 36 | 37 | if __name__ == "__main__": 38 | cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint)) 39 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hedra/livekit/plugins/hedra/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from .avatar import AvatarSession, HedraException 17 | from .version import __version__ 18 | 19 | __all__ = [ 20 | "HedraException", 21 | "AvatarSession", 22 | "__version__", 23 | ] 24 | 25 | from livekit.agents import Plugin 26 | 27 | from .log import logger 28 | 29 | 30 | class HedraPlugin(Plugin): 31 | def __init__(self) -> None: 32 | super().__init__(__name__, __version__, __package__, logger) 33 | 34 | 35 | Plugin.register_plugin(HedraPlugin()) 36 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Contextually-aware turn detection for LiveKit Agents 16 | 17 | See https://docs.livekit.io/agents/build/turns/turn-detector/ for more information. 18 | """ 19 | 20 | from .version import __version__ 21 | 22 | __all__ = ["english", "multilingual", "__version__"] 23 | 24 | 25 | # Cleanup docs of unexported modules 26 | _module = dir() 27 | NOT_IN_ALL = [m for m in _module if m not in __all__] 28 | 29 | __pdoc__ = {} 30 | 31 | for n in NOT_IN_ALL: 32 | __pdoc__[n] = False 33 | -------------------------------------------------------------------------------- /examples/avatar_agents/hedra/agent_worker.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | from dotenv import load_dotenv 5 | from PIL import Image 6 | 7 | from livekit.agents import Agent, AgentServer, AgentSession, JobContext, cli 8 | from livekit.plugins import hedra, openai 9 | 10 | logger = logging.getLogger("hedra-avatar-example") 11 | logger.setLevel(logging.INFO) 12 | 13 | load_dotenv() 14 | 15 | server = AgentServer() 16 | 17 | 18 | @server.rtc_session() 19 | async def entrypoint(ctx: JobContext): 20 | session = AgentSession( 21 | llm=openai.realtime.RealtimeModel(voice="alloy"), 22 | resume_false_interruption=False, 23 | ) 24 | 25 | # upload an avatar image or use an avatar id from hedra 26 | avatar_image = Image.open(os.path.join(os.path.dirname(__file__), "avatar.jpg")) 27 | hedra_avatar = hedra.AvatarSession(avatar_image=avatar_image) 28 | await hedra_avatar.start(session, room=ctx.room) 29 | 30 | await session.start( 31 | agent=Agent(instructions="Talk to me!"), 32 | room=ctx.room, 33 | ) 34 | 35 | session.generate_reply(instructions="say hello to the user") 36 | 37 | 38 | if __name__ == "__main__": 39 | cli.run_app(server) 40 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/english.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from livekit.agents import Plugin 4 | from livekit.agents.inference_runner import _InferenceRunner 5 | 6 | from .base import EOUModelBase, EOUPlugin, _EUORunnerBase 7 | from .models import EOUModelType 8 | 9 | 10 | class _EUORunnerEn(_EUORunnerBase): 11 | INFERENCE_METHOD = "lk_end_of_utterance_en" 12 | 13 | @classmethod 14 | def model_type(cls) -> EOUModelType: 15 | return "en" 16 | 17 | def _normalize_text(self, text: str) -> str: 18 | """ 19 | The english model is trained on the original chat context without normalization. 20 | """ 21 | if not text: 22 | return "" 23 | 24 | return text 25 | 26 | 27 | class EnglishModel(EOUModelBase): 28 | def __init__(self, *, unlikely_threshold: float | None = None): 29 | super().__init__(model_type="en", unlikely_threshold=unlikely_threshold) 30 | 31 | def _inference_method(self) -> str: 32 | return _EUORunnerEn.INFERENCE_METHOD 33 | 34 | 35 | _InferenceRunner.register_runner(_EUORunnerEn) 36 | Plugin.register_plugin(EOUPlugin(_EUORunnerEn)) 37 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/src/resources/lkcefhelper-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${EXECUTABLE_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | io.livekit.cef.helper${BUNDLE_ID_SUFFIX} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | LSEnvironment 22 | 23 | MallocNanoZone 24 | 0 25 | 26 | LSFileQuarantineEnabled 27 | 28 | LSMinimumSystemVersion 29 | 10.11.0 30 | LSUIElement 31 | 1 32 | NSSupportsAutomaticGraphicsSwitching 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /examples/avatar_agents/tavus/agent_worker.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | from dotenv import load_dotenv 5 | 6 | from livekit.agents import Agent, AgentServer, AgentSession, JobContext, cli 7 | from livekit.plugins import openai, tavus 8 | 9 | logger = logging.getLogger("tavus-avatar-example") 10 | logger.setLevel(logging.INFO) 11 | 12 | load_dotenv() 13 | 14 | server = AgentServer() 15 | 16 | 17 | @server.rtc_session() 18 | async def entrypoint(ctx: JobContext): 19 | session = AgentSession( 20 | llm=openai.realtime.RealtimeModel(voice="alloy"), 21 | resume_false_interruption=False, 22 | ) 23 | 24 | persona_id = os.getenv("TAVUS_PERSONA_ID") 25 | replica_id = os.getenv("TAVUS_REPLICA_ID") 26 | tavus_avatar = tavus.AvatarSession(persona_id=persona_id, replica_id=replica_id) 27 | await tavus_avatar.start(session, room=ctx.room) 28 | 29 | # start the agent, it will join the room and wait for the avatar to join 30 | await session.start( 31 | agent=Agent(instructions="Talk to me!"), 32 | room=ctx.room, 33 | ) 34 | 35 | session.generate_reply(instructions="say hello to the user") 36 | 37 | 38 | if __name__ == "__main__": 39 | cli.run_app(server) 40 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/voice/room_io/__init__.py: -------------------------------------------------------------------------------- 1 | from ...types import ATTRIBUTE_PUBLISH_ON_BEHALF 2 | from ._output import ( 3 | _ParticipantAudioOutput, 4 | _ParticipantStreamTranscriptionOutput, 5 | _ParticipantTranscriptionOutput, 6 | ) 7 | from .room_io import RoomIO 8 | from .types import ( 9 | AudioInputOptions, 10 | AudioOutputOptions, 11 | RoomInputOptions, 12 | RoomOptions, 13 | RoomOutputOptions, 14 | TextInputEvent, 15 | TextInputOptions, 16 | TextOutputOptions, 17 | VideoInputOptions, 18 | ) 19 | 20 | __all__ = [ 21 | "RoomIO", 22 | "RoomOptions", 23 | "RoomInputOptions", 24 | "RoomOutputOptions", 25 | "ATTRIBUTE_PUBLISH_ON_BEHALF", 26 | "TextInputEvent", 27 | "TextInputOptions", 28 | "AudioInputOptions", 29 | "AudioOutputOptions", 30 | "TextOutputOptions", 31 | "VideoInputOptions", 32 | "_ParticipantTranscriptionOutput", 33 | "_ParticipantAudioOutput", 34 | "_ParticipantStreamTranscriptionOutput", 35 | ] 36 | 37 | # Cleanup docs of unexported modules 38 | _module = dir() 39 | NOT_IN_ALL = [m for m in _module if m not in __all__] 40 | 41 | __pdoc__ = {} 42 | 43 | for n in NOT_IN_ALL: 44 | __pdoc__[n] = False 45 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anam/livekit/plugins/anam/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from .avatar import AvatarSession 16 | from .errors import AnamException 17 | from .types import PersonaConfig 18 | from .version import __version__ 19 | 20 | __all__ = [ 21 | "AnamException", 22 | "AvatarSession", 23 | "PersonaConfig", 24 | "__version__", 25 | ] 26 | 27 | from livekit.agents import Plugin 28 | 29 | from .log import logger 30 | 31 | 32 | class AnamPlugin(Plugin): 33 | def __init__(self) -> None: 34 | super().__init__(__name__, __version__, __package__, logger) 35 | 36 | 37 | Plugin.register_plugin(AnamPlugin()) 38 | -------------------------------------------------------------------------------- /examples/voice_agents/nvidia_test.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from dotenv import load_dotenv 4 | 5 | from livekit.agents import ( 6 | Agent, 7 | AgentSession, 8 | JobContext, 9 | JobProcess, 10 | WorkerOptions, 11 | cli, 12 | ) 13 | from livekit.plugins import nvidia, openai, silero 14 | from livekit.plugins.turn_detector.multilingual import MultilingualModel 15 | 16 | logger = logging.getLogger("basic-agent") 17 | 18 | load_dotenv() 19 | 20 | 21 | def prewarm(proc: JobProcess): 22 | proc.userdata["vad"] = silero.VAD.load() 23 | 24 | 25 | async def entrypoint(ctx: JobContext): 26 | session = AgentSession( 27 | vad=ctx.proc.userdata["vad"], 28 | llm=openai.LLM(model="gpt-4o-mini"), 29 | stt=nvidia.STT(), 30 | tts=nvidia.TTS(), 31 | preemptive_generation=True, 32 | resume_false_interruption=True, 33 | false_interruption_timeout=1.0, 34 | min_interruption_duration=0.2, 35 | turn_detection=MultilingualModel(), 36 | ) 37 | 38 | await session.start( 39 | agent=Agent(instructions="You are a helpful voice AI assistant."), 40 | room=ctx.room, 41 | ) 42 | 43 | 44 | if __name__ == "__main__": 45 | cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, prewarm_fnc=prewarm)) 46 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rime/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-rime" 7 | dynamic = ["version"] 8 | description = "LiveKit Agents Plugin for Rime" 9 | readme = "README.md" 10 | license = "Apache-2.0" 11 | requires-python = ">=3.9.0" 12 | authors = [{ name = "LiveKit", email = "hello@livekit.io" }] 13 | keywords = ["webrtc", "realtime", "audio", "video", "livekit", "rime"] 14 | classifiers = [ 15 | "Intended Audience :: Developers", 16 | "Topic :: Multimedia :: Sound/Audio", 17 | "Topic :: Scientific/Engineering :: Artificial Intelligence", 18 | "Programming Language :: Python :: 3", 19 | "Programming Language :: Python :: 3.11", 20 | "Programming Language :: Python :: 3.12", 21 | "Programming Language :: Python :: 3 :: Only", 22 | ] 23 | dependencies = ["livekit-agents[codecs]>=1.3.8"] 24 | 25 | [project.urls] 26 | Documentation = "https://docs.livekit.io" 27 | Website = "https://livekit.io/" 28 | Source = "https://github.com/livekit/agents" 29 | 30 | [tool.hatch.version] 31 | path = "livekit/plugins/rime/version.py" 32 | 33 | [tool.hatch.build.targets.wheel] 34 | packages = ["livekit"] 35 | 36 | [tool.hatch.build.targets.sdist] 37 | include = ["/livekit"] 38 | -------------------------------------------------------------------------------- /examples/avatar_agents/simli/agent_worker.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | from dotenv import load_dotenv 5 | 6 | from livekit.agents import Agent, AgentServer, AgentSession, JobContext, cli 7 | from livekit.plugins import openai, simli 8 | 9 | # from livekit.plugins import deepgram, elevenlabs, silero 10 | 11 | logger = logging.getLogger("simli-avatar-example") 12 | logger.setLevel(logging.INFO) 13 | 14 | load_dotenv() 15 | 16 | server = AgentServer() 17 | 18 | 19 | @server.rtc_session() 20 | async def entrypoint(ctx: JobContext): 21 | session = AgentSession( 22 | llm=openai.realtime.RealtimeModel(voice="alloy"), 23 | resume_false_interruption=False, 24 | ) 25 | 26 | simliAPIKey = os.getenv("SIMLI_API_KEY") 27 | simliFaceID = os.getenv("SIMLI_FACE_ID") 28 | 29 | simli_avatar = simli.AvatarSession( 30 | simli_config=simli.SimliConfig( 31 | api_key=simliAPIKey, 32 | face_id=simliFaceID, 33 | ), 34 | ) 35 | await simli_avatar.start(session, room=ctx.room) 36 | 37 | # start the agent, it will join the room and wait for the avatar to join 38 | await session.start( 39 | agent=Agent(instructions="Talk to me!"), 40 | room=ctx.room, 41 | ) 42 | 43 | 44 | if __name__ == "__main__": 45 | cli.run_app(server) 46 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/http_server.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import asyncio 4 | 5 | from aiohttp import web 6 | 7 | 8 | class HttpServer: 9 | def __init__(self, host: str, port: int, loop: asyncio.AbstractEventLoop | None = None) -> None: 10 | self._loop = loop or asyncio.get_event_loop() 11 | self._host = host 12 | self._port = port 13 | self._app = web.Application(loop=self._loop) 14 | self._lock = asyncio.Lock() 15 | 16 | @property 17 | def app(self) -> web.Application: 18 | return self._app 19 | 20 | @property 21 | def host(self) -> str: 22 | return self._host 23 | 24 | @property 25 | def port(self) -> int: 26 | return self._port 27 | 28 | async def start(self) -> None: 29 | async with self._lock: 30 | handler = self._app.make_handler() 31 | self._server = await self._loop.create_server(handler, self._host, self._port) 32 | 33 | if self._port == 0: 34 | self._port = self._server.sockets[0].getsockname()[1] 35 | 36 | await self._server.start_serving() 37 | 38 | async def aclose(self) -> None: 39 | async with self._lock: 40 | self._server.close() 41 | await self._server.wait_closed() 42 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-spitch/livekit/plugins/spitch/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Spitch plugin for LiveKit Agents""" 16 | 17 | from .stt import STT 18 | from .tts import TTS 19 | from .version import __version__ 20 | 21 | __all__ = ["STT", "TTS", "__version__"] 22 | 23 | from livekit.agents import Plugin 24 | 25 | from .log import logger 26 | 27 | 28 | class SpitchPlugin(Plugin): 29 | def __init__(self): 30 | super().__init__(__name__, __version__, __package__, logger) 31 | 32 | 33 | Plugin.register_plugin(SpitchPlugin()) 34 | 35 | _module = dir() 36 | NOT_IN_ALL = [m for m in _module if m not in __all__] 37 | 38 | __pdoc__ = {} 39 | 40 | for n in NOT_IN_ALL: 41 | __pdoc__[n] = False 42 | -------------------------------------------------------------------------------- /examples/voice_agents/resume_interrupted_agent.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | from dotenv import load_dotenv 4 | 5 | from livekit.agents import Agent, AgentServer, AgentSession, JobContext, cli 6 | from livekit.plugins import cartesia, deepgram, openai, silero 7 | 8 | logger = logging.getLogger("resume-agent") 9 | 10 | load_dotenv() 11 | 12 | # This example shows how to resume an agent from a false interruption. 13 | # If `resume_false_interruption` is True, the agent will first pause the audio output 14 | # while not interrupting the speech before the `false_interruption_timeout` expires. 15 | # If there is not new user input after the pause, the agent will resume the output for the same speech. 16 | # If there is new user input, the agent will interrupt the speech immediately. 17 | 18 | server = AgentServer() 19 | 20 | 21 | @server.rtc_session() 22 | async def entrypoint(ctx: JobContext): 23 | session = AgentSession( 24 | vad=silero.VAD.load(), 25 | llm=openai.LLM(model="gpt-4o-mini"), 26 | stt=deepgram.STT(), 27 | tts=cartesia.TTS(), 28 | false_interruption_timeout=1.0, 29 | resume_false_interruption=True, 30 | ) 31 | 32 | await session.start(agent=Agent(instructions="You are a helpful assistant."), room=ctx.room) 33 | 34 | 35 | if __name__ == "__main__": 36 | cli.run_app(server) 37 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from livekit import rtc 2 | 3 | from . import aio, audio, codecs, http_context, http_server, hw, images 4 | from .audio import AudioBuffer, combine_frames, merge_frames 5 | from .bounded_dict import BoundedDict 6 | from .connection_pool import ConnectionPool 7 | from .exp_filter import ExpFilter 8 | from .log import log_exceptions 9 | from .misc import is_given, nodename, shortuuid, time_ms 10 | from .moving_average import MovingAverage 11 | from .participant import wait_for_participant, wait_for_track_publication 12 | 13 | EventEmitter = rtc.EventEmitter 14 | 15 | __all__ = [ 16 | "AudioBuffer", 17 | "merge_frames", 18 | "combine_frames", 19 | "time_ms", 20 | "nodename", 21 | "shortuuid", 22 | "http_context", 23 | "http_server", 24 | "ExpFilter", 25 | "MovingAverage", 26 | "BoundedDict", 27 | "EventEmitter", 28 | "log_exceptions", 29 | "codecs", 30 | "images", 31 | "audio", 32 | "aio", 33 | "hw", 34 | "is_given", 35 | "ConnectionPool", 36 | "wait_for_participant", 37 | "wait_for_track_publication", 38 | ] 39 | 40 | # Cleanup docs of unexported modules 41 | _module = dir() 42 | NOT_IN_ALL = [m for m in _module if m not in __all__] 43 | 44 | __pdoc__ = {} 45 | 46 | for n in NOT_IN_ALL: 47 | __pdoc__[n] = False 48 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-neuphonic/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-neuphonic" 7 | dynamic = ["version"] 8 | description = "Neuphonic inference plugin for LiveKit Agents" 9 | readme = "README.md" 10 | license = "Apache-2.0" 11 | requires-python = ">=3.9.0" 12 | authors = [{ name = "LiveKit", email = "hello@livekit.io" }] 13 | keywords = ["voice", "ai", "realtime", "audio", "video", "livekit", "neuphonic"] 14 | classifiers = [ 15 | "Intended Audience :: Developers", 16 | "Topic :: Multimedia :: Sound/Audio", 17 | "Topic :: Scientific/Engineering :: Artificial Intelligence", 18 | "Programming Language :: Python :: 3", 19 | "Programming Language :: Python :: 3.11", 20 | "Programming Language :: Python :: 3.12", 21 | "Programming Language :: Python :: 3 :: Only", 22 | ] 23 | dependencies = [ 24 | "livekit-agents>=1.3.8", 25 | ] 26 | 27 | [project.urls] 28 | Documentation = "https://docs.livekit.io" 29 | Website = "https://livekit.io/" 30 | Source = "https://github.com/livekit/agents" 31 | 32 | [tool.hatch.version] 33 | path = "livekit/plugins/neuphonic/version.py" 34 | 35 | [tool.hatch.build.targets.wheel] 36 | packages = ["livekit"] 37 | 38 | [tool.hatch.build.targets.sdist] 39 | include = ["/livekit"] 40 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-simli/livekit/plugins/simli/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Simli virtual avatar plugin for LiveKit Agents 16 | 17 | See https://docs.livekit.io/agents/integrations/avatar/simli/ for more information. 18 | """ 19 | 20 | from .avatar import AvatarSession, SimliConfig 21 | from .version import __version__ 22 | 23 | __all__ = [ 24 | "Exception", 25 | "AvatarSession", 26 | "__version__", 27 | "SimliConfig", 28 | ] 29 | 30 | from livekit.agents import Plugin 31 | 32 | from .log import logger 33 | 34 | 35 | class SimliPlugin(Plugin): 36 | def __init__(self) -> None: 37 | super().__init__(__name__, __version__, __package__, logger) 38 | 39 | 40 | Plugin.register_plugin(SimliPlugin()) 41 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/inference_runner.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import threading 4 | from abc import ABC, abstractmethod 5 | from typing import ClassVar, Protocol 6 | 7 | 8 | class _RunnerMeta(Protocol): 9 | INFERENCE_METHOD: ClassVar[str] 10 | 11 | 12 | _RunnersDict = dict[str, type["_InferenceRunner"]] 13 | 14 | 15 | # kept private until we stabilize the API (only used for EOU today) 16 | class _InferenceRunner(ABC, _RunnerMeta): 17 | registered_runners: _RunnersDict = {} 18 | 19 | @classmethod 20 | def register_runner(cls, runner_class: type[_InferenceRunner]) -> None: 21 | if threading.current_thread() != threading.main_thread(): 22 | raise RuntimeError("InferenceRunner must be registered on the main thread") 23 | 24 | if runner_class.INFERENCE_METHOD in cls.registered_runners: 25 | raise ValueError(f"InferenceRunner {runner_class.INFERENCE_METHOD} already registered") 26 | 27 | cls.registered_runners[runner_class.INFERENCE_METHOD] = runner_class 28 | 29 | @abstractmethod 30 | def initialize(self) -> None: 31 | """Initialize the runner. This is used to load models, etc.""" 32 | ... 33 | 34 | @abstractmethod 35 | def run(self, data: bytes) -> bytes | None: 36 | """Run inference on the given data.""" 37 | ... 38 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-tavus/livekit/plugins/tavus/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Tavus virtual avatar plugin for LiveKit Agents 16 | 17 | See https://docs.livekit.io/agents/integrations/avatar/tavus/ for more information. 18 | """ 19 | 20 | from .api import TavusException 21 | from .avatar import AvatarSession 22 | from .version import __version__ 23 | 24 | __all__ = [ 25 | "TavusException", 26 | "AvatarSession", 27 | "__version__", 28 | ] 29 | 30 | from livekit.agents import Plugin 31 | 32 | from .log import logger 33 | 34 | 35 | class TavusPlugin(Plugin): 36 | def __init__(self) -> None: 37 | super().__init__(__name__, __version__, __package__, logger) 38 | 39 | 40 | Plugin.register_plugin(TavusPlugin()) 41 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hume/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-hume" 7 | dynamic = ["version"] 8 | description = "Hume TTS plugin for LiveKit agents" 9 | readme = "README.md" 10 | license = "Apache-2.0" 11 | requires-python = ">=3.9.0" 12 | authors = [ 13 | {name = "LiveKit", email = "info@livekit.io"} 14 | ] 15 | keywords = ["voice", "ai", "realtime", "audio", "video", "livekit", "HumeAI", "Hume", "Octave"] 16 | classifiers = [ 17 | "Intended Audience :: Developers", 18 | "Topic :: Multimedia :: Sound/Audio", 19 | "Topic :: Scientific/Engineering :: Artificial Intelligence", 20 | "Programming Language :: Python :: 3", 21 | "Programming Language :: Python :: 3.11", 22 | "Programming Language :: Python :: 3.12", 23 | "Programming Language :: Python :: 3 :: Only", 24 | ] 25 | dependencies = [ 26 | "aiohttp>=3.8.0", 27 | "livekit-agents>=1.3.8", 28 | ] 29 | 30 | [project.urls] 31 | Documentation = "https://docs.livekit.io" 32 | Website = "https://livekit.io/" 33 | Source = "https://github.com/livekit/agents" 34 | 35 | [tool.hatch.version] 36 | path = "livekit/plugins/hume/version.py" 37 | 38 | [tool.hatch.build.targets.wheel] 39 | packages = ["livekit"] 40 | 41 | [tool.hatch.build.targets.sdist] 42 | include = ["/livekit"] -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-groq/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-groq" 7 | dynamic = ["version"] 8 | description = "Groq inference plugin for LiveKit Agents" 9 | readme = "README.md" 10 | license = "Apache-2.0" 11 | requires-python = ">=3.9.0" 12 | authors = [{ name = "LiveKit", email = "hello@livekit.io" }] 13 | keywords = ["voice", "ai", "realtime", "audio", "video", "livekit", "groq"] 14 | classifiers = [ 15 | "Intended Audience :: Developers", 16 | "Topic :: Multimedia :: Sound/Audio", 17 | "Topic :: Scientific/Engineering :: Artificial Intelligence", 18 | "Programming Language :: Python :: 3", 19 | "Programming Language :: Python :: 3.11", 20 | "Programming Language :: Python :: 3.12", 21 | "Programming Language :: Python :: 3 :: Only", 22 | ] 23 | dependencies = [ 24 | "livekit-agents[codecs, openai]>=1.3.8", 25 | "aiohttp", 26 | "livekit", 27 | ] 28 | 29 | [project.urls] 30 | Documentation = "https://docs.livekit.io" 31 | Website = "https://livekit.io/" 32 | Source = "https://github.com/livekit/agents" 33 | 34 | [tool.hatch.version] 35 | path = "livekit/plugins/groq/version.py" 36 | 37 | [tool.hatch.build.targets.wheel] 38 | packages = ["livekit"] 39 | 40 | [tool.hatch.build.targets.sdist] 41 | include = ["/livekit"] 42 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-langchain/livekit/plugins/langchain/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 LiveKit, Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """LangChain plugin for LiveKit Agents.""" 16 | 17 | from .langgraph import LangGraphStream, LLMAdapter 18 | from .version import __version__ 19 | 20 | __all__ = ["__version__", "LLMAdapter", "LangGraphStream"] 21 | 22 | from livekit.agents import Plugin 23 | 24 | 25 | class LangChainPlugin(Plugin): 26 | def __init__(self) -> None: 27 | super().__init__(__name__, __version__, __package__) 28 | 29 | 30 | Plugin.register_plugin(LangChainPlugin()) 31 | 32 | # Cleanup docs of unexported modules 33 | _module = dir() 34 | NOT_IN_ALL = [m for m in _module if m not in __all__] 35 | 36 | __pdoc__ = {} 37 | 38 | for n in NOT_IN_ALL: 39 | __pdoc__[n] = False 40 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-lmnt/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-lmnt" 7 | dynamic = ["version"] 8 | description = "LMNT TTS plugin for LiveKit agents" 9 | readme = "README.md" 10 | license = "Apache-2.0" 11 | requires-python = ">=3.9.0" 12 | authors = [ 13 | {name = "LiveKit", email = "hello@livekit.io"} 14 | ] 15 | keywords = ["webrtc", "realtime", "audio", "livekit", "LMNT", "TTS", "voice"] 16 | classifiers = [ 17 | "Intended Audience :: Developers", 18 | "License :: OSI Approved :: Apache Software License", 19 | "Topic :: Multimedia :: Sound/Audio", 20 | "Topic :: Scientific/Engineering :: Artificial Intelligence", 21 | "Programming Language :: Python :: 3", 22 | "Programming Language :: Python :: 3.11", 23 | "Programming Language :: Python :: 3.12", 24 | "Programming Language :: Python :: 3 :: Only", 25 | ] 26 | dependencies = ["livekit-agents>=1.3.8"] 27 | 28 | [project.urls] 29 | Documentation = "https://docs.livekit.io" 30 | Website = "https://livekit.io/" 31 | Source = "https://github.com/livekit/agents" 32 | 33 | [tool.hatch.version] 34 | path = "livekit/plugins/lmnt/version.py" 35 | 36 | [tool.hatch.build.targets.wheel] 37 | packages = ["livekit"] 38 | 39 | [tool.hatch.build.targets.sdist] 40 | include = ["/livekit"] 41 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-soniox/README.md: -------------------------------------------------------------------------------- 1 | # Soniox plugin for LiveKit Agents 2 | 3 | Support for Soniox Speech-to-Text [Soniox](https://soniox.com/) API, using WebSocket streaming interface. 4 | 5 | See https://docs.livekit.io/agents/integrations/stt/soniox/ for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-soniox 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | The Soniox plugin requires an API key to authenticate. You can get your Soniox API key [here](https://console.soniox.com/). 16 | 17 | Set API key in your `.env` file: 18 | 19 | ``` 20 | SONIOX_API_KEY= 21 | ``` 22 | 23 | ## Usage 24 | 25 | Use Soniox in an `AgentSession` or as a standalone transcription service: 26 | 27 | ```python 28 | from livekit.plugins import soniox 29 | 30 | session = AgentSession( 31 | stt = soniox.STT(), 32 | # ... llm, tts, etc. 33 | ) 34 | ``` 35 | 36 | Congratulations! You are now ready to use Soniox Speech-to-Text API in your LiveKit agents. 37 | 38 | You can test Soniox Speech-to-Text API in the LiveKit's [Voice AI quickstart](https://docs.livekit.io/agents/start/voice-ai/). 39 | 40 | ## More information and reference 41 | 42 | Explore integration details and find comprehensive examples in our [Soniox LiveKit integration guide](https://speechdev.soniox.com/docs/speech-to-text/integrations/livekit). 43 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gradium/livekit/plugins/gradium/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed under the Apache License, Version 2.0 (the "License"); 2 | # you may not use this file except in compliance with the License. 3 | # You may obtain a copy of the License at 4 | # 5 | # http://www.apache.org/licenses/LICENSE-2.0 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | 13 | from .log import logger 14 | from .stt import STT, SpeechStream 15 | from .tts import TTS 16 | from .version import __version__ 17 | 18 | __all__ = [ 19 | "LLM", 20 | "STT", 21 | "SpeechStream", 22 | "logger", 23 | "TTS", 24 | "__version__", 25 | ] 26 | 27 | from livekit.agents import Plugin 28 | 29 | 30 | class GradiumPlugin(Plugin): 31 | def __init__(self) -> None: 32 | super().__init__(__name__, __version__, __package__) 33 | 34 | 35 | Plugin.register_plugin(GradiumPlugin()) 36 | 37 | # Cleanup docs of unexported modules 38 | _module = dir() 39 | NOT_IN_ALL = [m for m in _module if m not in __all__] 40 | 41 | __pdoc__ = {} 42 | 43 | for n in NOT_IN_ALL: 44 | __pdoc__[n] = False 45 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-fal/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-fal" 7 | dynamic = ["version"] 8 | description = "fal plugin template for LiveKit Agents" 9 | readme = "README.md" 10 | license = "Apache-2.0" 11 | requires-python = ">=3.9.0" 12 | authors = [{ name = "LiveKit" }] 13 | keywords = ["voice", "ai", "realtime", "audio", "video", "livekit", "webrtc"] 14 | classifiers = [ 15 | "Intended Audience :: Developers", 16 | "License :: OSI Approved :: Apache Software License", 17 | "Topic :: Multimedia :: Sound/Audio", 18 | "Topic :: Multimedia :: Video", 19 | "Topic :: Scientific/Engineering :: Artificial Intelligence", 20 | "Programming Language :: Python :: 3", 21 | "Programming Language :: Python :: 3.9", 22 | "Programming Language :: Python :: 3.10", 23 | "Programming Language :: Python :: 3 :: Only", 24 | ] 25 | dependencies = ["livekit-agents>=1.3.8", "fal_client"] 26 | 27 | [project.urls] 28 | Documentation = "https://docs.livekit.io" 29 | Website = "https://livekit.io/" 30 | Source = "https://github.com/livekit/agents" 31 | 32 | [tool.hatch.version] 33 | path = "livekit/plugins/fal/version.py" 34 | 35 | [tool.hatch.build.targets.wheel] 36 | packages = ["livekit"] 37 | 38 | [tool.hatch.build.targets.sdist] 39 | include = ["/livekit"] 40 | -------------------------------------------------------------------------------- /examples/avatar_agents/bithuman/agent_cloud.py: -------------------------------------------------------------------------------- 1 | import logging 2 | import os 3 | 4 | from dotenv import load_dotenv 5 | from PIL import Image 6 | 7 | from livekit.agents import ( 8 | Agent, 9 | AgentServer, 10 | AgentSession, 11 | JobContext, 12 | cli, 13 | room_io, 14 | ) 15 | from livekit.plugins import bithuman, openai 16 | 17 | logger = logging.getLogger("bithuman-avatar-example") 18 | logger.setLevel(logging.INFO) 19 | 20 | load_dotenv() 21 | 22 | server = AgentServer() 23 | 24 | 25 | @server.rtc_session() 26 | async def entrypoint(ctx: JobContext): 27 | await ctx.connect() 28 | 29 | session = AgentSession( 30 | llm=openai.realtime.RealtimeModel(voice="alloy"), 31 | resume_false_interruption=False, 32 | ) 33 | 34 | bithuman_avatar = bithuman.AvatarSession( 35 | avatar_image=Image.open(os.path.join(os.path.dirname(__file__), "avatar.jpg")), 36 | # avatar_id="A70MXC2074", 37 | # model="expression", 38 | ) 39 | await bithuman_avatar.start(session, room=ctx.room) 40 | 41 | await session.start( 42 | agent=Agent(instructions="Talk to me!"), 43 | room=ctx.room, 44 | # audio is forwarded to the avatar, so we disable room audio output 45 | room_options=room_io.RoomOptions(audio_output=False), 46 | ) 47 | 48 | 49 | if __name__ == "__main__": 50 | cli.run_app(server) 51 | --------------------------------------------------------------------------------