Skip to content

refactor(sagemaker): move SageMaker transport to separate package#662

Merged
lukeocodes merged 3 commits intomainfrom
lo/extract-sagemaker-transport
Feb 17, 2026
Merged

refactor(sagemaker): move SageMaker transport to separate package#662
lukeocodes merged 3 commits intomainfrom
lo/extract-sagemaker-transport

Conversation

@lukeocodes
Copy link
Contributor

@lukeocodes lukeocodes commented Feb 17, 2026

Summary

  • Move the SageMaker transport out of the SDK into a standalone deepgram-sagemaker package, since its AWS dependencies require Python >=3.12 but the SDK supports >=3.8
  • Consolidate the README's "Custom WebSocket Transport" and "SageMaker Transport" sections into a single "Custom Transports" section that explains the concept, shows how to build one (sync + async), and uses deepgram-sagemaker as the real-world example
  • Remove unused imports (JSONDecodeError, websockets) from socket client files flagged by ruff F401

Changes

File Change
src/deepgram/transports/sagemaker.py Deleted — moved to deepgram-sagemaker package
src/deepgram/transports/__init__.py Cleared SageMaker exports
pyproject.toml Removed mypy overrides for AWS SDK modules
README.md Consolidated custom transports section with deepgram-sagemaker example
examples/27-transcription-live-sagemaker.py Updated imports and install instructions
src/deepgram/*/socket_client.py (×4) Removed unused imports
.fernignore Updated comments

Test plan

  • ruff check src/ passes
  • mypy src/deepgram/transports/ passes
  • No remaining sagemaker/SageMaker references in src/deepgram/
  • New deepgram-sagemaker package structure verified in ../deepgram-python-sdk-transport-sagemaker/

🤖 Generated with Claude Code

…gemaker package

The SageMaker transport's AWS dependencies require Python >=3.12, but
the main SDK supports Python >=3.8. Extract it into a standalone
deepgram-sagemaker package so the SDK remains compatible with older
Python versions.

- Delete src/deepgram/transports/sagemaker.py
- Remove mypy overrides for AWS SDK modules from pyproject.toml
- Update README Custom Transports section with deepgram-sagemaker example
- Update example imports to use deepgram_sagemaker
- Remove unused imports (JSONDecodeError, websockets) from socket clients
- Update .fernignore comments to reflect changes
Copilot AI review requested due to automatic review settings February 17, 2026 17:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR decouples the SageMaker transport from the core SDK by removing the built-in implementation (and its AWS dependency surface) and pointing users to a standalone deepgram-sagemaker transport package, while also cleaning up a few unused imports and related config/docs.

Changes:

  • Remove the built-in SageMaker transport module and its exports from deepgram.transports.
  • Update README + SageMaker example to use deepgram-sagemaker as the supported transport approach.
  • Remove unused imports in several WebSocket socket clients and drop now-unneeded mypy AWS overrides.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/deepgram/transports/sagemaker.py Deleted built-in SageMaker transport implementation (moved to external package).
src/deepgram/transports/__init__.py Removes SageMaker exports and reframes package docs.
pyproject.toml Removes mypy ignore overrides for AWS-related modules.
README.md Consolidates custom transport docs and updates SageMaker guidance to deepgram-sagemaker.
examples/27-transcription-live-sagemaker.py Updates example install/imports to the external deepgram-sagemaker package.
src/deepgram/speak/v1/socket_client.py Removes unused imports flagged by ruff.
src/deepgram/listen/v2/socket_client.py Removes unused imports flagged by ruff.
src/deepgram/listen/v1/socket_client.py Removes unused imports flagged by ruff.
src/deepgram/agent/v1/socket_client.py Removes unused imports flagged by ruff.
.fernignore Updates comments to reflect refactor and import cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Update changelog and README to reflect that the SageMaker transport is
now a separate package (deepgram-sagemaker) available on PyPI, not
bundled in the SDK.
@lukeocodes lukeocodes merged commit 16d500e into main Feb 17, 2026
15 checks passed
@lukeocodes lukeocodes deleted the lo/extract-sagemaker-transport branch February 17, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant