Skip to content

feat(transcription): add opt-in Deepgram profanity filtering - #1454

Open
aakanshajagga14 wants to merge 6 commits into
fossasia:devfrom
aakanshajagga14:feat/deepgram-profanity-filter
Open

aakanshajagga14 wants to merge 6 commits into
fossasia:devfrom
aakanshajagga14:feat/deepgram-profanity-filter

Conversation

@aakanshajagga14

@aakanshajagga14 aakanshajagga14 commented Dec 1, 2026 •

Copy link
Copy Markdown

Description

Adds an opt-in DEEPGRAM_PROFANITY_FILTER setting for live Deepgram captions. The default keeps the existing request URL. When enabled, VoxBento sends profanity_filter=true on both the initial connection and the retry without glossary terms.

Related issue

Refs #161

Testing

  • Added URL tests for Nova-2 and Nova-3 and extended the mocked HTTP 400 glossary retry test for both flag values.
  • Offline smoke checks passed for the default and opt-in URLs, glossary retry, URL encoding, and floor-language handling. The full pytest suite remains for CI.

Demo

Offline test output with a mocked Deepgram connection.

https://github.com/user-attachments/assets/b260491c-6909-4612-a2be-2b3b42466763

Created with ChatGPT in Codex.

Summary by Sourcery

Allow deployments to enable profanity masking for live Deepgram captions while keeping it disabled by default.

New Features:

  • Add an opt-in Deepgram profanity filter, configurable across the deployment through DEEPGRAM_PROFANITY_FILTER.
  • Preserve the profanity-filter setting when Deepgram retries a connection without glossary terms.

Documentation:

  • Document the setting, its default, and its applicability to floor and booth transcription.

Tests:

  • Cover opt-in URL behavior for Nova-2 and Nova-3 and verify the setting across glossary-retry scenarios.

Chores:

  • Update the transcription provider map to note the optional profanity filter.

Summary by CodeRabbit

  • New Features
    • Added an optional Deepgram profanity filter for live transcription. It is off by default and can be enabled through configuration.
  • Documentation
    • Documented the setting, including which transcription modes it affects and the need to restart the portal after changing it.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 21:30
@sourcery-ai

sourcery-ai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Implementation

Add an optional profanity-filter parameter to Deepgram URLs and preserve it when retrying without glossary terms.

  • portal/transcription/providers/deepgram.py L41-47 (+4 small edits)

Configuration

Define the deployment-wide Deepgram profanity-filter setting, disabled by default.

  • portal/config.py L216

Documentation

Document the new setting and its effect on Deepgram transcription in the context map and administrator guide.

  • .agents/context/TRANSCRIPTION_MAP.md L112
  • website/docs/admin/transcription.mdx L58-59, L236 (removed lines)

Tests

Verify opt-in URL behavior for both supported models and that glossary retries retain the filter setting.

  • tests/test_deepgram_pipeline.py L36-44, L222-227 (+2 small edits)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds an opt-in DEEPGRAM_PROFANITY_FILTER setting. When enabled, Deepgram stream URLs include profanity_filter=true, including retries that omit glossary terms after an HTTP 400 response.

Changes: Deepgram Profanity Filtering

Layer / File(s) Summary
Expose the optional setting
.env.example, portal/config.py, .agents/context/TRANSCRIPTION_MAP.md, website/docs/admin/transcription.mdx
The setting defaults to false. The environment example and admin documentation describe how to enable it. The transcription map documents the optional setting.
Apply the setting to Deepgram requests
portal/transcription/providers/deepgram.py, tests/test_deepgram_pipeline.py
The URL builder adds profanity_filter=true when enabled. Stream setup passes the configured value, and glossary-rejection retries preserve it while omitting keyterms. Tests cover both supported models and both retry setting values.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature

Possibly related issues

  • fossasia/voxbento`Future Enhancement of speech to text pipeline #161` — This change adds the optional profanity-filter setting requested in part of the issue. It does not address the issue’s diarization, keyterms, redaction, or endpointing requests.

Possibly related PRs

Suggested labels: ai-assisted

Suggested reviewers: arnavballincode

Merge Risk: Minimal · up to 01797

This adds an opt-in profanity filter for Deepgram live captions. Behavior is unchanged unless the setting is enabled, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat(transcription): add opt-in Deepgram profanity filtering" matches the main change. The PR adds a DEEPGRAM_PROFANITY_FILTER setting (default false) in portal/config.py, a profanity_filte…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(transcription): add opt-in Deepgram profanity filtering" matches the main change. The PR adds a DEEPGRAM_PROFANITY_FILTER setting (default false) in portal/config.py, a profanity_filter flag on build_listen_url in portal/transcription/providers/deepgram.py that adds profanity_filter=true when enabled, retry preservation of that flag, tests in tests/test_deepgram_pipeline.py, and matching docs in .env.example and website/docs/admin/transcription.mdx. The title is concise, specific, and follows a conventional-commit style.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7aa4c261-9c7f-42c3-a753-759d014f8754
Commits

Reviewing files that changed from the base of the PR and between c1fb663 and 0179733.

Files selected for processing: 6

  • .agents/context/TRANSCRIPTION_MAP.md
  • .env.example
  • portal/config.py
  • portal/transcription/providers/deepgram.py
  • tests/test_deepgram_pipeline.py
  • website/docs/admin/transcription.mdx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@github-actions github-actions Bot added ai-assisted PR created or assisted with an AI coding agent new-contributor labels Dec 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted PR created or assisted with an AI coding agent new-contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants