Skip to content

[Bug]: AwsBedrockThinkProviderModel type hint lists two model IDs unavailable in the default region, then falls back to Any #761

Description

@dg-edcharbeneau

Summary

The only two model IDs the SDK suggests for the aws_bedrock think provider are Claude 3.5 IDs unavailable in us-east-2, and the Union with Any means autocomplete offers them while accepting anything.

What happened?

Actual: deepgram/types/aws_bedrock_think_provider_model.py in 7.6.0 reads:

# This file was auto-generated by Fern from our API Definition.

import typing

AwsBedrockThinkProviderModel = typing.Union[
    typing.Literal["anthropic/claude-3-5-sonnet-20240620-v1:0", "anthropic/claude-3-5-haiku-20240307-v1:0"], typing.Any
]

Two problems:

  1. Neither listed ID is available in us-east-2, the region used throughout the Bedrock docs and examples. The only two IDs the SDK suggests are ones that fail in the default region — so the single discoverable starting point for this provider is a dead end.

  2. Union[Literal[...], Any] collapses to Any for type-checking purposes. The literals are pure autocomplete decoration: they neither constrain input nor flag a wrong value. A user gets suggestions that don't work, and no protection when they type something that also doesn't work.

Expected:

  • The suggested IDs should be ones that actually resolve in the documented default region, or the literals should be dropped in favour of a plain str so nothing misleading is suggested.
  • If the intent is BYO (any model string), say so — str with a docstring pointing at the Bedrock model catalog is more honest than two broken literals.

This is a generated file. Per CONTRIBUTING.md"this is a generated library, and changes to core files should be promoted to our generator code" — the fix likely belongs in the API definition the Fern generator reads, not in the checked-in file.

Steps to reproduce

  1. pip install deepgram-sdk==7.6.0
  2. Open an editor with a type checker (Pylance / pyright / mypy).
  3. Type a ThinkSettingsV1Provider_AwsBedrock(...) call and inspect the completions offered for model.
  4. Observe the two anthropic/claude-3-5-* IDs are the only suggestions.
  5. Use either against bedrock-runtime in us-east-2 → the model is not available in that region.
  6. Note that passing any other string, including a nonexistent one, type-checks clean because of the Any arm.

Minimal code sample

# Inspect the generated type directly — no network needed.
from deepgram.types.aws_bedrock_think_provider_model import AwsBedrockThinkProviderModel
print(AwsBedrockThinkProviderModel)
# typing.Union[typing.Literal['anthropic/claude-3-5-sonnet-20240620-v1:0',
#                             'anthropic/claude-3-5-haiku-20240307-v1:0'], typing.Any]

from deepgram.types.think_settings_v1provider import ThinkSettingsV1Provider_AwsBedrock

# Both of these type-check identically clean — the Literal arm constrains nothing:
ThinkSettingsV1Provider_AwsBedrock(model="anthropic/claude-3-5-sonnet-20240620-v1:0")  # suggested, unavailable in us-east-2
ThinkSettingsV1Provider_AwsBedrock(model="not-a-real-model-at-all")                    # accepted, no warning

Logs / traceback

No traceback — this is a static typing / developer-experience defect.
The generated definition is quoted in full above.

Environment

Field Value
Transport WebSocket
API endpoint / path /v1/agent/converse
Model(s) used anthropic/claude-3-5-sonnet-20240620-v1:0, anthropic/claude-3-5-haiku-20240307-v1:0 (the two suggested)
How often? Always
Is this a regression? Not known
SDK version 7.6.0
Python version 3.13.14
Install method pip
OS macOS (Apple Silicon)

Verified against a clean deepgram-sdk 7.6.0 install (current on PyPI at time of filing) under Python 3.13.14. The quoted file contents are verbatim from the installed package.


Related: #759 — the Any fallback described here is what leaves a user free to select a Bedrock reasoning model that then fails silently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions