├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── question.md ├── banner_dark.png ├── banner_light.png ├── next-release │ ├── changeset-0374ff9a.md │ ├── changeset-053d451c.md │ ├── changeset-09d3d90a.md │ ├── changeset-0c32e47c.md │ ├── changeset-0fc208ee.md │ ├── changeset-12012403.md │ ├── changeset-1a7020ab.md │ ├── changeset-1b1bcfd3.md │ ├── changeset-1b94935f.md │ ├── changeset-1ce8eb28.md │ ├── changeset-1d036f50.md │ ├── changeset-1ec735fe.md │ ├── changeset-21d5ddfe.md │ ├── changeset-24f8a4cb.md │ ├── changeset-2accb3b4.md │ ├── changeset-2ad81615.md │ ├── changeset-2dbbc82b.md │ ├── changeset-2f3c00e4.md │ ├── changeset-354c197a.md │ ├── changeset-360f70d3.md │ ├── changeset-3cd7dcd2.md │ ├── changeset-3ec7cd3d.md │ ├── changeset-440b34fa.md │ ├── changeset-468778aa.md │ ├── changeset-4ae759b0.md │ ├── changeset-4c7519f9.md │ ├── changeset-4d5b12d5.md │ ├── changeset-4ffe605b.md │ ├── changeset-51b7bc26.md │ ├── changeset-51bb1c8e.md │ ├── changeset-56587c34.md │ ├── changeset-5ca20d29.md │ ├── changeset-5e7650bc.md │ ├── changeset-613ef3d7.md │ ├── changeset-63a32de3.md │ ├── changeset-688237d9.md │ ├── changeset-6a626bb2.md │ ├── changeset-70b208e6.md │ ├── changeset-71552278.md │ ├── changeset-71f8b172.md │ ├── changeset-736911c0.md │ ├── changeset-785aff77.md │ ├── changeset-7a78205f.md │ ├── changeset-7b1d7851.md │ ├── changeset-7feb6ffb.md │ ├── changeset-816269c8.md │ ├── changeset-82e6bd54.md │ ├── changeset-87db8afc.md │ ├── changeset-8a44d9bf.md │ ├── changeset-8bff0e57.md │ ├── changeset-91dc8fd6.md │ ├── changeset-990dabed.md │ ├── changeset-9bd9e220.md │ ├── changeset-9c0bf467.md │ ├── changeset-9e54028d.md │ ├── changeset-a19302fd.md │ ├── changeset-a1f0d782.md │ ├── changeset-a264bde2.md │ ├── changeset-a6c0fcd6.md │ ├── changeset-aab35406.md │ ├── changeset-abb19cef.md │ ├── changeset-ad9e5c3a.md │ ├── changeset-afeb4064.md │ ├── changeset-b1fb1404.md │ ├── changeset-b1fe26a2.md │ ├── changeset-b2ba978e.md │ ├── changeset-b50d2699.md │ ├── changeset-b6643765.md │ ├── changeset-ba3876d2.md │ ├── changeset-bc4c7ae8.md │ ├── changeset-bcccca2c.md │ ├── changeset-be0cca68.md │ ├── changeset-be9616f6.md │ ├── changeset-c03d8455.md │ ├── changeset-c58eb3b3.md │ ├── changeset-cb05b697.md │ ├── changeset-cb19d9f7.md │ ├── changeset-ce88a6a1.md │ ├── changeset-cf16bbc5.md │ ├── changeset-d00663f0.md │ ├── changeset-d1555002.md │ ├── changeset-d18231f7.md │ ├── changeset-d48d5436.md │ ├── changeset-d4fbedb8.md │ ├── changeset-d782b966.md │ ├── changeset-d7965afc.md │ ├── changeset-db8d9b3c.md │ ├── changeset-e0b9bf9f.md │ ├── changeset-e1c5da38.md │ ├── changeset-e5b0a486.md │ ├── changeset-e65c5aa1.md │ ├── changeset-e8332a8a.md │ ├── changeset-ec4e21ad.md │ ├── changeset-ed9ee113.md │ ├── changeset-fc030b15.md │ ├── changeset-ffa7aeea.md │ └── changeset-fff3e04b.md ├── update_versions.py ├── workflows-py │ └── check_changesets.py └── workflows │ ├── changesets.yml │ ├── ci.yml │ ├── publish-docs.yml │ └── tests.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── examples ├── .env.example ├── .gitignore ├── Dockerfile-example ├── avatar_agents │ ├── README.md │ ├── audio_wave │ │ ├── README.md │ │ ├── agent_worker.py │ │ ├── avatar_runner.py │ │ ├── dispatcher.py │ │ ├── requirements.txt │ │ └── wave_viz.py │ ├── bey │ │ ├── README.md │ │ └── agent_worker.py │ ├── bithuman │ │ ├── README.md │ │ ├── agent_worker.py │ │ └── requirements.txt │ └── tavus │ │ ├── README.md │ │ └── agent_worker.py ├── minimal_worker.py ├── other │ ├── chat-stream-receiver.py │ ├── kokoro_tts.py │ ├── text-to-speech │ │ ├── README.md │ │ ├── cartesia_tts.py │ │ ├── elevenlabs_tts.py │ │ ├── neuphonic_tts.py │ │ ├── openai_tts.py │ │ ├── requirements.txt │ │ └── sync_tts_transcription.py │ ├── text_only.py │ └── transcription │ │ ├── README.md │ │ ├── multi-user-transcriber.py │ │ ├── transcriber.py │ │ └── translator.py ├── primitives │ ├── e2ee.py │ ├── echo-agent.py │ ├── participant_entrypoint.py │ ├── room_stats.py │ └── video-publisher.py └── voice_agents │ ├── annotated_tool_args.py │ ├── background_audio.py │ ├── basic_agent.py │ ├── dynamic_tool_creation.py │ ├── error_callback.py │ ├── error_message.ogg │ ├── fast-preresponse.py │ ├── gemini_video_agent.py │ ├── llamaindex-rag │ ├── .gitignore │ ├── README.md │ ├── chat_engine.py │ ├── data │ │ └── raw_data.txt │ ├── query_engine.py │ └── retrieval.py │ ├── mcp │ ├── mcp-agent.py │ └── server.py │ ├── multi_agent.py │ ├── push_to_talk.py │ ├── raw_function_description.py │ ├── realtime_load_chat_history.py │ ├── realtime_turn_detector.py │ ├── requirements.txt │ ├── restaurant_agent.py │ ├── session_close_callback.py │ ├── silent_function_call.py │ ├── speedup_output_audio.py │ ├── structured_output.py │ ├── toggle_io.py │ ├── weather_agent.py │ ├── web_search.py │ └── zapier_mcp_integration.py ├── livekit-agents ├── README.md ├── livekit │ └── agents │ │ ├── __init__.py │ │ ├── _exceptions.py │ │ ├── cli │ │ ├── __init__.py │ │ ├── _run.py │ │ ├── cli.py │ │ ├── log.py │ │ ├── proto.py │ │ └── watcher.py │ │ ├── debug │ │ ├── __init__.py │ │ ├── index.html │ │ └── tracing.py │ │ ├── http_server.py │ │ ├── inference_runner.py │ │ ├── ipc │ │ ├── __init__.py │ │ ├── channel.py │ │ ├── inference_executor.py │ │ ├── inference_proc_executor.py │ │ ├── inference_proc_lazy_main.py │ │ ├── job_executor.py │ │ ├── job_proc_executor.py │ │ ├── job_proc_lazy_main.py │ │ ├── job_thread_executor.py │ │ ├── log_queue.py │ │ ├── mock_room.py │ │ ├── proc_client.py │ │ ├── proc_pool.py │ │ ├── proto.py │ │ └── supervised_proc.py │ │ ├── job.py │ │ ├── jupyter.py │ │ ├── llm │ │ ├── __init__.py │ │ ├── _provider_format │ │ │ ├── __init__.py │ │ │ ├── anthropic.py │ │ │ ├── aws.py │ │ │ ├── google.py │ │ │ ├── openai.py │ │ │ └── utils.py │ │ ├── _strict.py │ │ ├── chat_context.py │ │ ├── fallback_adapter.py │ │ ├── llm.py │ │ ├── mcp.py │ │ ├── realtime.py │ │ ├── remote_chat_context.py │ │ ├── tool_context.py │ │ └── utils.py │ │ ├── log.py │ │ ├── metrics │ │ ├── __init__.py │ │ ├── base.py │ │ ├── usage_collector.py │ │ └── utils.py │ │ ├── plugin.py │ │ ├── py.typed │ │ ├── resources │ │ ├── .gitattributes │ │ ├── NOTICE │ │ ├── __init__.py │ │ ├── keyboard-typing.ogg │ │ ├── keyboard-typing2.ogg │ │ └── office-ambience.ogg │ │ ├── stt │ │ ├── __init__.py │ │ ├── fallback_adapter.py │ │ ├── stream_adapter.py │ │ └── stt.py │ │ ├── tokenize │ │ ├── __init__.py │ │ ├── _basic_hyphenator.py │ │ ├── _basic_paragraph.py │ │ ├── _basic_sent.py │ │ ├── _basic_word.py │ │ ├── basic.py │ │ ├── token_stream.py │ │ ├── tokenizer.py │ │ └── utils.py │ │ ├── tts │ │ ├── __init__.py │ │ ├── fallback_adapter.py │ │ ├── stream_adapter.py │ │ └── tts.py │ │ ├── types.py │ │ ├── utils │ │ ├── __init__.py │ │ ├── aio │ │ │ ├── __init__.py │ │ │ ├── channel.py │ │ │ ├── debug.py │ │ │ ├── duplex_unix.py │ │ │ ├── interval.py │ │ │ ├── itertools.py │ │ │ ├── sleep.py │ │ │ ├── task_set.py │ │ │ ├── utils.py │ │ │ └── wait_group.py │ │ ├── audio.py │ │ ├── codecs │ │ │ ├── __init__.py │ │ │ └── decoder.py │ │ ├── connection_pool.py │ │ ├── exp_filter.py │ │ ├── http_context.py │ │ ├── hw │ │ │ ├── __init__.py │ │ │ └── cpu.py │ │ ├── images │ │ │ ├── __init__.py │ │ │ └── image.py │ │ ├── log.py │ │ ├── misc.py │ │ ├── moving_average.py │ │ └── participant.py │ │ ├── vad.py │ │ ├── version.py │ │ ├── voice │ │ ├── __init__.py │ │ ├── agent.py │ │ ├── agent_activity.py │ │ ├── agent_session.py │ │ ├── audio_recognition.py │ │ ├── avatar │ │ │ ├── __init__.py │ │ │ ├── _datastream_io.py │ │ │ ├── _queue_io.py │ │ │ ├── _runner.py │ │ │ └── _types.py │ │ ├── background_audio.py │ │ ├── chat_cli.py │ │ ├── events.py │ │ ├── generation.py │ │ ├── io.py │ │ ├── room_io │ │ │ ├── __init__.py │ │ │ ├── _input.py │ │ │ ├── _output.py │ │ │ ├── _pre_connect_audio.py │ │ │ └── room_io.py │ │ ├── speech_handle.py │ │ └── transcription │ │ │ ├── __init__.py │ │ │ ├── _speaking_rate.py │ │ │ ├── _utils.py │ │ │ └── synchronizer.py │ │ └── worker.py └── pyproject.toml ├── livekit-plugins ├── livekit-plugins-anthropic │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── anthropic │ │ │ ├── __init__.py │ │ │ ├── llm.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── utils.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-assemblyai │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── assemblyai │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-aws │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── aws │ │ │ ├── __init__.py │ │ │ ├── llm.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ ├── tts.py │ │ │ ├── utils.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-azure │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── azure │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-bey │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── bey │ │ │ ├── __init__.py │ │ │ ├── avatar.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-bithuman │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── bithuman │ │ │ ├── __init__.py │ │ │ ├── avatar.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-browser │ ├── .clang-format │ ├── .gitignore │ ├── CMakeLists.txt │ ├── LICENSE.txt │ ├── README.md │ ├── cmake │ │ └── DownloadCEF.cmake │ ├── livekit │ │ └── plugins │ │ │ └── browser │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── proc.py │ │ │ ├── proc_main.py │ │ │ ├── proto.py │ │ │ ├── py.typed │ │ │ ├── resources │ │ │ └── __init__.py │ │ │ └── version.py │ ├── pyproject.toml │ ├── setup.py │ └── src │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── agents_python.cpp │ │ ├── agents_python.hpp │ │ ├── app.cpp │ │ ├── app.hpp │ │ ├── app_mac.mm │ │ ├── browser_handle.cpp │ │ ├── browser_handle.hpp │ │ ├── dev_renderer.cpp │ │ ├── dev_renderer.hpp │ │ ├── dummy.cpp │ │ ├── gleq.h │ │ ├── handler.cpp │ │ ├── handler.hpp │ │ ├── helper_main_linux.cpp │ │ ├── helper_main_mac.mm │ │ ├── helper_main_win.cpp │ │ ├── keyboard_codes.h │ │ ├── resources │ │ ├── lkcefapp-Info.plist │ │ └── lkcefhelper-Info.plist │ │ └── run_browser.py ├── livekit-plugins-cartesia │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── cartesia │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-clova │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── clova │ │ │ ├── __init__.py │ │ │ ├── common.py │ │ │ ├── constants.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-deepgram │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── deepgram │ │ │ ├── __init__.py │ │ │ ├── _utils.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-elevenlabs │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── elevenlabs │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-fal │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── fal │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-gladia │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── gladia │ │ │ ├── __init__.py │ │ │ ├── _utils.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-google │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── google │ │ │ ├── __init__.py │ │ │ ├── beta │ │ │ ├── __init__.py │ │ │ └── realtime │ │ │ │ ├── __init__.py │ │ │ │ ├── api_proto.py │ │ │ │ └── realtime_api.py │ │ │ ├── llm.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ ├── tools.py │ │ │ ├── tts.py │ │ │ ├── utils.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-groq │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── groq │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── services.py │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-hume │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── hume │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-lmnt │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── lmnt │ │ │ ├── __init__.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-minimal │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── minimal │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-neuphonic │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── neuphonic │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-nltk │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── nltk │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ ├── sentence_tokenizer.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-openai │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── openai │ │ │ ├── __init__.py │ │ │ ├── embeddings.py │ │ │ ├── llm.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── realtime │ │ │ ├── __init__.py │ │ │ └── realtime_model.py │ │ │ ├── stt.py │ │ │ ├── tts.py │ │ │ ├── utils.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-playai │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── playai │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-resemble │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── resemble │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-rime │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── rime │ │ │ ├── __init__.py │ │ │ ├── langs.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-silero │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── silero │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── onnx_model.py │ │ │ ├── py.typed │ │ │ ├── resources │ │ │ ├── .gitattributes │ │ │ ├── __init__.py │ │ │ └── silero_vad.onnx │ │ │ ├── vad.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-speechify │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── speechify │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── models.py │ │ │ ├── py.typed │ │ │ ├── tts.py │ │ │ └── version.py │ └── pyproject.toml ├── livekit-plugins-speechmatics │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── speechmatics │ │ │ ├── __init__.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ ├── stt.py │ │ │ ├── types.py │ │ │ ├── utils.py │ │ │ └── version.py │ ├── project.toml │ ├── pyproject.toml │ └── setup.py ├── livekit-plugins-tavus │ ├── README.md │ ├── livekit │ │ └── plugins │ │ │ └── tavus │ │ │ ├── __init__.py │ │ │ ├── api.py │ │ │ ├── avatar.py │ │ │ ├── log.py │ │ │ ├── py.typed │ │ │ └── version.py │ └── pyproject.toml └── livekit-plugins-turn-detector │ ├── README.md │ ├── livekit │ └── plugins │ │ └── turn_detector │ │ ├── __init__.py │ │ ├── base.py │ │ ├── english.py │ │ ├── log.py │ │ ├── models.py │ │ ├── multilingual.py │ │ ├── py.typed │ │ └── version.py │ └── pyproject.toml ├── pyproject.toml ├── tests ├── .gitattributes ├── .gitignore ├── Dockerfile.tests ├── Dockerfile.toxiproxy ├── Makefile ├── __init__.py ├── change-sophie.opus ├── change-sophie.wav ├── conftest.py ├── docker-compose.yml ├── fake_stt.py ├── fake_tts.py ├── long.mp3 ├── long_synthesize.txt ├── long_synthesize_multi_tokens.txt ├── long_transcript.txt ├── test_aio.py ├── test_audio_decoder.py ├── test_chat_ctx.py ├── test_config.py ├── test_connection_pool.py ├── test_ipc.py ├── test_llm.py ├── test_schema_gemini.py ├── test_stt.py ├── test_stt_fallback.py ├── test_tokenizer.py ├── test_tts.py ├── test_tts_fallback.py ├── test_vad.py ├── toxic_proxy.py └── utils.py └── uv.lock /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Let us know of an issue so we can fix it 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask for help with an issue you're facing 4 | title: '' 5 | labels: question 6 | assignees: '' 7 | 8 | --- 9 | 10 | 23 | -------------------------------------------------------------------------------- /.github/banner_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/.github/banner_dark.png -------------------------------------------------------------------------------- /.github/banner_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/.github/banner_light.png -------------------------------------------------------------------------------- /.github/next-release/changeset-0374ff9a.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | feat: Add max_completion_tokens parameter to OpenAI LLM (#2258) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-053d451c.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | Support empty array of parameters when creating a function tool using raw_schema (#2328) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-09d3d90a.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | add internal worker token (#2354) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-0c32e47c.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | google stt: allow configurable confidence score -------------------------------------------------------------------------------- /.github/next-release/changeset-0fc208ee.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | handle missing token_count in realtime usage metrics (#2350) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-12012403.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | Simpler api to end the session and handle sip users (#1950) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-1a7020ab.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fix type check for livekit.agents (#2335) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-1b1bcfd3.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | Setting openai temperature on `LLM.chat` (#2353) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-1b94935f.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | remove await from room_io.start (#2167) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-1ce8eb28.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-google": patch 4 | "livekit-plugins-speechify": patch 5 | --- 6 | 7 | reset stt when clear user turn (#2070) 8 | -------------------------------------------------------------------------------- /.github/next-release/changeset-1d036f50.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fix agent transcription truncate for console mode (#2327) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-1ec735fe.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-openai": patch 4 | --- 5 | 6 | add session_lifetime and auto reconnection for OAI realtime api (#2360) 7 | -------------------------------------------------------------------------------- /.github/next-release/changeset-21d5ddfe.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | fix gemini user transcription not finilzed when tool calls (#2439) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-24f8a4cb.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | fix realtime response later than timeout (#2125) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-2accb3b4.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-openai": patch 4 | "livekit-plugins-google": patch 5 | --- 6 | 7 | add realtime model metrics (#2275) 8 | -------------------------------------------------------------------------------- /.github/next-release/changeset-2ad81615.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-azure": patch 3 | --- 4 | 5 | azure speech sdk version upgrade (>=1.41.0 to >=1.43.0) -------------------------------------------------------------------------------- /.github/next-release/changeset-2dbbc82b.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | Fix: FunctionOutputResponse not getting recognised to gemini live-api (#2185) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-2f3c00e4.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | openai: switch to mp3 encoding by default (#2306) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-354c197a.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fix debug tracing for proc executor (#2104) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-360f70d3.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-anthropic": patch 4 | "livekit-plugins-aws": patch 5 | "livekit-plugins-google": patch 6 | "livekit-plugins-openai": patch 7 | --- 8 | 9 | add to_provider_format for ChatContext (#2295) 10 | -------------------------------------------------------------------------------- /.github/next-release/changeset-3cd7dcd2.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | ignore stt transcription for realtime model (#1958) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-3ec7cd3d.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | publish legacy transcription event for avatar (#2074) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-440b34fa.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | supress stream timeout in google stt (#2189) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-468778aa.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | bug fix: forward error from stt/tts stream adapter (#2215) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-4ae759b0.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-deepgram": patch 3 | --- 4 | 5 | Add mip_opt_out option for Deepgram TTS (#2159) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-4c7519f9.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-elevenlabs": patch 3 | --- 4 | 5 | Add ElevenLabs plugin support for SSML break tags (#2173) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-4d5b12d5.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | add bey avatar plugin (#2031) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-4ffe605b.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | simplify google tts voice params #2025 -------------------------------------------------------------------------------- /.github/next-release/changeset-51b7bc26.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-rime": patch 4 | --- 5 | 6 | Improve decoding speed for wav, support for Rime arcane (#2141) 7 | -------------------------------------------------------------------------------- /.github/next-release/changeset-51bb1c8e.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | Add support for decoding preconnect buffer (#2311) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-56587c34.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-deepgram": patch 3 | --- 4 | 5 | deepgram: default to aura-2 for TTS (#2272) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-5ca20d29.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | support dynamic tools from llm_node (#1989) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-5e7650bc.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | avoid duplicate room io initialization (#2037) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-613ef3d7.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | make discard audio when uninterruptible configurable (#1957) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-63a32de3.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | fix(google-tts): Audio encoding for Chirp3 voices not compatible with PCM encoding (#2176) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-688237d9.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-turn-detector": minor 3 | --- 4 | 5 | multilingual model update (#2219) 6 | - broad accuracy improvements 7 | - more robust to STT punctuation errors 8 | - better quantization process to preserve accuracy 9 | - better threshold calibration and evaluation metrics using the quantized model instead of full pytorch model 10 | -------------------------------------------------------------------------------- /.github/next-release/changeset-6a626bb2.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fix tool choice (#2332) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-70b208e6.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-elevenlabs": patch 3 | --- 4 | 5 | 11labs: fix default model and chunk_length_schedule (#2205) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-71552278.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-deepgram": patch 3 | --- 4 | 5 | Parse Deepgram TTS mip_opt_out boolean correctly (#2225) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-71f8b172.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | fix raw function tool for google gemini (#2270) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-736911c0.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | add segment id to transcription text stream (#1951) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-785aff77.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fix: resolve type mismatch between _TurnDetector protocol and plugins (#2002) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-7a78205f.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-elevenlabs": major 3 | --- 4 | 5 | ElevenLabs Scribe support #1655 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-7b1d7851.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-rime": patch 3 | --- 4 | 5 | Increase timeout for `arcana` model to allow for synthesis of long audio (#2343) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-7feb6ffb.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-google": patch 4 | --- 5 | 6 | fix(google): Live syncs context, supports manual turns (#2401) 7 | -------------------------------------------------------------------------------- /.github/next-release/changeset-816269c8.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | google stt: support cofigurable streaming (#2192) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-82e6bd54.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-rime": patch 3 | --- 4 | 5 | Update base_url property. Also make consistent (#2236) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-87db8afc.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | avoid session.start overwriting user defined io (#2170) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-8a44d9bf.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | automatically close agent session when participant disconnected (#2398) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-8bff0e57.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-rime": patch 3 | --- 4 | 5 | Fix the rime tts client by setting the `_api_url` value 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-91dc8fd6.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fix user transcription forwarding order (#2279) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-990dabed.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | support simple word and sentence split for character-based language (#2263) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-9bd9e220.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | fix tool format when there is messages between tool call and output (#1977) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-9c0bf467.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-hume": patch 3 | --- 4 | 5 | Fix hume plugin defaults (#2122) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-9e54028d.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | update transcriber example for agents 1.0 (#2198) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-a19302fd.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | Added timestamp to ChatMessage so it gets added to session history (#1882) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-a1f0d782.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | fix realtiem defualts with azure openai -------------------------------------------------------------------------------- /.github/next-release/changeset-a264bde2.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-cartesia": patch 3 | --- 4 | 5 | Increases buffered words count to Cartesia's TTS service (#2206) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-a6c0fcd6.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | check participant kinds in room io, add participant_identity in RoomInputOptions, mv sync_transcription to RoomOutputOptions (#2100) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-aab35406.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | add image_encode_options for google realtime model (#2249) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-abb19cef.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | Add input_audio_noise_reduction to OpenAI RealtimeModel (#2362) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-ad9e5c3a.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | support video input from screenshare (#2127) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-afeb4064.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | skip response if no llm set in user turn completed (#2441) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-b1fb1404.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-turn-detector": patch 3 | --- 4 | 5 | allow overriding eou threshold (#2035) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-b1fe26a2.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | close room audio output when agent session close (#2211) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-b2ba978e.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-openai": patch 4 | --- 5 | 6 | feat: enhance openai LLM metrics to include cached prompt tokens (#1998) 7 | -------------------------------------------------------------------------------- /.github/next-release/changeset-b50d2699.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | support stt END_OF_SPEECH for stt turn detection (#2363) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-b6643765.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | support with_azure in openai stt/tts -------------------------------------------------------------------------------- /.github/next-release/changeset-ba3876d2.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | support session resumption and language in gemini live (#2129) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-bc4c7ae8.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-rime": patch 3 | --- 4 | 5 | Added ability to set custom Rime URL for self-hosted deployments (#2158) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-bcccca2c.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | Use PCM instead of OGG_OPUS for Google TTS (#2139) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-be0cca68.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-anthropic": patch 3 | "livekit-plugins-aws": patch 4 | "livekit-plugins-google": patch 5 | --- 6 | 7 | fix llm.chat for plugins when using with empty tools -------------------------------------------------------------------------------- /.github/next-release/changeset-be9616f6.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fix chat context item order for text input and some tool calls (#2321) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-c03d8455.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fix error handling in stt, tts and llm (#2227) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-c58eb3b3.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-deepgram": patch 3 | "livekit-plugins-groq": patch 4 | "livekit-plugins-rime": patch 5 | "livekit-plugins-speechify": patch 6 | --- 7 | 8 | correctly pass timeout as connect timeout instead of total (#2285) 9 | -------------------------------------------------------------------------------- /.github/next-release/changeset-cb05b697.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | set user state to away after a timeout (#2408) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-cb19d9f7.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fix using raw tools with ChatContext copies (#2096) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-ce88a6a1.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-google": patch 4 | "livekit-plugins-openai": patch 5 | --- 6 | 7 | bump gemini sdk version & add video support for gemini multimodal (#1946) 8 | -------------------------------------------------------------------------------- /.github/next-release/changeset-cf16bbc5.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | fix gemini live interruption -------------------------------------------------------------------------------- /.github/next-release/changeset-d00663f0.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | flush stt and wait for final transcription when commit_user_turn (#2147) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-d1555002.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | Fix dangling websocket connections (#2027) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-d18231f7.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-elevenlabs": patch 3 | --- 4 | 5 | 11labs: improve resilience, do not fail when unexpected payload is received (#2255) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-d48d5436.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | Update README.md (#2299) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-d4fbedb8.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-openai": patch 4 | --- 5 | 6 | Emit errors from open ai realtime model (#1968) 7 | -------------------------------------------------------------------------------- /.github/next-release/changeset-d782b966.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-aws": patch 3 | --- 4 | 5 | aws: fixed STT error at end of session (#2297) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-d7965afc.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | add MCP support for stremable HTTP client (#2394) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-db8d9b3c.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | improvements to Gemini Live handling (#2089) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-e0b9bf9f.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | add wait_for_participant as a function (#2039) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-e1c5da38.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | add duration_per_frame for datastream audio receiver (#2474) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-e5b0a486.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | add chat_ctx.truncate (#1974) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-e65c5aa1.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | "livekit-plugins-aws": patch 4 | "livekit-plugins-openai": patch 5 | --- 6 | 7 | livekit-plugins-aws: update the dependencies to allow for versions greater than specified version (#2244) 8 | -------------------------------------------------------------------------------- /.github/next-release/changeset-e8332a8a.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | add min_interruption_words option (default 0) (#2213) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-ec4e21ad.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-agents": patch 3 | --- 4 | 5 | fixed identifying stremable http mcp servers containing api key in url (#2468) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-ed9ee113.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | Fix generate_reply for Gemini LLM (#2183) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-fc030b15.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-openai": patch 3 | --- 4 | 5 | openai: pass tool choice to session initialization (#2316) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-ffa7aeea.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | google: do not error when empty responses are returned (#2345) 6 | -------------------------------------------------------------------------------- /.github/next-release/changeset-fff3e04b.md: -------------------------------------------------------------------------------- 1 | --- 2 | "livekit-plugins-google": patch 3 | --- 4 | 5 | streaming for google tts (#2143) 6 | -------------------------------------------------------------------------------- /.github/workflows/changesets.yml: -------------------------------------------------------------------------------- 1 | name: changesets 2 | permissions: 3 | contents: write 4 | pull-requests: write 5 | issues: write 6 | 7 | on: 8 | pull_request_target: 9 | branches: 10 | - main 11 | paths: 12 | - "livekit-agents/**" 13 | - "livekit-plugins/**" 14 | - ".github/next-release/**" 15 | 16 | jobs: 17 | check-changesets: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@v4 21 | with: 22 | ref: ${{ github.event.base.ref }} 23 | 24 | - name: Check Changesets 25 | run: python .github/workflows-py/check_changesets.py 26 | env: 27 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 28 | GITHUB_REPOSITORY: ${{ github.repository }} 29 | GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }} 30 | GITHUB_BASE_REF: ${{ github.base_ref }} 31 | GITHUB_HEAD_REF: ${{ github.head_ref }} 32 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/.env.example: -------------------------------------------------------------------------------- 1 | LIVEKIT_API_SECRET="" 2 | LIVEKIT_API_KEY="" 3 | LIVEKIT_URL="" -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | google.json 2 | .env -------------------------------------------------------------------------------- /examples/avatar_agents/README.md: -------------------------------------------------------------------------------- 1 | # Avatar Examples 2 | 3 | Avatars provide a visual representation for agents. 4 | 5 | 6 | + **audio_wave:** A simple local mock demo that visualizes audio input as waveforms. It demonstrates how to build a avatar service. 7 | 8 | + **bey:** The bey example shows how to use the [Beyond Presence API](https://docs.bey.dev/introduction) for avatar generation. 9 | 10 | 11 | ## Contributing 12 | 13 | Feel free to contribute additional avatar examples or technical improvements to existing ones by submitting a pull request. 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/avatar_agents/audio_wave/requirements.txt: -------------------------------------------------------------------------------- 1 | fastapi 2 | uvicorn 3 | opencv-python 4 | -------------------------------------------------------------------------------- /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 ( 7 | Agent, 8 | AgentSession, 9 | JobContext, 10 | RoomOutputOptions, 11 | WorkerOptions, 12 | WorkerType, 13 | cli, 14 | ) 15 | from livekit.plugins import bey, openai 16 | 17 | logger = logging.getLogger("bey-avatar-example") 18 | logger.setLevel(logging.INFO) 19 | 20 | load_dotenv() 21 | 22 | 23 | async def entrypoint(ctx: JobContext): 24 | await ctx.connect() 25 | 26 | session = AgentSession( 27 | llm=openai.realtime.RealtimeModel(voice="alloy"), 28 | ) 29 | 30 | avatar_id = os.getenv("BEY_AVATAR_ID") 31 | bey_avatar = bey.AvatarSession(avatar_id=avatar_id) 32 | await bey_avatar.start(session, room=ctx.room) 33 | 34 | await session.start( 35 | agent=Agent(instructions="Talk to me!"), 36 | room=ctx.room, 37 | # audio is forwarded to the avatar, so we disable room audio output 38 | room_output_options=RoomOutputOptions(audio_enabled=False), 39 | ) 40 | 41 | 42 | if __name__ == "__main__": 43 | cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, worker_type=WorkerType.ROOM)) 44 | -------------------------------------------------------------------------------- /examples/avatar_agents/bithuman/requirements.txt: -------------------------------------------------------------------------------- 1 | bithuman~=0.5.3 2 | opencv-python -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 ( 7 | Agent, 8 | AgentSession, 9 | JobContext, 10 | RoomOutputOptions, 11 | WorkerOptions, 12 | WorkerType, 13 | cli, 14 | ) 15 | from livekit.plugins import openai, tavus 16 | 17 | logger = logging.getLogger("tavus-avatar-example") 18 | logger.setLevel(logging.INFO) 19 | 20 | load_dotenv() 21 | 22 | 23 | async def entrypoint(ctx: JobContext): 24 | await ctx.connect() 25 | 26 | session = AgentSession( 27 | llm=openai.realtime.RealtimeModel(voice="alloy"), 28 | ) 29 | 30 | persona_id = os.getenv("TAVUS_PERSONA_ID") 31 | replica_id = os.getenv("TAVUS_REPLICA_ID") 32 | tavus_avatar = tavus.AvatarSession(persona_id=persona_id, replica_id=replica_id) 33 | await tavus_avatar.start(session, room=ctx.room) 34 | 35 | await session.start( 36 | agent=Agent(instructions="Talk to me!"), 37 | room=ctx.room, 38 | # audio is forwarded to the avatar, so we disable room audio output 39 | room_output_options=RoomOutputOptions(audio_enabled=False), 40 | ) 41 | 42 | 43 | if __name__ == "__main__": 44 | cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, worker_type=WorkerType.ROOM)) 45 | -------------------------------------------------------------------------------- /examples/minimal_worker.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() # connect to the RTC room 15 | 16 | logger.info(f"connected to the room {ctx.room.name}") 17 | 18 | cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint)) 19 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /examples/other/text-to-speech/openai_tts.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import logging 3 | 4 | from dotenv import load_dotenv 5 | 6 | from livekit import rtc 7 | from livekit.agents import AutoSubscribe, JobContext, WorkerOptions, cli 8 | from livekit.plugins import openai 9 | 10 | load_dotenv() 11 | 12 | logger = logging.getLogger("openai-tts-demo") 13 | logger.setLevel(logging.INFO) 14 | 15 | 16 | async def entrypoint(job: JobContext): 17 | logger.info("starting tts example agent") 18 | 19 | tts = openai.TTS(model="tts-1", voice="nova") 20 | 21 | source = rtc.AudioSource(tts.sample_rate, tts.num_channels) 22 | track = rtc.LocalAudioTrack.create_audio_track("agent-mic", source) 23 | options = rtc.TrackPublishOptions() 24 | options.source = rtc.TrackSource.SOURCE_MICROPHONE 25 | 26 | await job.connect(auto_subscribe=AutoSubscribe.SUBSCRIBE_NONE) 27 | publication = await job.room.local_participant.publish_track(track, options) 28 | await publication.wait_for_subscription() 29 | 30 | logger.info('Saying "Hello!"') 31 | async for output in tts.synthesize("Hello!"): 32 | await source.capture_frame(output.frame) 33 | 34 | await asyncio.sleep(1) 35 | logger.info('Saying "Goodbye."') 36 | async for output in tts.synthesize("Goodbye."): 37 | await source.capture_frame(output.frame) 38 | 39 | 40 | if __name__ == "__main__": 41 | cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint)) 42 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 JobContext, WorkerOptions, cli 7 | 8 | logger = logging.getLogger("e2ee-example") 9 | logger.setLevel(logging.INFO) 10 | 11 | load_dotenv() 12 | 13 | 14 | async def entrypoint(ctx: JobContext): 15 | e2ee_config = rtc.E2EEOptions( 16 | key_provider_options=rtc.KeyProviderOptions( 17 | shared_key=b"my_shared_key", 18 | # ratchet_salt=b"my_salt", 19 | ), 20 | encryption_type=rtc.EncryptionType.GCM, 21 | ) 22 | 23 | # Connect to the room with end-to-end encryption (E2EE) 24 | # Only clients possessing the same shared key will be able to decode the published tracks 25 | await ctx.connect(e2ee=e2ee_config) 26 | 27 | 28 | if __name__ == "__main__": 29 | cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint)) 30 | -------------------------------------------------------------------------------- /examples/voice_agents/error_message.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/examples/voice_agents/error_message.ogg -------------------------------------------------------------------------------- /examples/voice_agents/llamaindex-rag/.gitignore: -------------------------------------------------------------------------------- 1 | chat-engine-storage/ 2 | query-engine-storage/ 3 | retrieval-engine-storage/ -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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-agents/livekit/agents/cli/__init__.py: -------------------------------------------------------------------------------- 1 | from .cli import run_app 2 | 3 | __all__ = ["run_app"] 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-agents/livekit/agents/debug/__init__.py: -------------------------------------------------------------------------------- 1 | from .tracing import Tracing, TracingGraph, TracingHandle 2 | 3 | __all__ = [ 4 | "Tracing", 5 | "TracingGraph", 6 | "TracingHandle", 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-agents/livekit/agents/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 port(self) -> int: 22 | return self._port 23 | 24 | async def start(self) -> None: 25 | async with self._lock: 26 | handler = self._app.make_handler() 27 | self._server = await self._loop.create_server(handler, self._host, self._port) 28 | 29 | if self._port == 0: 30 | self._port = self._server.sockets[0].getsockname()[1] 31 | 32 | await self._server.start_serving() 33 | 34 | async def aclose(self) -> None: 35 | async with self._lock: 36 | self._server.close() 37 | await self._server.wait_closed() 38 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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-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 | async def tracing_info(self) -> dict[str, Any]: ... 39 | 40 | def logging_extra(self) -> dict[str, Any]: ... 41 | 42 | 43 | class JobStatus(Enum): 44 | RUNNING = "running" 45 | FAILED = "failed" 46 | SUCCESS = "success" 47 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/ipc/mock_room.py: -------------------------------------------------------------------------------- 1 | from unittest.mock import create_autospec 2 | 3 | from livekit import rtc 4 | 5 | MockRoom = create_autospec(rtc.Room, instance=True) 6 | MockRoom.local_participant = create_autospec(rtc.LocalParticipant, instance=True) 7 | MockRoom._info = create_autospec(rtc.room.proto_room.RoomInfo, instance=True) # type: ignore 8 | MockRoom.isconnected.return_value = True 9 | MockRoom.name = "fake_room" 10 | 11 | mock_remote_participant = create_autospec(rtc.RemoteParticipant, instance=True) 12 | mock_remote_participant.identity = "fake_human" 13 | mock_remote_participant.sid = "PA_fake_human" 14 | mock_remote_participant.kind = rtc.ParticipantKind.PARTICIPANT_KIND_STANDARD 15 | MockRoom.remote_participants = {mock_remote_participant.sid: mock_remote_participant} 16 | 17 | if __name__ == "__main__": 18 | mock_room = MockRoom 19 | 20 | print("local_participant", mock_room.local_participant) 21 | print("isconnected", mock_room.isconnected()) 22 | print("remote_participants", mock_room.remote_participants) 23 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/llm/_provider_format/__init__.py: -------------------------------------------------------------------------------- 1 | from . import anthropic, aws, google, openai 2 | 3 | __all__ = ["openai", "google", "aws", "anthropic"] 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-agents/livekit/agents/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-agents/livekit/agents/py.typed -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/.gitattributes: -------------------------------------------------------------------------------- 1 | *.ogg filter=lfs diff=lfs merge=lfs -text -------------------------------------------------------------------------------- /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 | office-ambience.ogg by klankbeeld -- https://freesound.org/s/255591/ -- License: Attribution 4.0 4 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/resources/__init__.py: -------------------------------------------------------------------------------- 1 | # ignore 2 | -------------------------------------------------------------------------------- /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:cd8cfd07e20630510b521f1b62155841518875891c972836c0518dfc7c0e5cd9 3 | size 583455 4 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/stt/__init__.py: -------------------------------------------------------------------------------- 1 | from .fallback_adapter import AvailabilityChangedEvent, FallbackAdapter 2 | from .stream_adapter import StreamAdapter, StreamAdapterWrapper 3 | from .stt import ( 4 | STT, 5 | RecognitionUsage, 6 | RecognizeStream, 7 | SpeechData, 8 | SpeechEvent, 9 | SpeechEventType, 10 | SpeechStream, 11 | STTCapabilities, 12 | STTError, 13 | ) 14 | 15 | __all__ = [ 16 | "SpeechEventType", 17 | "SpeechEvent", 18 | "SpeechData", 19 | "RecognizeStream", 20 | "SpeechStream", 21 | "STT", 22 | "STTCapabilities", 23 | "StreamAdapter", 24 | "StreamAdapterWrapper", 25 | "RecognitionUsage", 26 | "FallbackAdapter", 27 | "AvailabilityChangedEvent", 28 | "STTError", 29 | ] 30 | 31 | # Cleanup docs of unexported modules 32 | _module = dir() 33 | NOT_IN_ALL = [m for m in _module if m not in __all__] 34 | 35 | __pdoc__ = {} 36 | 37 | for n in NOT_IN_ALL: 38 | __pdoc__[n] = False 39 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/tokenize/__init__.py: -------------------------------------------------------------------------------- 1 | from . import basic, 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 | "utils", 21 | ] 22 | 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/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 .tts import ( 9 | TTS, 10 | AudioEmitter, 11 | ChunkedStream, 12 | SynthesizedAudio, 13 | SynthesizeStream, 14 | TTSCapabilities, 15 | TTSError, 16 | ) 17 | 18 | __all__ = [ 19 | "TTS", 20 | "SynthesizedAudio", 21 | "SynthesizeStream", 22 | "TTSCapabilities", 23 | "StreamAdapterWrapper", 24 | "StreamAdapter", 25 | "ChunkedStream", 26 | "AvailabilityChangedEvent", 27 | "FallbackAdapter", 28 | "FallbackChunkedStream", 29 | "FallbackSynthesizeStream", 30 | "AudioEmitter", 31 | "TTSError", 32 | ] 33 | 34 | 35 | # Cleanup docs of unexported modules 36 | _module = dir() 37 | NOT_IN_ALL = [m for m in _module if m not in __all__] 38 | 39 | __pdoc__ = {} 40 | 41 | for n in NOT_IN_ALL: 42 | __pdoc__[n] = False 43 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/__init__.py: -------------------------------------------------------------------------------- 1 | from livekit import rtc 2 | 3 | from . import aio, audio, codecs, http_context, hw, images 4 | from .audio import AudioBuffer, combine_frames, merge_frames 5 | from .connection_pool import ConnectionPool 6 | from .exp_filter import ExpFilter 7 | from .log import log_exceptions 8 | from .misc import is_given, shortuuid, time_ms 9 | from .moving_average import MovingAverage 10 | from .participant import wait_for_participant 11 | 12 | EventEmitter = rtc.EventEmitter 13 | 14 | __all__ = [ 15 | "AudioBuffer", 16 | "merge_frames", 17 | "combine_frames", 18 | "time_ms", 19 | "shortuuid", 20 | "http_context", 21 | "ExpFilter", 22 | "MovingAverage", 23 | "EventEmitter", 24 | "log_exceptions", 25 | "codecs", 26 | "images", 27 | "audio", 28 | "aio", 29 | "hw", 30 | "is_given", 31 | "ConnectionPool", 32 | "wait_for_participant", 33 | ] 34 | 35 | # Cleanup docs of unexported modules 36 | _module = dir() 37 | NOT_IN_ALL = [m for m in _module if m not in __all__] 38 | 39 | __pdoc__ = {} 40 | 41 | for n in NOT_IN_ALL: 42 | __pdoc__[n] = False 43 | -------------------------------------------------------------------------------- /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/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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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-agents/livekit/agents/utils/log.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import functools 3 | import logging 4 | from typing import Any, Callable, TypeVar, cast 5 | 6 | F = TypeVar("F", bound=Callable[..., Any]) 7 | 8 | 9 | def log_exceptions(msg: str = "", logger: logging.Logger = logging.getLogger()) -> Callable[[F], F]: # noqa: B008 10 | def deco(fn: F) -> F: 11 | if asyncio.iscoroutinefunction(fn): 12 | 13 | @functools.wraps(fn) 14 | async def async_fn_logs(*args: Any, **kwargs: Any) -> Any: 15 | try: 16 | return await fn(*args, **kwargs) 17 | except Exception: 18 | err = f"Error in {fn.__name__}" 19 | if msg: 20 | err += f" – {msg}" 21 | logger.exception(err) 22 | raise 23 | 24 | return cast(F, async_fn_logs) 25 | 26 | else: 27 | 28 | @functools.wraps(fn) 29 | def fn_logs(*args: Any, **kwargs: Any) -> Any: 30 | try: 31 | return fn(*args, **kwargs) 32 | except Exception: 33 | err = f"Error in {fn.__name__}" 34 | if msg: 35 | err += f" – {msg}" 36 | logger.exception(err) 37 | raise 38 | 39 | return cast(F, fn_logs) 40 | 41 | return deco 42 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/utils/misc.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import time 4 | import uuid 5 | from typing import TypeVar 6 | 7 | from typing_extensions import TypeGuard 8 | 9 | from ..types import NotGiven, NotGivenOr 10 | 11 | _T = TypeVar("_T") 12 | 13 | 14 | def time_ms() -> int: 15 | return int(time.time() * 1000 + 0.5) 16 | 17 | 18 | def shortuuid(prefix: str = "") -> str: 19 | return prefix + str(uuid.uuid4().hex)[:12] 20 | 21 | 22 | def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: 23 | return not isinstance(obj, NotGiven) 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-agents/livekit/agents/voice/__init__.py: -------------------------------------------------------------------------------- 1 | from .agent import Agent, InlineTask, ModelSettings 2 | from .agent_session import AgentSession, VoiceActivityVideoSampler 3 | from .chat_cli import ChatCLI 4 | from .events import ( 5 | AgentEvent, 6 | AgentStateChangedEvent, 7 | CloseEvent, 8 | CloseReason, 9 | ConversationItemAddedEvent, 10 | ErrorEvent, 11 | FunctionToolsExecutedEvent, 12 | MetricsCollectedEvent, 13 | RunContext, 14 | SpeechCreatedEvent, 15 | UserInputTranscribedEvent, 16 | UserStateChangedEvent, 17 | ) 18 | from .speech_handle import SpeechHandle 19 | 20 | __all__ = [ 21 | "ChatCLI", 22 | "AgentSession", 23 | "VoiceActivityVideoSampler", 24 | "Agent", 25 | "ModelSettings", 26 | "InlineTask", 27 | "SpeechHandle", 28 | "RunContext", 29 | "UserInputTranscribedEvent", 30 | "AgentEvent", 31 | "MetricsCollectedEvent", 32 | "ConversationItemAddedEvent", 33 | "SpeechCreatedEvent", 34 | "ErrorEvent", 35 | "CloseEvent", 36 | "CloseReason", 37 | "UserStateChangedEvent", 38 | "AgentStateChangedEvent", 39 | "FunctionToolsExecutedEvent", 40 | ] 41 | 42 | # Cleanup docs of unexported modules 43 | _module = dir() 44 | NOT_IN_ALL = [m for m in _module if m not in __all__] 45 | 46 | __pdoc__ = {} 47 | 48 | for n in NOT_IN_ALL: 49 | __pdoc__[n] = False 50 | -------------------------------------------------------------------------------- /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-agents/livekit/agents/voice/room_io/__init__.py: -------------------------------------------------------------------------------- 1 | from ...types import ATTRIBUTE_PUBLISH_ON_BEHALF 2 | from .room_io import ( 3 | DEFAULT_ROOM_INPUT_OPTIONS, 4 | DEFAULT_ROOM_OUTPUT_OPTIONS, 5 | RoomInputOptions, 6 | RoomIO, 7 | RoomOutputOptions, 8 | ) 9 | 10 | __all__ = [ 11 | "RoomIO", 12 | "DEFAULT_ROOM_INPUT_OPTIONS", 13 | "DEFAULT_ROOM_OUTPUT_OPTIONS", 14 | "RoomInputOptions", 15 | "RoomOutputOptions", 16 | "ATTRIBUTE_PUBLISH_ON_BEHALF", 17 | ] 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/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-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-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-anthropic/livekit/plugins/anthropic/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.anthropic") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anthropic/livekit/plugins/anthropic/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | ChatModels = Literal[ 4 | "claude-3-5-sonnet-20240620", 5 | "claude-3-opus-20240229", 6 | "claude-3-sonnet-20240229", 7 | "claude-3-5-sonnet-20241022", 8 | "claude-3-haiku-20240307", 9 | ] 10 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anthropic/livekit/plugins/anthropic/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-anthropic/livekit/plugins/anthropic/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-anthropic/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-anthropic" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for services from Anthropic" 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"] 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.0.22", "anthropic>=0.41", "httpx"] 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/anthropic/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-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-assemblyai/livekit/plugins/assemblyai/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.assemblyai") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-assemblyai/livekit/plugins/assemblyai/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-assemblyai/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-assemblyai" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for AssemblyAI" 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"] 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.0.22"] 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/assemblyai/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-aws/README.md: -------------------------------------------------------------------------------- 1 | # AWS plugin for LiveKit Agents 2 | 3 | Support for AWS AI including Bedrock, Polly, and Transcribe. 4 | 5 | See [https://docs.livekit.io/agents/integrations/aws/](https://docs.livekit.io/agents/integrations/aws/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-aws 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need to specify an AWS Access Key and a Deployment Region. They can be set as environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_DEFAULT_REGION`, respectively. -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.aws") 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-aws/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-aws" 7 | dynamic = ["version"] 8 | description = "LiveKit Agents Plugin for services from AWS" 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", "aws"] 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 = [ 26 | "livekit-agents>=1.0.22", 27 | "aioboto3>=14.1.0", 28 | "amazon-transcribe>=0.6.2", 29 | ] 30 | 31 | [project.urls] 32 | Documentation = "https://docs.livekit.io" 33 | Website = "https://livekit.io/" 34 | Source = "https://github.com/livekit/agents" 35 | 36 | [tool.hatch.version] 37 | path = "livekit/plugins/aws/version.py" 38 | 39 | [tool.hatch.build.targets.wheel] 40 | packages = ["livekit"] 41 | 42 | [tool.hatch.build.targets.sdist] 43 | include = ["/livekit"] 44 | -------------------------------------------------------------------------------- /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-azure/livekit/plugins/azure/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.azure") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-azure/livekit/plugins/azure/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-azure/livekit/plugins/azure/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-azure/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-azure" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for services from Azure" 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"] 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 = [ 26 | "livekit-agents>=1.0.22", 27 | "azure-cognitiveservices-speech>=1.43.0", 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/azure/version.py" 37 | 38 | [tool.hatch.build.targets.wheel] 39 | packages = ["livekit"] 40 | 41 | [tool.hatch.build.targets.sdist] 42 | include = ["/livekit"] 43 | -------------------------------------------------------------------------------- /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-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-bey/livekit/plugins/bey/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-bey/livekit/plugins/bey/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bey/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-bey" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for services from Beyond Presence" 9 | readme = "README.md" 10 | license = "Apache-2.0" 11 | requires-python = ">=3.9.0" 12 | authors = [{ name = "LiveKit", email = "support@livekit.io" }] 13 | keywords = ["webrtc", "realtime", "audio", "video", "livekit"] 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.0.22"] 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/bey/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-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-bithuman/livekit/plugins/bithuman/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.bithuman") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bithuman/livekit/plugins/bithuman/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-bithuman/livekit/plugins/bithuman/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-bithuman/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-bithuman" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for services from BitHuman Avatar Rendering" 9 | readme = "README.md" 10 | license = "Apache-2.0" 11 | requires-python = ">=3.9.0" 12 | authors = [{ name = "LiveKit", email = "support@livekit.io" }] 13 | keywords = ["webrtc", "realtime", "audio", "video", "livekit"] 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.10", 22 | "Programming Language :: Python :: 3 :: Only", 23 | ] 24 | dependencies = ["livekit-agents>=1.0.22", "bithuman>=0.5.10"] 25 | 26 | [project.urls] 27 | Documentation = "https://docs.livekit.io" 28 | Website = "https://livekit.io/" 29 | Source = "https://github.com/livekit/agents" 30 | 31 | [tool.hatch.version] 32 | path = "livekit/plugins/bithuman/version.py" 33 | 34 | [tool.hatch.build.targets.wheel] 35 | packages = ["livekit"] 36 | 37 | [tool.hatch.build.targets.sdist] 38 | include = ["/livekit"] 39 | -------------------------------------------------------------------------------- /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-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-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/__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 | """Browser plugin for LiveKit Agents 16 | 17 | Support for Chromium Embedded Framework (CEF). 18 | """ 19 | 20 | from livekit.agents import Plugin 21 | 22 | from .log import logger 23 | from .proc import BrowserContext, BrowserPage 24 | from .version import __version__ 25 | 26 | __all__ = ["BrowserContext", "BrowserPage"] 27 | 28 | 29 | class BrowserPlugin(Plugin): 30 | def __init__(self): 31 | super().__init__(__name__, __version__, __package__, logger) 32 | 33 | 34 | Plugin.register_plugin(BrowserPlugin()) 35 | 36 | # Cleanup docs of unexported modules 37 | _module = dir() 38 | NOT_IN_ALL = [m for m in _module if m not in __all__] 39 | 40 | __pdoc__ = {} 41 | 42 | for n in NOT_IN_ALL: 43 | __pdoc__[n] = False 44 | -------------------------------------------------------------------------------- /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-browser/livekit/plugins/browser/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-browser/livekit/plugins/browser/py.typed -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/livekit/plugins/browser/resources/__init__.py: -------------------------------------------------------------------------------- 1 | """Used by importlib.resources and setuptools""" 2 | -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /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-browser/src/.gitignore: -------------------------------------------------------------------------------- 1 | Debug/ 2 | Release/ 3 | lib* -------------------------------------------------------------------------------- /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-browser/src/dummy.cpp: -------------------------------------------------------------------------------- 1 | int main() { 2 | return 0; 3 | } -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-browser/src/helper_main_linux.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /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-browser/src/helper_main_win.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-browser/src/helper_main_win.cpp -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-cartesia/README.md: -------------------------------------------------------------------------------- 1 | # Cartesia plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with [Cartesia](https://cartesia.ai/). 4 | 5 | See https://docs.livekit.io/agents/integrations/tts/cartesia/ for more information. 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-cartesia/livekit/plugins/cartesia/__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 | """Cartesia plugin for LiveKit Agents 16 | 17 | See https://docs.livekit.io/agents/integrations/tts/cartesia/ for more information. 18 | """ 19 | 20 | from .tts import TTS, ChunkedStream 21 | from .version import __version__ 22 | 23 | __all__ = ["TTS", "ChunkedStream", "__version__"] 24 | 25 | from livekit.agents import Plugin 26 | 27 | from .log import logger 28 | 29 | 30 | class CartesiaPlugin(Plugin): 31 | def __init__(self) -> None: 32 | super().__init__(__name__, __version__, __package__, logger) 33 | 34 | 35 | Plugin.register_plugin(CartesiaPlugin()) 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-cartesia/livekit/plugins/cartesia/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.cartesia") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSEncoding = Literal[ 4 | "pcm_s16le", 5 | # Not yet supported 6 | # "pcm_f32le", 7 | # "pcm_mulaw", 8 | # "pcm_alaw", 9 | ] 10 | 11 | TTSModels = Literal["sonic", "sonic-2", "sonic-lite", "sonic-preview", "sonic-turbo"] 12 | TTSLanguages = Literal["en", "es", "fr", "de", "pt", "zh", "ja"] 13 | TTSDefaultVoiceId = "794f9389-aac1-45b6-b726-9d9369183238" 14 | TTSVoiceSpeed = Literal["fastest", "fast", "normal", "slow", "slowest"] 15 | TTSVoiceEmotion = Literal[ 16 | "anger:lowest", 17 | "anger:low", 18 | "anger", 19 | "anger:high", 20 | "anger:highest", 21 | "positivity:lowest", 22 | "positivity:low", 23 | "positivity", 24 | "positivity:high", 25 | "positivity:highest", 26 | "surprise:lowest", 27 | "surprise:low", 28 | "surprise", 29 | "surprise:high", 30 | "surprise:highest", 31 | "sadness:lowest", 32 | "sadness:low", 33 | "sadness", 34 | "sadness:high", 35 | "sadness:highest", 36 | "curiosity:lowest", 37 | "curiosity:low", 38 | "curiosity", 39 | "curiosity:high", 40 | "curiosity:highest", 41 | ] 42 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-cartesia/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-cartesia" 7 | dynamic = ["version"] 8 | description = "LiveKit Agents Plugin for Cartesia" 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"] 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.0.22"] 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/cartesia/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-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-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-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-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 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-clova/livekit/plugins/clova/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-clova/livekit/plugins/clova/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-clova/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-clova" 7 | dynamic = ["version"] 8 | description = "LiveKit Agents Plugin for LINE Clova STT" 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"] 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.0.22", "pydub~=0.25.1"] 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/clova/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-deepgram/README.md: -------------------------------------------------------------------------------- 1 | # Deepgram plugin for LiveKit Agents 2 | 3 | Support for speech-to-text with [Deepgram](https://deepgram.com/). 4 | 5 | See [https://docs.livekit.io/agents/integrations/stt/deepgram/](https://docs.livekit.io/agents/integrations/stt/deepgram/) for more information. 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-deepgram/livekit/plugins/deepgram/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.deepgram") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-deepgram/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-deepgram" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for services using Deepgram's API." 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"] 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[codecs]>=1.0.22", "numpy>=1.26"] 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/deepgram/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-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-elevenlabs/livekit/plugins/elevenlabs/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.elevenlabs") 4 | -------------------------------------------------------------------------------- /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 | ] 12 | 13 | TTSEncoding = Literal[ 14 | "mp3_22050_32", 15 | "mp3_44100", 16 | "mp3_44100_32", 17 | "mp3_44100_64", 18 | "mp3_44100_96", 19 | "mp3_44100_128", 20 | "mp3_44100_192", 21 | ] 22 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-elevenlabs/livekit/plugins/elevenlabs/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-elevenlabs/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-elevenlabs" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for voice synthesis with ElevenLabs' API." 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", "elevenlabs"] 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[codecs]>=1.0.22"] 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/elevenlabs/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-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-fal/livekit/plugins/fal/__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 | """Fal plugin for LiveKit Agents 16 | 17 | See https://docs.livekit.io/agents/integrations/stt/fal/ for more information. 18 | """ 19 | 20 | from .stt import WizperSTT 21 | from .version import __version__ 22 | 23 | __all__ = ["WizperSTT", "__version__"] 24 | 25 | 26 | from livekit.agents import Plugin 27 | 28 | from .log import logger 29 | 30 | 31 | class FalPlugin(Plugin): 32 | def __init__(self) -> None: 33 | super().__init__(__name__, __version__, __package__, logger) 34 | 35 | 36 | Plugin.register_plugin(FalPlugin()) 37 | 38 | # Cleanup docs of unexported modules 39 | _module = dir() 40 | NOT_IN_ALL = [m for m in _module if m not in __all__] 41 | 42 | __pdoc__ = {} 43 | 44 | for n in NOT_IN_ALL: 45 | __pdoc__[n] = False 46 | -------------------------------------------------------------------------------- /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-fal/livekit/plugins/fal/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-fal/livekit/plugins/fal/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /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 = ["webrtc", "realtime", "audio", "video", "livekit"] 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.0.22", "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 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/_utils.py: -------------------------------------------------------------------------------- 1 | import time 2 | from typing import Callable, Generic, Optional, TypeVar 3 | 4 | T = TypeVar("T") 5 | 6 | 7 | class PeriodicCollector(Generic[T]): 8 | def __init__(self, callback: Callable[[T], None], *, duration: float) -> None: 9 | """ 10 | Create a new periodic collector that accumulates values and calls the callback 11 | after the specified duration if there are values to report. 12 | 13 | Args: 14 | duration: Time in seconds between callback invocations 15 | callback: Function to call with accumulated value when duration expires 16 | """ 17 | self._duration = duration 18 | self._callback = callback 19 | self._last_flush_time = time.monotonic() 20 | self._total: Optional[T] = None 21 | 22 | def push(self, value: T) -> None: 23 | """Add a value to the accumulator""" 24 | if self._total is None: 25 | self._total = value 26 | else: 27 | self._total += value # type: ignore 28 | if time.monotonic() - self._last_flush_time >= self._duration: 29 | self.flush() 30 | 31 | def flush(self) -> None: 32 | """Force callback to be called with current total if non-zero""" 33 | if self._total is not None: 34 | self._callback(self._total) 35 | self._total = None 36 | self._last_flush_time = time.monotonic() 37 | -------------------------------------------------------------------------------- /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-gladia/livekit/plugins/gladia/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-google/README.md: -------------------------------------------------------------------------------- 1 | # Google AI plugin for LiveKit Agents 2 | 3 | Support for Gemini, Gemini Live, Cloud Speech-to-Text, and Cloud Text-to-Speech. 4 | 5 | See [https://docs.livekit.io/agents/integrations/google/](https://docs.livekit.io/agents/integrations/google/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-google 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | For credentials, you'll need a Google Cloud account and obtain the correct credentials. Credentials can be passed directly or via Application Default Credentials as specified in [How Application Default Credentials works](https://cloud.google.com/docs/authentication/application-default-credentials). 16 | 17 | To use the STT and TTS API, you'll need to enable the respective services for your Google Cloud project. 18 | 19 | - Cloud Speech-to-Text API 20 | - Cloud Text-to-Speech API 21 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-google/livekit/plugins/google/beta/__init__.py: -------------------------------------------------------------------------------- 1 | from . import realtime 2 | 3 | __all__ = ["realtime"] 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-google/livekit/plugins/google/beta/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-google/livekit/plugins/google/beta/realtime/api_proto.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from collections.abc import Sequence 4 | from typing import Literal, Union 5 | 6 | from google.genai import types 7 | 8 | LiveAPIModels = Literal[ 9 | "gemini-2.0-flash-exp", 10 | # models supported on Gemini API 11 | "gemini-2.0-flash-live-001", 12 | "gemini-2.5-flash-preview-native-audio-dialog", 13 | "gemini-2.5-flash-exp-native-audio-thinking-dialog", 14 | ] 15 | 16 | Voice = Literal["Puck", "Charon", "Kore", "Fenrir", "Aoede", "Leda", "Oru", "Zephyr"] 17 | 18 | 19 | ClientEvents = Union[ 20 | types.ContentListUnion, 21 | types.ContentListUnionDict, 22 | types.LiveClientContentOrDict, 23 | types.LiveClientRealtimeInput, 24 | types.LiveClientRealtimeInputOrDict, 25 | types.LiveClientToolResponseOrDict, 26 | types.FunctionResponseOrDict, 27 | Sequence[types.FunctionResponseOrDict], 28 | ] 29 | -------------------------------------------------------------------------------- /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-google/livekit/plugins/google/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-google/livekit/plugins/google/py.typed -------------------------------------------------------------------------------- /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-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.0.22" 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-groq/livekit/plugins/groq/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.groq") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-groq/livekit/plugins/groq/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | # listing production models from https://console.groq.com/docs/models 4 | 5 | STTModels = Literal[ 6 | "whisper-large-v3", 7 | "whisper-large-v3-turbo", 8 | "distil-whisper-large-v3-en", 9 | ] 10 | 11 | LLMModels = Literal[ 12 | "llama3-8b-8192", 13 | "llama3-70b-8192", 14 | "llama-guard-3-8b", 15 | "llama-3.1-8b-instant", 16 | "llama-3.3-70b-versatile", 17 | "meta-llama/llama-4-scout-17b-16e-instruct", 18 | "meta-llama/llama-4-maverick-17b-128e-instruct", 19 | "deepseek-r1-distill-llama-70b", 20 | ] 21 | 22 | TTSModels = Literal[ 23 | "playai-tts", 24 | "playai-tts-arabic", 25 | ] 26 | 27 | TTSVoices = Literal[ 28 | # english voices 29 | "Arista-PlayAI", 30 | "Atlas-PlayAI", 31 | "Basil-PlayAI", 32 | "Briggs-PlayAI", 33 | "Calum-PlayAI", 34 | "Celeste-PlayAI", 35 | "Cheyenne-PlayAI", 36 | "Chip-PlayAI", 37 | "Cillian-PlayAI", 38 | "Deedee-PlayAI", 39 | "Fritz-PlayAI", 40 | "Gail-PlayAI", 41 | "Indigo-PlayAI", 42 | "Mamaw-PlayAI", 43 | "Mason-PlayAI", 44 | "Mikail-PlayAI", 45 | "Mitch-PlayAI", 46 | "Quinn-PlayAI", 47 | "Thunder-PlayAI", 48 | # arabic voices 49 | "Nasser-PlayAI", 50 | "Khalid-PlayAI", 51 | "Amira-PlayAI", 52 | "Ahmad-PlayAI", 53 | ] 54 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-groq/livekit/plugins/groq/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-groq/livekit/plugins/groq/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /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 = ["webrtc", "realtime", "audio", "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]>=1.0.22", 25 | "livekit-plugins-openai>=1.0.0.dev5", 26 | "aiohttp", 27 | "livekit", 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/groq/version.py" 37 | 38 | [tool.hatch.build.targets.wheel] 39 | packages = ["livekit"] 40 | 41 | [tool.hatch.build.targets.sdist] 42 | include = ["/livekit"] 43 | -------------------------------------------------------------------------------- /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-hume/livekit/plugins/hume/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.hume") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-hume/livekit/plugins/hume/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /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 = ["webrtc", "realtime", "audio", "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.0.22", 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-lmnt/README.md: -------------------------------------------------------------------------------- 1 | # LLMNT plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with [LMNT](https://app.lmnt.com/). 4 | 5 | See [https://docs.livekit.io/agents/integrations/tts/lmnt/]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-lmnt/livekit/plugins/lmnt/__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 | """LMNT plugin for LiveKit Agents 16 | 17 | See https://docs.livekit.io/agents/integrations/tts/lmnt/ for more information. 18 | """ 19 | 20 | from .tts import TTS, ChunkedStream 21 | from .version import __version__ 22 | 23 | __all__ = ["TTS", "ChunkedStream", "__version__"] 24 | 25 | from livekit.agents import Plugin 26 | 27 | 28 | class LMNTPlugin(Plugin): 29 | def __init__(self) -> None: 30 | super().__init__(__name__, __version__, __package__) 31 | 32 | 33 | Plugin.register_plugin(LMNTPlugin()) 34 | 35 | # Cleanup docs of unexported modules 36 | _module = dir() 37 | NOT_IN_ALL = [m for m in _module if m not in __all__] 38 | 39 | __pdoc__ = {} 40 | 41 | for n in NOT_IN_ALL: 42 | __pdoc__[n] = False 43 | -------------------------------------------------------------------------------- /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-lmnt/livekit/plugins/lmnt/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-lmnt/livekit/plugins/lmnt/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /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.0.22"] 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-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 | -------------------------------------------------------------------------------- /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-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-minimal/livekit/plugins/minimal/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-minimal/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-minimal" 7 | dynamic = ["version"] 8 | description = "Minimal plugin template 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 = ["webrtc", "realtime", "audio", "video", "livekit"] 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.0.22"] 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/minimal/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-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-neuphonic/livekit/plugins/neuphonic/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.neuphonic") 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-neuphonic/livekit/plugins/neuphonic/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-neuphonic/livekit/plugins/neuphonic/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /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 = ["webrtc", "realtime", "audio", "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.0.22", 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-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-nltk/livekit/plugins/nltk/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.nltk") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nltk/livekit/plugins/nltk/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-nltk/livekit/plugins/nltk/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-nltk/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-nltk" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for NLTK-based text processing." 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"] 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.9", 21 | "Programming Language :: Python :: 3.10", 22 | "Programming Language :: Python :: 3 :: Only", 23 | ] 24 | dependencies = ["livekit-agents>=1.0.22", "nltk >= 3.9.1, < 4"] 25 | 26 | [project.urls] 27 | Documentation = "https://docs.livekit.io" 28 | Website = "https://livekit.io/" 29 | Source = "https://github.com/livekit/agents" 30 | 31 | [tool.hatch.version] 32 | path = "livekit/plugins/nltk/version.py" 33 | 34 | [tool.hatch.build.targets.wheel] 35 | packages = ["livekit"] 36 | 37 | [tool.hatch.build.targets.sdist] 38 | include = ["/livekit"] 39 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-openai/livekit/plugins/openai/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/py.typed -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/realtime/__init__.py: -------------------------------------------------------------------------------- 1 | from .realtime_model import RealtimeModel, RealtimeSession 2 | 3 | __all__ = [ 4 | "RealtimeSession", 5 | "RealtimeModel", 6 | ] 7 | 8 | # Cleanup docs of unexported modules 9 | _module = dir() 10 | NOT_IN_ALL = [m for m in _module if m not in __all__] 11 | 12 | __pdoc__ = {} 13 | 14 | for n in NOT_IN_ALL: 15 | __pdoc__[n] = False 16 | -------------------------------------------------------------------------------- /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 import llm 8 | from livekit.agents.llm.tool_context import ( 9 | get_raw_function_info, 10 | is_function_tool, 11 | is_raw_function_tool, 12 | ) 13 | from openai.types.chat import ChatCompletionToolParam 14 | 15 | AsyncAzureADTokenProvider = Callable[[], Union[str, Awaitable[str]]] 16 | 17 | 18 | def get_base_url(base_url: str | None) -> str: 19 | if not base_url: 20 | base_url = os.getenv("OPENAI_BASE_URL", "https://api.openai.com/v1") 21 | return base_url 22 | 23 | 24 | def to_fnc_ctx( 25 | fnc_ctx: list[llm.FunctionTool | llm.RawFunctionTool], 26 | ) -> list[ChatCompletionToolParam]: 27 | tools: list[ChatCompletionToolParam] = [] 28 | for fnc in fnc_ctx: 29 | if is_raw_function_tool(fnc): 30 | info = get_raw_function_info(fnc) 31 | tools.append( 32 | { 33 | "type": "function", 34 | "function": info.raw_schema, # type: ignore 35 | } 36 | ) 37 | elif is_function_tool(fnc): 38 | tools.append(llm.utils.build_strict_openai_schema(fnc)) # type: ignore 39 | 40 | return tools 41 | -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-playai/README.md: -------------------------------------------------------------------------------- 1 | # PlayAI/PlayHT plugin for LiveKit Agents 2 | 3 | Support for voice synthesis with [PlayAI](https://play.ai/). 4 | 5 | See [https://docs.livekit.io/agents/integrations/tts/playai/](https://docs.livekit.io/agents/integrations/tts/playai/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-playai 11 | ``` 12 | 13 | ## Pre-requisites 14 | 15 | You'll need USER ID and API Secret KEY from PlayHT. It can be set as an environment variable: `PLAYHT_USER_ID`, `PLAYHT_API_KEY` get it from [here](https://play.ht/studio/api-access) 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-playai/livekit/plugins/playai/__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 | """PlayAI plugin for LiveKit Agents 16 | 17 | See https://docs.livekit.io/agents/integrations/tts/playai/ for more information. 18 | """ 19 | 20 | from .tts import TTS 21 | from .version import __version__ 22 | 23 | __all__ = [ 24 | "TTS", 25 | "__version__", 26 | ] 27 | 28 | from livekit.agents import Plugin 29 | 30 | 31 | class PlayAIPlugin(Plugin): 32 | def __init__(self) -> None: 33 | super().__init__(__name__, __version__, __package__) 34 | 35 | 36 | Plugin.register_plugin(PlayAIPlugin()) 37 | 38 | # Cleanup docs of unexported modules 39 | _module = dir() 40 | NOT_IN_ALL = [m for m in _module if m not in __all__] 41 | 42 | __pdoc__ = {} 43 | 44 | for n in NOT_IN_ALL: 45 | __pdoc__[n] = False 46 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-playai/livekit/plugins/playai/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.playai") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-playai/livekit/plugins/playai/models.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSModel = Literal["Play3.0-mini", "PlayDialog", "PlayDialog-turbo"] 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-playai/livekit/plugins/playai/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-playai/livekit/plugins/playai/py.typed -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-playai/livekit/plugins/playai/version.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.0.22" 2 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-playai/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-playai" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for voice synthesis with PlayAI's API." 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", "livekit", "playHT", "playAI"] 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]>=1.0.22", 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/playai/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-resemble/livekit/plugins/resemble/__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 | """Resemble plugin for LiveKit Agents 16 | 17 | See https://docs.livekit.io/agents/integrations/tts/resemble/ for more information. 18 | """ 19 | 20 | from .tts import TTS, ChunkedStream, SynthesizeStream 21 | from .version import __version__ 22 | 23 | __all__ = ["TTS", "ChunkedStream", "SynthesizeStream", "__version__"] 24 | 25 | from livekit.agents import Plugin 26 | 27 | 28 | class ResemblePlugin(Plugin): 29 | def __init__(self) -> None: 30 | super().__init__(__name__, __version__, __package__) 31 | 32 | 33 | Plugin.register_plugin(ResemblePlugin()) 34 | 35 | # Cleanup docs of unexported modules 36 | _module = dir() 37 | NOT_IN_ALL = [m for m in _module if m not in __all__] 38 | 39 | __pdoc__ = {} 40 | 41 | for n in NOT_IN_ALL: 42 | __pdoc__[n] = False 43 | -------------------------------------------------------------------------------- /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-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-resemble/livekit/plugins/resemble/py.typed: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-resemble/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-resemble" 7 | dynamic = ["version"] 8 | description = "LiveKit Agents Plugin for Resemble AI" 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"] 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 = [ 26 | "livekit-agents>=1.0.22", 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/resemble/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-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-rime/livekit/plugins/rime/__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 | """Rime plugin for LiveKit Agents 16 | 17 | See https://docs.livekit.io/agents/integrations/tts/rime/ for more information. 18 | """ 19 | 20 | from .tts import TTS, ChunkedStream 21 | from .version import __version__ 22 | 23 | __all__ = ["TTS", "ChunkedStream", "__version__"] 24 | 25 | from livekit.agents import Plugin 26 | 27 | 28 | class RimePlugin(Plugin): 29 | def __init__(self) -> None: 30 | super().__init__(__name__, __version__, __package__) 31 | 32 | 33 | Plugin.register_plugin(RimePlugin()) 34 | 35 | # Cleanup docs of unexported modules 36 | _module = dir() 37 | NOT_IN_ALL = [m for m in _module if m not in __all__] 38 | 39 | __pdoc__ = {} 40 | 41 | for n in NOT_IN_ALL: 42 | __pdoc__[n] = False 43 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-rime/livekit/plugins/rime/langs.py: -------------------------------------------------------------------------------- 1 | from typing import Literal 2 | 3 | TTSLangs = Literal["eng", "spa", "fra", "ger"] 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-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-plugins-rime/livekit/plugins/rime/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-rime/livekit/plugins/rime/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /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.0.22"] 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 | -------------------------------------------------------------------------------- /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/build/turns/vad/](https://docs.livekit.io/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-plugins/livekit-plugins-silero/livekit/plugins/silero/__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 | """Silero VAD plugin for LiveKit Agents 16 | 17 | See https://docs.livekit.io/build/turns/vad/ for more information. 18 | """ 19 | 20 | from .vad import VAD, VADStream 21 | from .version import __version__ 22 | 23 | __all__ = ["VAD", "VADStream", "__version__"] 24 | 25 | from livekit.agents import Plugin 26 | 27 | from .log import logger 28 | 29 | 30 | class SileroPlugin(Plugin): 31 | def __init__(self) -> None: 32 | super().__init__(__name__, __version__, __package__, logger) 33 | 34 | 35 | Plugin.register_plugin(SileroPlugin()) 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-silero/livekit/plugins/silero/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.silero") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/py.typed -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-silero/livekit/plugins/silero/resources/silero_vad.onnx: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6b99cbfd39246b6706f98ec13c7c50c6b299181f2474fa05cbc8046acc274396 3 | size 2313101 4 | -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /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-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-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-plugins/livekit-plugins-speechify/livekit/plugins/speechify/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-speechify/livekit/plugins/speechify/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechify/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-speechify" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for voice synthesis with Speechify's API." 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", "speechify"] 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[codecs]>=1.0.22"] 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/speechify/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-speechmatics/README.md: -------------------------------------------------------------------------------- 1 | # Speechmatics STT plugin for LiveKit Agents 2 | 3 | Support for Speechmatics STT. 4 | 5 | See [https://docs.livekit.io/agents/integrations/stt/speechmatics/](https://docs.livekit.io/agents/integrations/stt/speechmatics/) for more information. 6 | 7 | ## Installation 8 | 9 | ```bash 10 | pip install livekit-plugins-speechmatics 11 | ``` 12 | 13 | Usage: 14 | 15 | ```python 16 | from livekit.agents import AgentSession 17 | from livekit.plugins.turn_detector.english import EnglishModel 18 | from livekit.plugins import speechmatics 19 | 20 | agent = AgentSession( 21 | stt=speechmatics.STT(), 22 | turn_detector=EnglishModel(), 23 | min_endpointing_delay=0.5, 24 | max_endpointing_delay=5.0, 25 | ... 26 | ) 27 | ``` 28 | 29 | Note: The plugin was built with 30 | LiveKit's [end-of-turn detection feature](https://docs.livekit.io/agents/v1/build/turn-detection/) in mind, 31 | and it doesn't implement phrase endpointing. `AddTranscript` and `AddPartialTranscript` events are emitted as soon 32 | as they’re received from the Speechmatics STT engine. 33 | 34 | ## Pre-requisites 35 | 36 | You'll need to specify a Speechmatics API Key. It can be set as environment variable `SPEECHMATICS_API_KEY` or 37 | `.env.local` file. 38 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.speechmatics") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechmatics/project.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=61.0"] 3 | build-backend = "setuptools.build_meta" -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-speechmatics/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-speechmatics" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for Speechmatics" 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"] 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.0.22"] 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/speechmatics/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-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-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-tavus/livekit/plugins/tavus/log.py: -------------------------------------------------------------------------------- 1 | import logging 2 | 3 | logger = logging.getLogger("livekit.plugins.tavus") 4 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-tavus/livekit/plugins/tavus/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-tavus/livekit/plugins/tavus/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-tavus/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["hatchling"] 3 | build-backend = "hatchling.build" 4 | 5 | [project] 6 | name = "livekit-plugins-tavus" 7 | dynamic = ["version"] 8 | description = "Agent Framework plugin for Tavus" 9 | readme = "README.md" 10 | license = "Apache-2.0" 11 | requires-python = ">=3.9.0" 12 | authors = [{ name = "LiveKit", email = "support@livekit.io" }] 13 | keywords = ["webrtc", "realtime", "audio", "video", "livekit"] 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.0.22"] 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/tavus/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-turn-detector/livekit/plugins/turn_detector/english.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from livekit.agents.inference_runner import _InferenceRunner 4 | 5 | from .base import EOUModelBase, _EUORunnerBase 6 | 7 | 8 | class _EUORunnerEn(_EUORunnerBase): 9 | INFERENCE_METHOD = "lk_end_of_utterance_en" 10 | 11 | def __init__(self) -> None: 12 | super().__init__("en") 13 | 14 | 15 | class EnglishModel(EOUModelBase): 16 | def __init__(self, *, unlikely_threshold: float | None = None): 17 | super().__init__(model_type="en", unlikely_threshold=unlikely_threshold) 18 | 19 | def _inference_method(self) -> str: 20 | return _EUORunnerEn.INFERENCE_METHOD 21 | 22 | 23 | _InferenceRunner.register_runner(_EUORunnerEn) 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.2.0-intl", 7 | } 8 | HG_MODEL = "livekit/turn-detector" 9 | ONNX_FILENAME = "model_q8.onnx" 10 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/multilingual.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from livekit.agents.inference_runner import _InferenceRunner 4 | 5 | from .base import EOUModelBase, _EUORunnerBase 6 | 7 | 8 | class _EUORunnerMultilingual(_EUORunnerBase): 9 | INFERENCE_METHOD = "lk_end_of_utterance_multilingual" 10 | 11 | def __init__(self) -> None: 12 | super().__init__("multilingual") 13 | 14 | 15 | class MultilingualModel(EOUModelBase): 16 | def __init__(self, *, unlikely_threshold: float | None = None): 17 | super().__init__(model_type="multilingual", unlikely_threshold=unlikely_threshold) 18 | 19 | def _inference_method(self) -> str: 20 | return _EUORunnerMultilingual.INFERENCE_METHOD 21 | 22 | 23 | _InferenceRunner.register_runner(_EUORunnerMultilingual) 24 | -------------------------------------------------------------------------------- /livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/livekit-plugins/livekit-plugins-turn-detector/livekit/plugins/turn_detector/py.typed -------------------------------------------------------------------------------- /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.0.22" 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | **/test_vad*.wav -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/livekit/agents/960abfa09935eeae3390438ff2790121e4bdf379/tests/__init__.py -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/long.mp3: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a420326dbf4f37675bf14ae260fff776aee428ced887fc97e0936c36b96589f6 3 | size 559968 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /tests/long_synthesize_multi_tokens.txt: -------------------------------------------------------------------------------- 1 | Multi 2 | counterproductive, reestablishing, misunderstanding, nontraditional, unbelievable, self-awareness, interconnectivity, recontextualizing, oversimplification, decentralization, hyperactive, underrepresented -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/test_chat_ctx.py: -------------------------------------------------------------------------------- 1 | from livekit.agents.llm import utils 2 | 3 | # function_arguments_to_pydantic_model 4 | 5 | 6 | def ai_function1(a: int, b: str = "default") -> None: 7 | """ 8 | This is a test function 9 | Args: 10 | a: First argument 11 | b: Second argument 12 | """ 13 | pass 14 | 15 | 16 | def test_args_model(): 17 | from docstring_parser import parse_from_object 18 | 19 | docstring = parse_from_object(ai_function1) 20 | print(docstring.description) 21 | 22 | model = utils.function_arguments_to_pydantic_model(ai_function1) 23 | print(model.model_json_schema()) 24 | 25 | 26 | def test_dict(): 27 | from livekit import rtc 28 | from livekit.agents.llm import ChatContext, ImageContent 29 | 30 | chat_ctx = ChatContext() 31 | chat_ctx.add_message( 32 | role="user", 33 | content="Hello, world!", 34 | ) 35 | chat_ctx.add_message( 36 | role="assistant", 37 | content="Hello, world!", 38 | ) 39 | chat_ctx.add_message( 40 | role="user", 41 | content=[ 42 | ImageContent( 43 | image=rtc.VideoFrame(64, 64, rtc.VideoBufferType.RGB24, b"0" * 64 * 64 * 3) 44 | ) 45 | ], 46 | ) 47 | print(chat_ctx.to_dict()) 48 | print(chat_ctx.items) 49 | 50 | print(ChatContext.from_dict(chat_ctx.to_dict()).items) 51 | --------------------------------------------------------------------------------