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 12 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.1.send_force_end_turn()helpers.expressivityand the generated Flux speed range.Production availability
The spec documents Flux TTS speed values from
0.5to1.5in0.05increments. As of 2026-09-07, production accepts values outside0.85to1.15only intermittently; stay inside0.85to1.15until the wider range is announced live.Listen V2 ForceEndTurn requires server-side enablement. Deployments without the feature return
UNPARSABLE_CLIENT_MESSAGEand close the connection.Unsupported voice removal
aura-2-perseo-itwas never served by the API (it returns 400) and was removed from the spec. The Python model union remains open throughAny, so callers can still pass the string and the removal is not source-breaking.Generator provenance
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.Validation
poetry run mypy src/ tests/typecheck/compat_aliases.pyruff checkon changed tests and examplesgit diff --check