Skip to content

feat(regen): add Listen V1 ConfigureSuccess and ConfigureFailure replies - #803

Merged
GregHolmes merged 11 commits into
mainfrom
gh/sdk-gen-2026-10-14
Oct 19, 2026
Merged

GregHolmes merged 11 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

github-actions Bot commented Oct 14, 2026 •

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% (6556 / 6873) 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.

@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 from my first review is still open, and production has changed since.

What this PR does: regenerates the Python SDK and re-applies every manual patch. The only change a developer sees is the docstring on keyterms in Listen V1 Configure, the message that swaps keyterms during a live stream.

[B1] The docstring says the server doesn't reliably report too-long keyterm lists. Production now reports every one. On a prod stream today, an update with 250 keyterms got ConfigureFailure / CONFIGURE_KEYTERM_LIMIT_EXCEEDED in 0.08 s, the stream kept transcribing, and a valid update got ConfigureSuccess (request ID 01a1461e-dc44-7d20-bff9-12531ba32c86). The df141bc wording also has no source: deepgram-docs#1287 was closed unmerged, and docs main still says the stream closes with 1011, so a regen from main today brings that back. Fix: once deepgram-docs#1284 merges, regenerate from it.

Should-fix, same PR if possible: ConfigureSuccess and ConfigureFailure aren't in the response union in listen/v1/socket_client.py:26-28, so both reach callers as None (also true in 7.13.0, and the file is frozen, so a regen won't add them). reference.md:4989 still describes InvalidConfigureMessage errors and a stalled stream.

What I checked:

  • Did the patches survive? Yes. 50 patch markers present, no .bak files, the one new freeze is documented. pytest 1,022 passed (non-wire), mypy and ruff clean.
  • Does it break existing code? No. No public names removed; the lock changes are dev-only.
  • Does it conflict with #789 (send_raw)? No. It merges cleanly in either order and keeps send_raw.

@GregHolmes

GregHolmes commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed in 4b694a6.

  • Added ListenV1ConfigureSuccess and ListenV1ConfigureFailure models, Params types, exports, and the Listen V1 socket response union so both acknowledgement frames reach callers as typed values.
  • Updated the Configure and Error guidance plus reference.md for the current production contract.
  • Added sync and async socket parsing coverage for both response variants.
  • Temporarily froze the generated bridge until the next regeneration consumes merged deepgram-docs#1284.

Validation: poetry run pytest (1,077 passed, 4 skipped), poetry run mypy src tests/typecheck, Ruff on the affected Python files, and git diff --check.

@GregHolmes

Copy link
Copy Markdown
Contributor Author

Addressed the follow-up review findings in 66c64b8 and 2febf66.

  • The live reconfiguration example and both reference snippets now import, type, and handle ConfigureSuccess and ConfigureFailure.
  • The reference starts the sync and async receive loops concurrently, then waits for the Configure acknowledgement before proceeding.
  • Sync and async start_listening event dispatch now have regression coverage.

Final independent DevRel re-review: approve. Validation: poetry run pytest (1,079 passed, 4 skipped), mypy, Ruff, poetry check --lock, and git diff --check.

@dg-coreylweathers dg-coreylweathers changed the title chore(regen): clarify Listen V1 keyterm limits feat(regen): add Listen V1 ConfigureSuccess and ConfigureFailure replies Oct 19, 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.

Approving.

What this PR does: regenerates the SDK and adds typed ListenV1ConfigureSuccess / ListenV1ConfigureFailure replies for Listen V1 send_configure, which 7.13.0 delivers as None. The models are hand-applied from deepgram-docs#1284 and frozen until a regen consumes it.

What I checked:

  • Are my earlier findings fixed? Yes. Live nova-3 stream (request 01a15418-d04a-7b32-9483-c3cc951d31bf): a valid update came back as ListenV1ConfigureSuccess, a 250-keyterm update as ListenV1ConfigureFailure / CONFIGURE_KEYTERM_LIMIT_EXCEEDED, and transcripts kept arriving. The docstrings and reference.md describe exactly that.
  • Do the hand-written models match #1284? Yes: same fields, required set and type values. The open #1284 feedback keeps ListenV1Error.code, which this PR also keeps.
  • Can a new type swallow an existing message? No. Every Listen V1 frame type parsed to its own class; the new tests fail when the union entries are removed.
  • Will the release notes carry it? Yes. The title is now feat(regen): …, so the squash commit cuts 7.14.0 with a changelog line.
  • CI green on 3.10–3.13; mypy and ruff clean.

Fixed in 1826f25: the async reference.md snippet now catches asyncio.TimeoutError so its timeout message fires; ListenV1ConfigureFailure.code lists the four rejection codes; the AGENTS.md entry for listen/__init__.py records the new exports so the next regen re-applies them.

Merge note: whichever of this PR and #789 merges second should add send_raw to the AGENTS.md patch line for agent/v1/socket_client.py.

@GregHolmes
GregHolmes force-pushed the gh/sdk-gen-2026-10-14 branch from 1826f25 to da38cbb Compare October 19, 2026 12:39
@GregHolmes
GregHolmes merged commit a5638e1 into main Oct 19, 2026
10 checks passed
@GregHolmes
GregHolmes deleted the gh/sdk-gen-2026-10-14 branch October 19, 2026 12:46
GregHolmes added a commit that referenced this pull request Oct 20, 2026
🤖 I have created a release *beep* *boop*
---

##
[7.14.0](v7.13.0...v7.14.0)
(2026-10-20)

### Features

* **Voice Agent:** Send protocol-transparent control frames with sync or
async `connection.send_raw(...)`. Dictionary payloads are serialized
without model validation; pre-serialized JSON strings are sent
unchanged.
* **Listen V1:** Receive typed `ListenV1ConfigureSuccess` and
`ListenV1ConfigureFailure` responses after
`connection.send_configure(ListenV1Configure(...))`, including failure
codes for unsupported or over-limit keyterms.

### Bug Fixes

* **Voice Agent:** Clarify ForceEndTurn availability for hosted and
self-hosted deployments. The example now reports
`FORCE_END_TURN_UNSUPPORTED` and waits for the final outcome before
closing the connection.

## Validation

- Source PR CI passed across Python 3.10 through 3.13.
- #803: `poetry run pytest` passed with 1,075 tests and 4 skips; mypy
and Ruff passed.
- #789: targeted socket-client tests, mypy, and Ruff passed.
- #788: ForceEndTurn regression coverage passed.

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Greg Holmes <greg.holmes@deepgram.com>
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