Skip to content

chore(regen): clarify Listen V1 keyterm limits - #803

Open
GregHolmes wants to merge 7 commits into
mainfrom
gh/sdk-gen-2026-10-14
Open

GregHolmes wants to merge 7 commits into
mainfrom
gh/sdk-gen-2026-10-14

Conversation

@GregHolmes

@GregHolmes GregHolmes commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Regenerate the Python SDK from deepgram-docs main with fern-python-sdk 5.27.1.
  • Reapply all v7 compatibility, security, socket, query-encoding, and wire-test patches.
  • Retain Speak V2 Warning docstring whitespace cleanup until Fern emits clean output.
  • Keep committed release metadata at the published 7.13.0; Release Please owns the next version bump.
  • Preserve the generated dependency-resolution refresh in poetry.lock.

Compatibility

  • Preserve legacy Agent Settings, provider, Topics/Intents, and package import paths.
  • Preserve nullable and raw-dict WebSocket control compatibility.
  • Preserve Authorization-header redaction and lowercase boolean query encoding.
  • Preserve read-only dictionary access on typed Listen V2 responses during the 7.x transition.

Validation

  • poetry run pytest: 1,075 passed, 4 skipped
  • mypy src tests/typecheck
  • ruff check on changed files
  • git diff --check

Full ruff check has 57 pre-existing issues in examples and manual tests.

@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% (6550 / 6867) 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-14 chore(regen): clarify Listen V1 keyterm limits Oct 14, 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.

Requesting changes. One item, and the fix belongs upstream in deepgram-docs.

What this PR does: regenerates the Python SDK from deepgram-docs 59a99c27 and re-applies every manual patch. The one developer-visible change is the keyterms docstring on Listen V1 Configure. It now says an over-limit update stops transcription and closes the stream with 1011 (NET-0000) after about 30 s.

[B1] Production doesn't behave that way today. Two live prod streams with 250 keyterms (~11k chars) sent in a Configure got no Error and no other message. Transcription continued at the control stream's rate, and the stream closed normally with 1000 after 50 s (request IDs 01a13abe-0469-79e1-89f7-ab3381fee484, 01a13abf-37bd-7f50-8ed2-07356c595123). The same list sent as keyterm= query params returns 400, so it is over the limit. Staging replies with ConfigureFailure / CONFIGURE_KEYTERM_LIMIT_EXCEEDED. The 7.13.0 text ("returns an Error") is also wrong for prod.

Fix in api/specs/asyncapi/schemas/schemas.listen.v1.yml (the keyterms description and the message-level "see keyterms" line), then regen:

Each entry is a plain term or phrase with no weights or intensifiers. The 500-token keyterm limit that
applies to the `keyterm` query parameter also applies to each update. Keep each list under the limit:
the server does not yet report over-limit updates consistently, so don't rely on an `Error` to catch one.

Heads-up for API-173: ConfigureFailure and ConfigureSuccess (both sent on staging) aren't in the Listen V1 response union, so the Python client parses them as None. Add both messages to the spec before API-173 reaches prod.

What I checked:

  • Does it break existing code? No. Runtime __all__ is identical across 10 packages (root 453 names), all resolvable, and no signature changes.
  • Did the patches survive? Yes. pytest with WireMock in Docker: 1,075 passed, 4 skipped. mypy src + tests/typecheck and ruff check are clean.
  • New pydantic_utilities.py freeze: documented in AGENTS.md, matches pydantic 2.14.1 in the lock. The lock refresh is dev-only (pyproject unchanged).

@GregHolmes

Copy link
Copy Markdown
Contributor Author

Addressed in df141bc.

  • Opened the source-of-truth correction in deepgram-docs#1287. It updates both the Listen V1 Configure message description and keyterms field description to say that over-limit updates are not reported consistently and developers must not rely on an Error.
  • Refreshed the generated Python model and Params docstrings to exactly match that source text. The branch will naturally receive the same output from the next regeneration after deepgram-docs#1287 merges.
  • Verified with poetry run pytest tests/custom/test_listen_v1_configure.py (5 passed) and focused Ruff (clean).

The API-173 response-union follow-up is already covered by deepgram-docs#1284, which adds ConfigureSuccess and ConfigureFailure to the AsyncAPI contract before its stated deployment gate.

@GregHolmes

Copy link
Copy Markdown
Contributor Author

@dg-coreylweathers Requesting re-review. The keyterm-limit correction is now in df141bc and is backed by source-of-truth deepgram-docs#1287. The generated model and Params docstrings match that source exactly.\n\nFocused validation passed: poetry run pytest tests/custom/test_listen_v1_configure.py (5 passed) and focused Ruff. The API-173 response-union follow-up remains correctly tracked by deepgram-docs#1284.

This branch has not been deployed

No deployments
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