TL;DR - Copy the Quick-Start Template into a new directory, fill in the blanks, run the test suite with
uv run pytest
, and open a PR.Plugin Categories
Each plugin implements one of the abstract base classes invision_agents/core
:
Category | Base class | Typical provider examples |
---|---|---|
STT (speech-to-text) | STT | Deepgram |
TTS (text-to-speech) | TTS | ElevenLabs |
VAD (voice activity detection) | VAD | Silero |
LLM (large language model) | LLM | OpenAI |
Realtime | Realtime | Gemini Live |
- WebRTC integration: Your plugin sends and receives audio frames to and from a Stream video call, with the webrtc code handled for you.
- Events: Plugins use our event system to emit events which can be handled by event listeners in your application.
System Architecture & Lifecycle
An example workflow could look like this:- You instantiate the plugin client and add it to your app.
- You listen for an event (e.g. audio received), which fires and triggers your plugin.
- Your plugin calls the third-party API.
- Results are dispatched via an event or directly into the call, e.g. for an STT plugin a
transcript
event is fired.
Required Overrides
The base class for each type of plugin has different abstract methods which must be implemented in your plugin code, e.g. for an STT plugin, you must override theSTT.process_audio
and STT.close
methods.
Quickstart Template
Below is the skeleton for a new STT plugin namedAcmeSTT
. Replace placeholders with real provider logic. For other plugin types, replace with their equivalent objects.
Create these files in the agents/plugins/acme
folder:
pyproject.toml
/plugins/acme/vision_agents/plugins/acme/__init__.py
/plugins/acme/vision_agents/plugins/acme/stt.py
/plugins/acme/vision_agents/tests/test_stt.py
Fill out your test suite to cover all the plugin’s functions and features.
Run the suite with:
README.md
Model your readme on other plugins - explain how to use the plugin, what’s possible with it, what needs to be set, the events it emits, etc.
Emitting Custom Events
The base class has anevents
system attached with uses our builtin EventManager
. This means you can emit events by calling:
Packaging & Distribution
First, install dev dependencies and make sure your tests all pass. Then, run quality checks:vision-agents-plugins-<provider>
namespace on PyPI.
Contribution Checklist
- Fork
agents
, create a feature branch - Add your plugin by implementing one of the base classes
- Ensure tests are all passing
- Ensure new code passes the
pre-commit
hooks - List runtime and test dependencies in
pyproject.toml
- Add documentation (
README.md
in the plugin folder)