Skip to content

Commit

Permalink
add(plugin/deepgram): accepts parameter profanity_filter (#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
jebjebs authored Oct 3, 2024
1 parent 5a6f2d9 commit 9aee81b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/popular-needles-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"livekit-plugins-deepgram": patch
---

accepts parameter profanity_filter
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class STTOptions:
sample_rate: int
num_channels: int
keywords: list[Tuple[str, float]]
profanity_filter: bool


class STT(stt.STT):
Expand All @@ -66,6 +67,7 @@ def __init__(
endpointing_ms: int = 25,
filler_words: bool = False,
keywords: list[Tuple[str, float]] = [],
profanity_filter: bool = False,
api_key: str | None = None,
http_session: aiohttp.ClientSession | None = None,
) -> None:
Expand Down Expand Up @@ -117,6 +119,7 @@ def __init__(
sample_rate=48000,
num_channels=1,
keywords=keywords,
profanity_filter=profanity_filter,
)
self._session = http_session

Expand All @@ -137,6 +140,7 @@ async def recognize(
"detect_language": config.detect_language,
"smart_format": config.smart_format,
"keywords": self._opts.keywords,
"profanity_filter": config.profanity_filter,
}
if config.language:
recognize_config["language"] = config.language
Expand Down Expand Up @@ -231,6 +235,7 @@ async def _run(self, max_retry: int) -> None:
else self._opts.endpointing_ms,
"filler_words": self._opts.filler_words,
"keywords": self._opts.keywords,
"profanity_filter": self._opts.profanity_filter,
}

if self._opts.language:
Expand Down

0 comments on commit 9aee81b

Please sign in to comment.