Skip to content

feat(regen): agent force-end-turn and Flux expressivity controls - #783

Open
GregHolmes wants to merge 11 commits into
mainfrom
gh/sdk-gen-2026-09-03
Open

feat(regen): agent force-end-turn and Flux expressivity controls#783
GregHolmes wants to merge 11 commits into
mainfrom
gh/sdk-gen-2026-09-03

Conversation

@GregHolmes

@GregHolmes GregHolmes commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • regenerate the Python SDK from the latest API definition with fern-python-sdk 5.27.1
  • add Agent ForceEndTurn request/response types and no-payload send_force_end_turn() helpers
  • add Agent TTS expressivity and update the generated Flux speed documentation to 0.5-1.5
  • clarify that Nova-3 does not support keywords and recommends keyterm
  • reapply all required compatibility, credential-redaction, WebSocket query-encoding, and regression-test patches
  • preserve new generated exports while restoring legacy alias exports
  • remove the SpeakV2Speed patch and freeze entry because Fern now correctly generates float
  • align the frozen reference with Agent ForceEndTurn, Agent expressivity, Nova-3 keyword guidance, and the Flux speed range
  • add sync/async regression coverage for Agent ForceEndTurn, Agent expressivity settings, Listen V2 EOT controls, and Speak V2 REST speed/expressivity serialization
  • add a Voice Agent ForceEndTurn example that uses the required Flux listen provider
  • require DEEPGRAM_CALLBACK_URL in the prerecorded callback example instead of sending to an invalid placeholder URL

Unsupported voice removal

  • Removed invalid aura-2-perseo-it from src/deepgram/types/speak_v1model.py.
  • Removed invalid aura-2-perseo-it from src/deepgram/speak/v1/audio/types/audio_generate_request_model.py.

Compatibility

  • existing Agent Settings, singular language_hint, Agent UpdateListen, Listen V2 subscript access, no-payload control sends, and custom transport behavior remain supported
  • restored wire coverage retains query serialization checks for Manage requests and Listen V1 media
  • generated Speak V1 model literals no longer list aura-2-perseo-it; this removal is intentional because it is not a valid Aura-2 Italian voice

Validation

  • poetry run mypy src/ tests/typecheck/compat_aliases.py: 904 source files passed
  • unit suite: 967 passed, 1 skipped
  • non-management WireMock integration suite: 21 passed
  • focused new-control suite: 72 passed
  • 24 non-management examples completed against the configured API key, including Listen V1/V2, ForceEndTurn, reconnection, Speak V1/V2, Voice Agent, Read, request options, error handling, and microphone capture with controlled SIGINT shutdown
  • callback example 12 now validates its missing DEEPGRAM_CALLBACK_URL prerequisite locally and exits 2 without sending a request
  • ruff check on changed tests and examples, and git diff --check

Live control verification

  • Listen V2 with eot_threshold=1.0 and eot_timeout_ms=60000 accepted ForceEndTurn and returned trigger=manual.
  • Speak V2 REST accepted speed 0.5 and 1.5; speed 1.03 returned HTTP 400 with an increment error.
  • Agent settings accepted Flux expressivity=2.
  • Agent ForceEndTurn with a V1/Nova listen provider returned FORCE_END_TURN_UNSUPPORTED; with a V2/Flux listen provider it proceeded through a user transcript, assistant response, and AgentAudioDone without a warning or disconnect.

Not end-to-end verified

  • callback delivery in example 12, which requires an externally reachable DEEPGRAM_CALLBACK_URL
  • SageMaker example 27, which requires the optional deepgram_sagemaker package, AWS credentials, and a deployed compatible endpoint
  • management/state-changing examples 50 through 56 and 60, per review scope

Generation metadata

originGitCommitIsDirty is expected: Fern ran after an uncommitted fern/generators.yml change that switched only the Python output mode and target branch to this regeneration branch. No API specification or Python code-generation setting was uncommitted, so the generated SDK contract is unchanged by that marker.

@github-actions

github-actions Bot commented Sep 3, 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 100% 95% 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% (6503 / 6818) 91% (1419 / 1552) 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-09-03 chore: sdk regeneration 2026-09-03 Sep 4, 2026
@GregHolmes GregHolmes changed the title chore: sdk regeneration 2026-09-03 feat(regen): agent force-end-turn and Flux expressivity controls Sep 4, 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.

DevRel review — changes requested, for three items before sign-off; the code, patches, and tests are sound.

What this PR does
Regenerates the Python SDK from the 2026-09-03 spec with fern-python-sdk 5.27.1. Voice Agent developers get agent.send_force_end_turn() to cut a user's turn short (Flux/V2 listen provider only; a V1 provider gets a FORCE_END_TURN_UNSUPPORTED warning), the Deepgram speak provider gains an expressivity setting (whole numbers -2 to 2, Flux voices, beta), the Flux TTS speed docs now say 0.5-1.5 instead of 0.85-1.15, keywords docstrings say Nova-3 does not support it and point at keyterm, and the aura-2-perseo-it voice name leaves the Speak V1 model literals. All hand patches were re-applied and the SpeakV2Speed float patch was retired because Fern now emits float.

What I checked

  • Does the build pass? Yes: mypy clean on 904 files; 973 unit/custom tests pass in a python:3.12 container (wire tests need docker-compose and ran green in CI).
  • Is dropping aura-2-perseo-it a break? No. I sent it to the live /v1/speak endpoint and got HTTP 400 "No such model/version combination found" (a real Italian voice, aura-2-livia-it, returned audio). The literal union still contains Any, so the string still type-checks and still sends; nothing that worked stops working. Minor bump is honest.
  • Did every hand patch survive? Yes: Authorization is still masked as Token [REDACTED] in error strings, booleans still serialize as lowercase in websocket URLs, the language_hint and legacy alias shims are intact, and .fernignore covers each of them.
  • Do unmodeled query params still reach the websocket URL? Yes, verified empirically (no_delay=true&tag=a&tag=b on both /v2/listen and /v1/agent/converse), but no test asserts it.
  • Same spec as the JS/Java regens? Yes: the only file that differs between the 09-03 and 09-04 snapshots is fern/generators.yml.
  • Is the Flux speed range true on production today? Not consistently — live probes against /v2/speak show some requests outside 0.85–1.15 rejected with the old-range error and others returning audio (your "accepted 0.5 and 1.5" matches the new nodes). Waiting on the Flux TTS team for a fleet-wide date; see the Java #100 review.

What to fix

  1. Version: pyproject.toml, .fern/metadata.json, and the client_wrapper.py fallback say 7.8.2, but a feat title makes release-please produce 7.9.0; the fallback would report a version that never ships. Unless there is a reason for stamping it, leave them at 7.8.1 (as #768 did).
  2. Add a wire assertion for additional_query_parameters in tests/custom/test_listen_v2_connect_wire.py — assert the captured URL contains no_delay=true&tag=a&tag=b rather than only that a socket was created.
  3. The Listen V2 send_force_end_turn docstring lost its "requires server-side enablement / UNPARSABLE_CLIENT_MESSAGE closes the connection" warning while reference.md:5417, examples/16, and the STT skill still state it. Is ForceEndTurn live on every prod deployment? That answer makes the four files agree and fixes the Java/JS docstrings too.
  4. Restore the See: internal-api-specs/issues/205 line in _sanitize_numeric_types; it is now cited nowhere.
  5. Add two lines to the squash-commit body so the changelog names the speed-range change (with the caveat if rollout is not confirmed) and the perseo removal, using the same sentence as Java and JS: "never served by the API (returns 400) and removed from the spec."

Nits: align reference.md wording with the generated "not supported with Nova-3 models"; keep the "0 is the only value validated for production" expressivity caveat at reference.md:6247; example 32 ends in a misleading TimeoutError 15 s after a FORCE_END_TURN_UNSUPPORTED warning.

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