From 0bf03676f9f3bd1cc08511d228663d28cf45afd3 Mon Sep 17 00:00:00 2001 From: Luke Oliff Date: Sun, 15 Feb 2026 21:52:19 +0000 Subject: [PATCH 1/2] feat(sagemaker): add optional extras group for SageMaker dependencies Users can now install SageMaker transport dependencies with `pip install deepgram-sdk[sagemaker]` instead of manually installing aws-sdk-sagemaker-runtime-http2 and boto3. --- README.md | 4 ++-- examples/27-transcription-live-sagemaker.py | 2 +- pyproject.toml | 5 +++++ src/deepgram/transports/sagemaker.py | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ced85991..7004458d 100644 --- a/README.md +++ b/README.md @@ -398,9 +398,9 @@ async with client.listen.v1.connect(model="nova-3") as connection: > **Note:** The SageMaker transport is async-only and requires `AsyncDeepgramClient`. -Requirements: +Install the optional SageMaker dependencies: ```bash -pip install aws-sdk-sagemaker-runtime-http2 boto3 +pip install deepgram-sdk[sagemaker] ``` See [`examples/27-transcription-live-sagemaker.py`](./examples/27-transcription-live-sagemaker.py) for a complete working example. diff --git a/examples/27-transcription-live-sagemaker.py b/examples/27-transcription-live-sagemaker.py index f307217b..ae734628 100644 --- a/examples/27-transcription-live-sagemaker.py +++ b/examples/27-transcription-live-sagemaker.py @@ -13,7 +13,7 @@ Requirements:: - pip install aws-sdk-sagemaker-runtime-http2 boto3 + pip install deepgram-sdk[sagemaker] Environment: AWS credentials must be configured (via environment variables, diff --git a/pyproject.toml b/pyproject.toml index de0e0afb..e341637c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,11 @@ pydantic = ">= 1.9.2" pydantic-core = ">=2.18.2" typing_extensions = ">= 4.0.0" websockets = ">=12.0" +aws-sdk-sagemaker-runtime-http2 = { version = ">=1.0.0", optional = true } +boto3 = { version = ">=1.20.0", optional = true } + +[tool.poetry.extras] +sagemaker = ["aws-sdk-sagemaker-runtime-http2", "boto3"] [tool.poetry.group.dev.dependencies] mypy = "==1.13.0" diff --git a/src/deepgram/transports/sagemaker.py b/src/deepgram/transports/sagemaker.py index 1f511a8f..ef7bab83 100644 --- a/src/deepgram/transports/sagemaker.py +++ b/src/deepgram/transports/sagemaker.py @@ -11,7 +11,7 @@ Requirements:: - pip install aws-sdk-sagemaker-runtime-http2 boto3 + pip install deepgram-sdk[sagemaker] Usage:: @@ -75,7 +75,7 @@ def _import_sagemaker_deps() -> tuple: except ImportError: raise ImportError( "SageMaker transport requires additional dependencies. " - "Install them with: pip install aws-sdk-sagemaker-runtime-http2 boto3" + "Install them with: pip install deepgram-sdk[sagemaker]" ) from None return ( From 0fd4a7c41524d03981eb8c303b3a07410899fed7 Mon Sep 17 00:00:00 2001 From: Luke Oliff Date: Sun, 15 Feb 2026 21:58:31 +0000 Subject: [PATCH 2/2] docs(sagemaker): add install instructions for SageMaker dependencies Add explicit pip install instructions for aws-sdk-sagemaker-runtime-http2 and boto3 in the README, example, and transport docstrings. Note the Python 3.12+ requirement. These are kept as separate pip installs rather than Poetry extras due to resolver compatibility issues. --- README.md | 4 ++-- examples/27-transcription-live-sagemaker.py | 2 +- pyproject.toml | 5 ----- src/deepgram/transports/sagemaker.py | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7004458d..b5319599 100644 --- a/README.md +++ b/README.md @@ -398,9 +398,9 @@ async with client.listen.v1.connect(model="nova-3") as connection: > **Note:** The SageMaker transport is async-only and requires `AsyncDeepgramClient`. -Install the optional SageMaker dependencies: +Install the SageMaker transport dependencies (requires Python 3.12+): ```bash -pip install deepgram-sdk[sagemaker] +pip install aws-sdk-sagemaker-runtime-http2 boto3 ``` See [`examples/27-transcription-live-sagemaker.py`](./examples/27-transcription-live-sagemaker.py) for a complete working example. diff --git a/examples/27-transcription-live-sagemaker.py b/examples/27-transcription-live-sagemaker.py index ae734628..f307217b 100644 --- a/examples/27-transcription-live-sagemaker.py +++ b/examples/27-transcription-live-sagemaker.py @@ -13,7 +13,7 @@ Requirements:: - pip install deepgram-sdk[sagemaker] + pip install aws-sdk-sagemaker-runtime-http2 boto3 Environment: AWS credentials must be configured (via environment variables, diff --git a/pyproject.toml b/pyproject.toml index e341637c..de0e0afb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,11 +45,6 @@ pydantic = ">= 1.9.2" pydantic-core = ">=2.18.2" typing_extensions = ">= 4.0.0" websockets = ">=12.0" -aws-sdk-sagemaker-runtime-http2 = { version = ">=1.0.0", optional = true } -boto3 = { version = ">=1.20.0", optional = true } - -[tool.poetry.extras] -sagemaker = ["aws-sdk-sagemaker-runtime-http2", "boto3"] [tool.poetry.group.dev.dependencies] mypy = "==1.13.0" diff --git a/src/deepgram/transports/sagemaker.py b/src/deepgram/transports/sagemaker.py index ef7bab83..1f511a8f 100644 --- a/src/deepgram/transports/sagemaker.py +++ b/src/deepgram/transports/sagemaker.py @@ -11,7 +11,7 @@ Requirements:: - pip install deepgram-sdk[sagemaker] + pip install aws-sdk-sagemaker-runtime-http2 boto3 Usage:: @@ -75,7 +75,7 @@ def _import_sagemaker_deps() -> tuple: except ImportError: raise ImportError( "SageMaker transport requires additional dependencies. " - "Install them with: pip install deepgram-sdk[sagemaker]" + "Install them with: pip install aws-sdk-sagemaker-runtime-http2 boto3" ) from None return (