forked from livekit/agents
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Speechmatics STT plugin (livekit#1510)
- Loading branch information
1 parent
4a8b2ff
commit 60d0b1d
Showing
17 changed files
with
690 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# livekit-plugins-speechmatics | ||
|
||
## 0.0.1 | ||
|
||
### Minor changes | ||
|
||
- Add speechmatics plugin [#1510](https://github.com/livekit/agents/pull/1510) ([@dumitrugutu](https://github.com/dumitrugutu)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# LiveKit Plugins Speechmatics | ||
|
||
Agent Framework plugin for Speechmatics. | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install livekit-plugins-speechmatics | ||
``` | ||
|
||
Usage: | ||
|
||
```python | ||
agent = VoicePipelineAgent( | ||
stt=speechmatics.STT(), | ||
turn_detector=turn_detector.EOUModel(), | ||
min_endpointing_delay=0.5, | ||
max_endpointing_delay=5.0, | ||
... | ||
) | ||
``` | ||
|
||
Note: The plugin was built with | ||
LiveKit's [end-of-turn detection feature](https://github.com/livekit/agents#in-house-phrase-endpointing-model) in mind, | ||
and it doesn't implement phrase endpointing. `AddTranscript` and `AddPartialTranscript` events are emitted as soon | ||
as they’re received from the Speechmatics STT engine. For the best user experience, | ||
we recommend running the agent with end-of-turn detection enabled ( | ||
see [example](https://github.com/livekit-examples/voice-pipeline-agent-python/blob/main/agent.py)). | ||
|
||
## Pre-requisites | ||
|
||
You'll need to specify a Speechmatics API Key. It can be set as environment variable `SPEECHMATICS_API_KEY` or | ||
`.env.local` file. |
32 changes: 32 additions & 0 deletions
32
livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from .log import logger | ||
from .stt import STT, SpeechStream | ||
from .version import __version__ | ||
|
||
__all__ = [ | ||
"STT", | ||
"SpeechStream", | ||
"logger", | ||
"__version__", | ||
] | ||
|
||
from livekit.agents import Plugin | ||
|
||
|
||
class SpeechmaticsPlugin(Plugin): | ||
def __init__(self): | ||
super().__init__(__name__, __version__, __package__) | ||
|
||
|
||
Plugin.register_plugin(SpeechmaticsPlugin()) |
3 changes: 3 additions & 0 deletions
3
livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/log.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import logging | ||
|
||
logger = logging.getLogger("livekit.plugins.speechmatics") |
Empty file.
Oops, something went wrong.