Skip to content

[Fix] 220-django-channels-live-stt-python — pin deepgram-sdk to v6.1.1#174

Merged
lukeocodes merged 2 commits intomainfrom
fix/220-django-channels-live-stt-python-regression-2026-04-04
Apr 4, 2026
Merged

[Fix] 220-django-channels-live-stt-python — pin deepgram-sdk to v6.1.1#174
lukeocodes merged 2 commits intomainfrom
fix/220-django-channels-live-stt-python-regression-2026-04-04

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 4, 2026

Summary

  • Pin deepgram-sdk from loose >=4.0.0 to exact ==6.1.1 in requirements.txt
  • The consumer code already uses the v6 API surface (listen.v1.connect, EventType, ListenV1Results, send_media, send_close_stream), so no source changes were needed
  • All tests pass with the pinned version

Test plan

  • Installed dependencies with pinned SDK version
  • Ran test_example.py — all 5 tests pass
  • Reviewer: confirm CI passes on this branch

🤖 Generated with Claude Code

The requirements.txt had a loose lower bound (>=4.0.0) which could
pull in incompatible SDK versions. The consumer code already uses the
v6 API surface (listen.v1.connect, EventType, ListenV1Results), so
this pins the SDK to the required 6.1.1 release.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the type:fix Bug fix label Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 4, 2026

Code Review

Overall: APPROVED

Tests ran ✅

============================= test session starts ==============================
platform linux -- Python 3.11.15, pytest-9.0.2, pluggy-1.6.0
collected 5 items

tests/test_example.py::test_django_imports PASSED                        [ 20%]
tests/test_example.py::test_consumer_imports PASSED                      [ 40%]
tests/test_example.py::test_consumer_source_uses_deepgram PASSED         [ 60%]
tests/test_example.py::test_consumer_audio_forwarding PASSED             [ 80%]
tests/test_example.py::test_template_exists PASSED                       [100%]

============================== 5 passed in 0.72s ===============================

Integration genuineness

Pass. This is a Deepgram + Django Channels example. consumer.py imports AsyncDeepgramClient from the official SDK and makes a real live STT connection via listen.v1.connect(). The .env.example correctly lists DEEPGRAM_API_KEY. No third-party platform is involved — Django Channels is a framework, not an external API service.

Code quality

  • ✅ Official Deepgram SDK (deepgram-sdk==6.1.1) — matches required Python SDK version
  • tag="deepgram-examples" present on the Deepgram connection
  • ✅ No hardcoded credentials — key read from os.environ["DEEPGRAM_API_KEY"]
  • ✅ Error handling: on_error event handler, disconnect cleanup with try/except
  • ✅ Tests import from src/ and verify the consumer's structure and configuration
  • ✅ Credential check runs first (top of test file, before any SDK imports)
  • ✅ No word-list assertions — tests verify structural properties, not specific transcripts

Documentation

  • ✅ README covers what you'll build, env vars with where-to-get links, install/run instructions
  • .env.example present and complete
  • ✅ Architecture diagram explains the audio pipeline clearly

Change summary

Minimal, correct fix: pins deepgram-sdk>=4.0.0deepgram-sdk==6.1.1 in requirements.txt. The source code already used the v6 API surface (listen.v1.connect, EventType, ListenV1Results, send_media, send_close_stream), so no code changes were needed.


✓ All checks pass. Ready for merge.


Review by Lead on 2026-04-04

@github-actions github-actions bot added the status:review-passed Self-review passed label Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 4, 2026

Code Review

Overall: APPROVED

Tests ran ✅

tests/test_example.py::test_django_imports PASSED                        [ 20%]
tests/test_example.py::test_consumer_imports PASSED                      [ 40%]
tests/test_example.py::test_consumer_source_uses_deepgram PASSED         [ 60%]
tests/test_example.py::test_consumer_audio_forwarding PASSED             [ 80%]
tests/test_example.py::test_template_exists PASSED                       [100%]

5 passed in 0.71s

Integration genuineness

Pass — consumer.py imports AsyncDeepgramClient from the official SDK, opens a real live STT WebSocket via listen.v1.connect() with model nova-3, forwards audio via send_media(), and handles transcription results through EventType.MESSAGE callbacks. .env.example lists DEEPGRAM_API_KEY. Tests exit code 2 on missing credentials.

Code quality

  • Official Deepgram SDK used (deepgram-sdk==6.1.1) — correctly pinned to the required version ✅
  • tag="deepgram-examples" present on the Deepgram connection ✅
  • No hardcoded credentials — DEEPGRAM_API_KEY read from os.environ
  • Error handling: on_error callback sends error JSON to browser, disconnect() cleans up with try/except ✅
  • Tests import TranscriptionConsumer from src/ and verify structure, config, and source patterns ✅
  • No word-list transcript assertions — tests are structural, appropriate for a WebSocket consumer ✅
  • Credential check runs first in test_example.py before any imports ✅

Documentation

  • README covers what you'll build, env vars with console link, install/run instructions, architecture diagram ✅
  • .env.example present and complete ✅

✓ All checks pass. Ready for merge.

The PR correctly pins deepgram-sdk from >=4.0.0 to ==6.1.1 — the only change is in requirements.txt. All existing tests pass with the pinned version.


Review by Lead on 2026-04-04

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 4, 2026

Code Review

Overall: APPROVED

Tests ran ✅

tests/test_example.py::test_django_imports PASSED                        [ 20%]
tests/test_example.py::test_consumer_imports PASSED                      [ 40%]
tests/test_example.py::test_consumer_source_uses_deepgram PASSED         [ 60%]
tests/test_example.py::test_consumer_audio_forwarding PASSED             [ 80%]
tests/test_example.py::test_template_exists PASSED                       [100%]

5 passed in 0.63s

Integration genuineness

Pass — Django Channels AsyncWebsocketConsumer handles browser WebSocket connections; audio is forwarded to Deepgram via the official SDK (AsyncDeepgramClient.listen.v1.connect()). No bypass or raw protocol usage.

Code quality

  • ✅ Official Deepgram SDK used (deepgram-sdk==6.1.1 — correct pinned version)
  • tag="deepgram-examples" present on the Deepgram connection
  • ✅ No hardcoded credentials — DEEPGRAM_API_KEY read from environment
  • ✅ Error handling covers connection errors and disconnect cleanup
  • ✅ Tests import from src/ and verify actual consumer structure
  • ✅ Credential check runs first (exits code 2 before SDK imports)
  • ✅ No word-list assertions — tests verify source structure, not transcript content

Documentation

  • ✅ README includes what-you'll-build, env vars with links, run instructions, architecture diagram
  • .env.example present and complete

Change reviewed

The only change is pinning deepgram-sdk>=4.0.0deepgram-sdk==6.1.1 in requirements.txt. The source code already uses the v6 API surface (listen.v1.connect, EventType, ListenV1Results, send_media, send_close_stream) so no code changes were needed.


✓ All checks pass. Ready for merge.


Review by Lead on 2026-04-04

@lukeocodes lukeocodes merged commit 6377b7b into main Apr 4, 2026
@lukeocodes lukeocodes deleted the fix/220-django-channels-live-stt-python-regression-2026-04-04 branch April 4, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:review-passed Self-review passed type:fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant