Skip to content

feat(regen): add deepgram think provider types - #823

Merged
GregHolmes merged 9 commits into
mainfrom
gh/sdk-gen-2026-10-30
Nov 2, 2026
Merged

GregHolmes merged 9 commits into
mainfrom
gh/sdk-gen-2026-10-30

Conversation

@GregHolmes

@GregHolmes GregHolmes commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Regenerate the Python SDK with Fern 5.27.1.
  • Add generated Deepgram Think provider model, params, model union, and reasoning-mode union exports.
  • Reapply required compatibility, transport, security, query encoding, and wire-test patches.
  • Drop the now-generator-covered Think provider overrides and retain no shim for the unpublished DeepgramReasoningMode name.
  • Add direct Think provider serialization and typecheck coverage; the existing Voice Agent example remains the canonical developer path.

Validation

  • poetry run pytest -rP --cov=deepgram --cov-branch --cov-report=xml --cov-report=term-missing . - 1138 passed, 4 skipped
  • poetry run mypy src/
  • poetry run mypy tests/typecheck
  • poetry run ruff check src/
  • poetry run ruff check tests/custom/test_agent_think_live.py tests/typecheck/compat_aliases.py

poetry run ruff check . still reports existing formatting/import issues in examples and manual tests outside this regeneration.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
src.deepgram 97% 94% 0 ✔
src.deepgram.agent 100% 100% 0 ✔
src.deepgram.agent.v1 98% 100% 0 ✔
src.deepgram.agent.v1.settings 100% 100% 0 ✔
src.deepgram.agent.v1.settings.think 100% 100% 0 ✔
src.deepgram.agent.v1.settings.think.models 97% 100% 0 ✔
src.deepgram.auth 100% 100% 0 ✔
src.deepgram.auth.v1 100% 100% 0 ✔
src.deepgram.auth.v1.tokens 97% 100% 0 ✔
src.deepgram.core 88% 81% 0 ➖
src.deepgram.errors 100% 100% 0 ✔
src.deepgram.helpers 98% 92% 0 ✔
src.deepgram.listen 100% 100% 0 ✔
src.deepgram.listen.v1 98% 93% 0 ✔
src.deepgram.listen.v1.media 97% 100% 0 ✔
src.deepgram.listen.v2 98% 93% 0 ✔
src.deepgram.manage 100% 100% 0 ✔
src.deepgram.manage.v1 100% 100% 0 ✔
src.deepgram.manage.v1.models 96% 100% 0 ✔
src.deepgram.manage.v1.projects 97% 100% 0 ✔
src.deepgram.manage.v1.projects.billing 100% 100% 0 ✔
src.deepgram.manage.v1.projects.billing.balances 96% 100% 0 ✔
src.deepgram.manage.v1.projects.billing.breakdown 97% 100% 0 ✔
src.deepgram.manage.v1.projects.billing.fields 97% 100% 0 ✔
src.deepgram.manage.v1.projects.billing.purchases 97% 100% 0 ✔
src.deepgram.manage.v1.projects.keys 96% 100% 0 ✔
src.deepgram.manage.v1.projects.members 97% 100% 0 ✔
src.deepgram.manage.v1.projects.members.invites 96% 100% 0 ✔
src.deepgram.manage.v1.projects.members.scopes 96% 100% 0 ✔
src.deepgram.manage.v1.projects.models 96% 100% 0 ✔
src.deepgram.manage.v1.projects.usage 98% 100% 0 ✔
src.deepgram.manage.v1.projects.usage.breakdown 97% 100% 0 ✔
src.deepgram.manage.v1.projects.usage.fields 97% 100% 0 ✔
src.deepgram.read 100% 100% 0 ✔
src.deepgram.read.v1 100% 100% 0 ✔
src.deepgram.read.v1.text 98% 100% 0 ✔
src.deepgram.self_hosted 100% 100% 0 ✔
src.deepgram.self_hosted.v1 100% 100% 0 ✔
src.deepgram.self_hosted.v1.distribution_credentials 96% 100% 0 ✔
src.deepgram.speak 100% 100% 0 ✔
src.deepgram.speak.v1 98% 97% 0 ✔
src.deepgram.speak.v1.audio 91% 80% 0 ✔
src.deepgram.speak.v2 98% 93% 0 ✔
src.deepgram.speak.v2.audio 100% 100% 0 ✔
src.deepgram.voice_agent 100% 100% 0 ✔
src.deepgram.voice_agent.configurations 95% 100% 0 ✔
src.deepgram.voice_agent.variables 95% 100% 0 ✔
Summary 95% (6572 / 6889) 91% (1438 / 1574) 0 ✔

