feat(regen): agent force-end-turn and Flux expressivity controls - #783
feat(regen): agent force-end-turn and Flux expressivity controls#783GregHolmes wants to merge 11 commits into
Conversation
|
dg-coreylweathers
left a comment
There was a problem hiding this comment.
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.12container (wire tests need docker-compose and ran green in CI). - Is dropping
aura-2-perseo-ita break? No. I sent it to the live/v1/speakendpoint and got HTTP 400 "No such model/version combination found" (a real Italian voice,aura-2-livia-it, returned audio). The literal union still containsAny, so the string still type-checks and still sends; nothing that worked stops working. Minor bump is honest. - Did every hand patch survive? Yes:
Authorizationis still masked asToken [REDACTED]in error strings, booleans still serialize as lowercase in websocket URLs, thelanguage_hintand legacy alias shims are intact, and.fernignorecovers each of them. - Do unmodeled query params still reach the websocket URL? Yes, verified empirically (
no_delay=true&tag=a&tag=bon both/v2/listenand/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/speakshow 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
- Version:
pyproject.toml,.fern/metadata.json, and theclient_wrapper.pyfallback say7.8.2, but afeattitle makes release-please produce7.9.0; the fallback would report a version that never ships. Unless there is a reason for stamping it, leave them at7.8.1(as #768 did). - Add a wire assertion for
additional_query_parametersintests/custom/test_listen_v2_connect_wire.py— assert the captured URL containsno_delay=true&tag=a&tag=brather than only that a socket was created. - The Listen V2
send_force_end_turndocstring lost its "requires server-side enablement / UNPARSABLE_CLIENT_MESSAGE closes the connection" warning whilereference.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. - Restore the
See: internal-api-specs/issues/205line in_sanitize_numeric_types; it is now cited nowhere. - 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.
Summary
fern-python-sdk5.27.1send_force_end_turn()helpersexpressivityand update the generated Flux speed documentation to 0.5-1.5keywordsand recommendskeytermSpeakV2Speedpatch and freeze entry because Fern now correctly generatesfloatDEEPGRAM_CALLBACK_URLin the prerecorded callback example instead of sending to an invalid placeholder URLUnsupported voice removal
aura-2-perseo-itfromsrc/deepgram/types/speak_v1model.py.aura-2-perseo-itfromsrc/deepgram/speak/v1/audio/types/audio_generate_request_model.py.Compatibility
language_hint, Agent UpdateListen, Listen V2 subscript access, no-payload control sends, and custom transport behavior remain supportedaura-2-perseo-it; this removal is intentional because it is not a valid Aura-2 Italian voiceValidation
poetry run mypy src/ tests/typecheck/compat_aliases.py: 904 source files passed12now validates its missingDEEPGRAM_CALLBACK_URLprerequisite locally and exits 2 without sending a requestruff checkon changed tests and examples, andgit diff --checkLive control verification
eot_threshold=1.0andeot_timeout_ms=60000accepted ForceEndTurn and returnedtrigger=manual.0.5and1.5; speed1.03returned HTTP 400 with an increment error.expressivity=2.FORCE_END_TURN_UNSUPPORTED; with a V2/Flux listen provider it proceeded through a user transcript, assistant response, andAgentAudioDonewithout a warning or disconnect.Not end-to-end verified
12, which requires an externally reachableDEEPGRAM_CALLBACK_URL27, which requires the optionaldeepgram_sagemakerpackage, AWS credentials, and a deployed compatible endpoint50through56and60, per review scopeGeneration metadata
originGitCommitIsDirtyis expected: Fern ran after an uncommittedfern/generators.ymlchange 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.