agents icon indicating copy to clipboard operation
agents copied to clipboard

Stream Manipulation using Custom Plugins

Open parshvadaftari opened this issue 1 year ago • 4 comments

Due to lack of Documentation in plugins section, I'm not sure how to build one let alone how to customise the already existing one. I want manipulate the input and output stream using the custom plugins as descirbed in the documentation but don't know how to do so. It just says:

The plugin framework is designed to be extensible, allowing anyone to build their own plugin. Your plugin can integrate with various providers or directly load models for local inference.

By adopting the standard STT or TTS interfaces, you can abstract away implementation specifics and simplify switching between different providers in your agent code. https://docs.livekit.io/agents/plugins/#Building-your-own

parshvadaftari avatar Jun 19 '24 05:06 parshvadaftari

I also don't know, but look at these plugins and try to adapt it / rewrite it? https://github.com/livekit/agents/tree/main/livekit-plugins

ChrisFeldmeier avatar Jul 18 '24 12:07 ChrisFeldmeier

Hey @parshvadaftari - custom behavior can be achieved by subclassing one of our base classes (STT, TTS, or LLM). For example, the openai LLM is implemented in this file: https://github.com/livekit/agents/blob/main/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py

Which is a subclass of this base class: https://github.com/livekit/agents/blob/main/livekit-agents/livekit/agents/llm/llm.py

It sounds like you aren't necessarily trying to create a brand new plugin, but rather a wrapper plugin that can "map" the output of an existing plugin. Is that correct?

keepingitneil avatar Jul 29 '24 22:07 keepingitneil

Hey @keepingitneil , I tried making my own plugin, but failed and used a different approach of making changes in the https://github.com/livekit/agents/blob/main/livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py file and manipulating the output using my requirements.

Is there any simply way to do the same? Like you mentioned about the custom plugin, any code snippet or any example of it would be helpfull, example which is not on the website.

parshvadaftari avatar Jul 31 '24 04:07 parshvadaftari

I closed the issue by mistake, apologies for it.

parshvadaftari avatar Jul 31 '24 05:07 parshvadaftari

Hey @parshvadaftari , did you find any documentation or snippet of code ?

I try to do a pluging so we could use any model.

pikooli avatar Nov 04 '24 17:11 pikooli

I am also interested in "Building you own" plugins, I would like to use other STT, LLM, and TTS models without the lists in LiveKit

Did anyone try and success to make custom plugins??

tanuki-create avatar Mar 12 '25 15:03 tanuki-create

Hey i am looking for same

mynul-islam-conexio avatar Mar 18 '25 23:03 mynul-islam-conexio

Same here

DK013 avatar Jul 14 '25 18:07 DK013