livekit-plugins-speechmatics


Namelivekit-plugins-speechmatics JSON
Version 1.2.9 PyPI version JSON
download
home_pageNone
SummaryAgent Framework plugin for Speechmatics
upload_time2025-09-15 18:06:17
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9.0
licenseNone
keywords audio livekit realtime speechmatics video webrtc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Speechmatics STT plugin for LiveKit Agents

Support for Speechmatics STT.

See [https://docs.livekit.io/agents/integrations/stt/speechmatics/](https://docs.livekit.io/agents/integrations/stt/speechmatics/) for more information.

## Installation

```bash
pip install livekit-plugins-speechmatics
```

## Diarization

Speechmatics STT engine can be configured to emit information about individual speakers in a conversation. This needs to be enabled using `enable_diarization=True`. The text output of the transcription can be configured to include this information using the macros `speaker_id` and `text`, as shown in the examples below.

- `<{speaker_id}>{text}</{speaker_id}>` -> `<S1>Hello</S1>`
- `[Speaker {speaker_id}] {text}` -> `[Speaker S1] Hello`

You should adjust your system instructions to inform the LLM of this format for speaker identification.

## Usage (Speechmatics end of utterance detection and speaker ID)

To use the Speechmatics end of utterance detection and speaker ID, you can use the following configuration:

```python
from livekit.agents import AgentSession
from livekit.plugins import speechmatics

agent = AgentSession(
    stt=speechmatics.STT(
        end_of_utterance_silence_trigger=0.5,
        enable_diarization=True,
        speaker_active_format="<{speaker_id}>{text}</{speaker_id}>",
        additional_vocab=[
            speechmatics.AdditionalVocabEntry(
                content="LiveKit",
                sounds_like=["live kit"],
            ),
        ],
    ),
    ...
)
```

Note: Using the `end_of_utterance_silence_trigger` parameter will tell the STT engine to wait for this period of time from the last detected speech and then emit the full utterance to LiveKit. This may conflict with LiveKit's end of turn detection, so you may need to adjust the `min_endpointing_delay` and `max_endpointing_delay` parameters accordingly.

## Usage (LiveKit Turn Detection)

To use the LiveKit end of turn detection, the format for the output text needs to be adjusted to not include any extra content at the end of the utterance. Using `[Speaker S1] ...` as the `speaker_active_format` should work well. You may need to adjust your system instructions to inform the LLM of this format for speaker identification.

Usage:

```python
from livekit.agents import AgentSession
from livekit.plugins.turn_detector.english import EnglishModel
from livekit.plugins import speechmatics

agent = AgentSession(
    stt=speechmatics.STT(
        enable_diarization=True,
        end_of_utterance_mode=speechmatics.EndOfUtteranceMode.NONE,
        speaker_active_format="[Speaker {speaker_id}] {text}",
    ),
    turn_detector=EnglishModel(),
    min_endpointing_delay=0.5,
    max_endpointing_delay=5.0,
    ...
)
```

Note: The plugin was built with LiveKit's [end-of-turn detection feature](https://docs.livekit.io/agents/v1/build/turn-detection/) 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.

## 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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "livekit-plugins-speechmatics",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9.0",
    "maintainer_email": null,
    "keywords": "audio, livekit, realtime, speechmatics, video, webrtc",
    "author": null,
    "author_email": "LiveKit <hello@livekit.io>",
    "download_url": "https://files.pythonhosted.org/packages/d1/d0/9e6631e485d3ad762f765d97b12280908bcbedd00b7b2285b665ac83ce17/livekit_plugins_speechmatics-1.2.9.tar.gz",
    "platform": null,
    "description": "# Speechmatics STT plugin for LiveKit Agents\n\nSupport for Speechmatics STT.\n\nSee [https://docs.livekit.io/agents/integrations/stt/speechmatics/](https://docs.livekit.io/agents/integrations/stt/speechmatics/) for more information.\n\n## Installation\n\n```bash\npip install livekit-plugins-speechmatics\n```\n\n## Diarization\n\nSpeechmatics STT engine can be configured to emit information about individual speakers in a conversation. This needs to be enabled using `enable_diarization=True`. The text output of the transcription can be configured to include this information using the macros `speaker_id` and `text`, as shown in the examples below.\n\n- `<{speaker_id}>{text}</{speaker_id}>` -> `<S1>Hello</S1>`\n- `[Speaker {speaker_id}] {text}` -> `[Speaker S1] Hello`\n\nYou should adjust your system instructions to inform the LLM of this format for speaker identification.\n\n## Usage (Speechmatics end of utterance detection and speaker ID)\n\nTo use the Speechmatics end of utterance detection and speaker ID, you can use the following configuration:\n\n```python\nfrom livekit.agents import AgentSession\nfrom livekit.plugins import speechmatics\n\nagent = AgentSession(\n    stt=speechmatics.STT(\n        end_of_utterance_silence_trigger=0.5,\n        enable_diarization=True,\n        speaker_active_format=\"<{speaker_id}>{text}</{speaker_id}>\",\n        additional_vocab=[\n            speechmatics.AdditionalVocabEntry(\n                content=\"LiveKit\",\n                sounds_like=[\"live kit\"],\n            ),\n        ],\n    ),\n    ...\n)\n```\n\nNote: Using the `end_of_utterance_silence_trigger` parameter will tell the STT engine to wait for this period of time from the last detected speech and then emit the full utterance to LiveKit. This may conflict with LiveKit's end of turn detection, so you may need to adjust the `min_endpointing_delay` and `max_endpointing_delay` parameters accordingly.\n\n## Usage (LiveKit Turn Detection)\n\nTo use the LiveKit end of turn detection, the format for the output text needs to be adjusted to not include any extra content at the end of the utterance. Using `[Speaker S1] ...` as the `speaker_active_format` should work well. You may need to adjust your system instructions to inform the LLM of this format for speaker identification.\n\nUsage:\n\n```python\nfrom livekit.agents import AgentSession\nfrom livekit.plugins.turn_detector.english import EnglishModel\nfrom livekit.plugins import speechmatics\n\nagent = AgentSession(\n    stt=speechmatics.STT(\n        enable_diarization=True,\n        end_of_utterance_mode=speechmatics.EndOfUtteranceMode.NONE,\n        speaker_active_format=\"[Speaker {speaker_id}] {text}\",\n    ),\n    turn_detector=EnglishModel(),\n    min_endpointing_delay=0.5,\n    max_endpointing_delay=5.0,\n    ...\n)\n```\n\nNote: The plugin was built with LiveKit's [end-of-turn detection feature](https://docs.livekit.io/agents/v1/build/turn-detection/) in mind, and it doesn't implement phrase endpointing. `AddTranscript` and `AddPartialTranscript` events are emitted as soon as they\u2019re received from the Speechmatics STT engine.\n\n## Pre-requisites\n\nYou'll need to specify a Speechmatics API Key. It can be set as environment variable `SPEECHMATICS_API_KEY` or `.env.local` file.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Agent Framework plugin for Speechmatics",
    "version": "1.2.9",
    "project_urls": {
        "Documentation": "https://docs.livekit.io",
        "Source": "https://github.com/livekit/agents",
        "Website": "https://livekit.io/"
    },
    "split_keywords": [
        "audio",
        " livekit",
        " realtime",
        " speechmatics",
        " video",
        " webrtc"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d2357a1188136060bbf591cea0bbb1730a465ff1f962c1342453df9e1c59dc2d",
                "md5": "a62c7169a18f96c38d67f6c4b027672d",
                "sha256": "62e493442b21b61724206c047fe5c3dc6961e86c9b955b3a9221efa700c480e3"
            },
            "downloads": -1,
            "filename": "livekit_plugins_speechmatics-1.2.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a62c7169a18f96c38d67f6c4b027672d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.0",
            "size": 15120,
            "upload_time": "2025-09-15T18:06:16",
            "upload_time_iso_8601": "2025-09-15T18:06:16.837220Z",
            "url": "https://files.pythonhosted.org/packages/d2/35/7a1188136060bbf591cea0bbb1730a465ff1f962c1342453df9e1c59dc2d/livekit_plugins_speechmatics-1.2.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d1d09e6631e485d3ad762f765d97b12280908bcbedd00b7b2285b665ac83ce17",
                "md5": "a567a06697a260b0c7b386e5b8247332",
                "sha256": "3229933f653a20bd802a27c0b29898ade36e59391453d9dafbf9d4c8d4e9aae2"
            },
            "downloads": -1,
            "filename": "livekit_plugins_speechmatics-1.2.9.tar.gz",
            "has_sig": false,
            "md5_digest": "a567a06697a260b0c7b386e5b8247332",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.0",
            "size": 13935,
            "upload_time": "2025-09-15T18:06:17",
            "upload_time_iso_8601": "2025-09-15T18:06:17.966511Z",
            "url": "https://files.pythonhosted.org/packages/d1/d0/9e6631e485d3ad762f765d97b12280908bcbedd00b7b2285b665ac83ce17/livekit_plugins_speechmatics-1.2.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-15 18:06:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "livekit",
    "github_project": "agents",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "livekit-plugins-speechmatics"
}
        
Elapsed time: 1.40899s