Scope: hand-maintained SDK logic. Fern-generated data models (types/, requests/), package __init__.py files, version.py, and the unused core/http_sse/ scaffolding are excluded — see .coveragerc. Unscoped whole-package coverage is ~70%.

@GregHolmes GregHolmes changed the title chore: SDK regeneration 2026-10-30 chore: sdk regeneration 2026-10-30 Oct 30, 2026
@GregHolmes GregHolmes changed the title chore: sdk regeneration 2026-10-30 feat(regen): add deepgram think provider types Oct 30, 2026

@dg-coreylweathers dg-coreylweathers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @GregHolmes. This is the regen we wanted. One small fix and I'll approve.

Merge order: this needs to land before release PR #822. DeepgramReasoningMode never shipped (7.16.0 on PyPI doesn't have it), but #822 would ship it in 7.17.0 if it merges first, and then this PR becomes a breaking rename.

What I checked (Docker):

  • Freeze lines are gone, both think_settings_v1provider.py files are generator-owned, every other .fernignore patch is intact, and import deepgram works. DeepgramReasoningMode is gone everywhere.
  • 1138 passed / 4 skipped, mypy src + typecheck clean, ruff clean on changed files.
  • Python 3.10-3.14 x pydantic 2.14 and 1.10: think deepgram parses to the think variant and speak deepgram to speak, under both. Wheel is clean.
  • Live prod: think-fast and phonellm-mini-alpha-2-fp8 get SettingsApplied, all five reasoning modes apply on phonellm, and think-fast + mip_opt_out: true gets INVALID_SETTINGS as documented.

Should-fix:

  • tests/custom/test_agent_think_live.py:242, test_direct_deepgram_think_provider_serializes fails on pydantic 1.10. Under v1, .json() (exclude_unset=True) drops the defaulted type: "deepgram". CI only runs v2, so it's green. The SDK itself is fine, since the sockets send .dict(). Assert on provider.dict() instead.

Nits:

  • Standalone DeepgramThinkProvider can't be passed to ThinkSettingsV1(provider=...) (ValidationError). Callers want ThinkSettingsV1Provider_Deepgram. A docstring line pointing there would save someone a confused afternoon.
  • Separate from this PR: AgentV1Settings(mip_opt_out=None) sends "mip_opt_out": null, and prod answers UNPARSABLE_CLIENT_MESSAGE.

Under pydantic v1, .json() in UniversalBaseModel uses exclude_unset=True, so the
defaulted `type: "deepgram"` is dropped and the old assertion failed. Both agent
sockets send data.dict(), which keeps `type`, so assert on dict() to match the
real payload on v1 and v2.
@dg-coreylweathers

Copy link
Copy Markdown
Contributor

Hey Greg, I pushed a small test fix to this branch.

test_direct_deepgram_think_provider_serializes now asserts on provider.dict() instead of json.loads(provider.json()), since dict() is what both agent sockets actually send. Every field is still checked, including type: "deepgram".

  • pydantic 1.10: .json() uses exclude_unset, so it dropped the defaulted type and the old assertion failed. The new one passes.
  • pydantic 2 (locked): full suite is green, same as before.

No library changes, the SDK was never affected.

@dg-coreylweathers dg-coreylweathers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving with the test fix in (85b2387). Everything else from my earlier review holds: the freeze lines are gone, import deepgram works, the suite is green on pydantic 2 and the think tests pass on 1.10, and the live prod checks all behave as documented.

Merge order: please land this before release PR #822. DeepgramReasoningMode never shipped, but #822 would ship it in 7.17.0 if it merges first.

@GregHolmes
GregHolmes merged commit 3280a4a into main Nov 2, 2026
10 checks passed
@GregHolmes
GregHolmes deleted the gh/sdk-gen-2026-10-30 branch November 2, 2026 11:31
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.

2 participants