Skip to content

refactor(sagemaker): extract SageMaker transport to separate package#663

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

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

Conversation

@lukeocodes
Copy link
Contributor

@lukeocodes lukeocodes commented Feb 18, 2026

Summary

  • Moves the SageMaker transport out of the SDK into the standalone deepgram-sagemaker package (v0.2.0 on PyPI)
  • Updates README, changelog, and example to reference the external package (pip install deepgram-sagemaker)
  • Removes the sagemaker extras group and AWS mypy overrides from pyproject.toml
  • Cleans up unused imports (JSONDecodeError, websockets) flagged by ruff in socket clients
  • Removes the changelog-log GitHub Actions workflow

Test plan

  • Verify pip install deepgram-sagemaker installs v0.2.0 from PyPI
  • Verify examples/27-transcription-live-sagemaker.py runs successfully with the external package
  • Verify no remaining in-tree references to deepgram.transports.sagemaker
  • Verify SDK builds cleanly without the removed AWS dependencies

🤖 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
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.
Copilot AI review requested due to automatic review settings February 18, 2026 09:19
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

Refactors the SDK to remove the in-tree AWS SageMaker transport and instead document/use the external deepgram-sagemaker package, while also cleaning up a few unused imports and CI config.

Changes:

  • Removed deepgram.transports.sagemaker and updated exports/docs/examples to use deepgram-sagemaker (deepgram_sagemaker import).
  • Dropped AWS-related mypy overrides and cleaned unused imports in websocket socket clients.
  • Removed the changelog-log GitHub Actions workflow and updated .fernignore comments accordingly.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/deepgram/transports/sagemaker.py Deletes the built-in SageMaker transport implementation.
src/deepgram/transports/init.py Updates package docstring and removes SageMaker exports.
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.
pyproject.toml Removes AWS-related mypy overrides.
examples/27-transcription-live-sagemaker.py Switches example to use deepgram_sagemaker.
README.md Updates custom transport docs + SageMaker section to reference external package.
CHANGELOG.md Updates SageMaker entry to reflect external package.
.github/workflows/changelog-log.yml Removes changelog webhook workflow.
.fernignore Updates comments describing ignored/generated files.
Comments suppressed due to low confidence (1)

README.md:406

  • The SageMaker transport example snippet references EventType but doesn’t import it. Add the EventType import so the snippet runs when copied.
```python
from deepgram import AsyncDeepgramClient
from deepgram_sagemaker import SageMakerTransportFactory

factory = SageMakerTransportFactory(
    endpoint_name="my-deepgram-endpoint",
    region="us-west-2",
)

# SageMaker uses AWS credentials (not Deepgram API keys)
client = AsyncDeepgramClient(api_key="unused", transport_factory=factory)

async with client.listen.v1.connect(model="nova-3") as connection:
    connection.on(EventType.MESSAGE, on_message)
    await connection.start_listening()

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

Comment on lines 372 to 379
@@ -373,15 +379,19 @@ async with client.listen.v1.connect(model="nova-3") as connection:
await connection.start_listening()
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

In the async transport example, EventType is referenced but not imported in the snippet. This makes the example fail if copied as-is; add the EventType import (and keep the snippet self-contained).

Copilot uses AI. Check for mistakes.
@lukeocodes lukeocodes requested a review from Copilot February 18, 2026 09:24
@lukeocodes lukeocodes merged commit d82b699 into main Feb 18, 2026
43 checks passed
@lukeocodes lukeocodes deleted the lo/extract-sagemaker-transport branch February 18, 2026 09:26
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

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.


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

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

Comments