Skip to content

feat: SDK 7.7.0 — Flux TTS controls, Flux STT fix, listen redact/numerals - #92

Open
GregHolmes wants to merge 6 commits into
mainfrom
feat/sdk-7.7.0
Open

feat: SDK 7.7.0 — Flux TTS controls, Flux STT fix, listen redact/numerals#92
GregHolmes wants to merge 6 commits into
mainfrom
feat/sdk-7.7.0

Conversation

@GregHolmes

@GregHolmesGregHolmes commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Brings the CLI up to date with Deepgram Python SDK 7.6.0 + 7.7.0 in one release. All changes are additive and backward-compatible.

SDK bump

  • deepgram-sdk 7.5.0 → 7.7.0 across the workspace + relocked uv.lock.

Speak — Flux TTS streaming controls (7.7.0)

  • New dg speak --speed (0.85–1.15, 0.05 steps) and --expressivity (-2..2), forwarded to speak.v2.connect().
  • Validated up front and rejected for Aura (v1) models, so misuse fails with a clear message instead of a mid-stream server error.
  • send_interrupt() / send_configure() barge-in were intentionally not exposed — they're for live agent pipelines, not one-shot dg speak.

Listen — redact / numerals + Flux STT fix (7.6.0 + 7.7.0)

  • New dg listen --redact (numbers / aggressive_numbers, or v1 values like pci/ssn) and --numerals, applied to both prerecorded and live paths.
  • Fixes Flux STT (listen v2) streaming, which had been broken since it was added:
    • _ws_url was sending v1-only params (language, smart_format, punctuate, channels, diarize, interim_results) to the v2 endpoint → HTTP 400. Now builds the param set per API version.
    • The parser only understood v1 Results; Flux emits turn-based TurnInfo. Added _handle_v2_turn with per-turn state + _flush_v2 to emit the final turn when a finite file/stdin stream closes before an EndOfTurn.

Docs

  • Aura-2 Spanish voices (7.6.0, e.g. aura-2-selena-es) — no code change (model is a pass-through string); added an example + a pointer to dg models.

Tests

  • Unit coverage for all of the above, including a regression guard asserting v2 omits the v1-only params (the exact HTTP 400 cause) and Flux TurnInfo finalization/flush-on-close.
  • New live e2e suite (tests/e2e/): drives command handle() against the real API in-process — Flux TTS speed/expressivity → WAV, Aura Spanish → MP3, Flux STT numerals/redact → transcript, nova-3 v1 baseline. Gated on DEEPGRAM_API_KEY, so it skips in CI (no secret) and runs locally/manually. Set DEEPGRAM_BASE_URL for staging.

Verification (against production)

  • dg speak --speed 0.9 --expressivity 2 → valid 24 kHz WAV; invalid values / Aura misuse rejected upfront.
  • dg listen --model flux-general-en --numerals"My account number is 4 5 6 7."; --redact numbers"My account number is *."; nova-3 (v1) → "My account number is 4567." (unaffected).
  • dg speak -m aura-2-selena-es → valid Spanish MP3.
  • Full suite: 990 passed (+5 live e2e when a key is present); ruff + format + mypy clean.

Versioning/CHANGELOG are intentionally untouched — release-please will bump the affected components and generate entries from the feat(...) commits, so merging this then the release PR ships it as one release.

Bump deepgram-sdk 7.5.0 -> 7.7.0 across the workspace and expose the new
Flux (Speak v2) streaming controls on `dg speak`:
- `--speed` (0.85-1.15, 0.05 steps) and `--expressivity` (-2..2) forward to
`speak.v2.connect()` via `speak_text_stream()`; only sent when set.
- Both are validated up front and rejected for Aura (v1) models, so misuse
fails with a clear message instead of a mid-stream server error.
- Update --help, examples, agent_help, the skill-generator snippet, README,
and add tests (forwarding, Aura rejection, invalid speed/expressivity).
Expose --redact (numbers, aggressive_numbers, or v1 values like pci/ssn)
and --numerals on `dg listen`, applied to both prerecorded and live paths.
Also fixes Flux STT (listen v2) streaming, which was broken since it was
added:
- `_ws_url` sent v1-only params (language, smart_format, punctuate,
channels, diarize, interim_results) to the v2 endpoint, which rejected
them with HTTP 400. Build the param set per API version instead.
- The message parser only understood v1 `Results`; Flux emits turn-based
`TurnInfo` events. Add `_handle_v2_turn` with per-turn state, plus
`_flush_v2` to emit the final turn when a finite stream closes before an
`EndOfTurn` (common for files/stdin).
Verified against staging: `--model flux-general-en --numerals` yields
digit transcripts, `--redact numbers` redacts them, and nova-3 (v1) is
unaffected. Adds tests for _ws_url params and v2 turn finalization.
SDK 7.6.0 added Aura-2 Spanish voices (e.g. aura-2-selena-es). These need
no CLI code change — the model is passed through as a string — so just add
an example and a pointer to `dg models` for the current list.
The Flux STT (listen v2) HTTP 400 fix hinges on _ws_url NOT sending
v1-only params (language, smart_format, punctuate, channels, diarize,
interim_results) to the v2 endpoint, but nothing asserted that directly —
a revert would silently rebreak Flux STT. Add explicit v2-omits /
v1-includes assertions.
Add tests/e2e/ that drive command handle() against the real Deepgram API
in-process, covering the release's new functionality end to end:
- speak Flux --speed/--expressivity -> valid WAV
- speak aura-2-selena-es (multilingual) -> MP3 over REST
- listen Flux STT (v2) --numerals -> digits in transcript
- listen Flux STT (v2) --numerals --redact numbers -> redacted
- listen nova-3 (v1) baseline -> guards the v2-fix regression
Gated on DEEPGRAM_API_KEY (skipped otherwise), so they never run in the
CI matrix (no secret) but run locally/manually with a key exported. Set
DEEPGRAM_BASE_URL to target staging. Verified: 5 skip without a key, 5
pass against production.
…(v2)
Address review findings on PR #92:
- listen: emit a stderr note when --diarize is set against a Flux STT
(v2) model, instead of silently dropping it. v1 paths unaffected.
- disambiguate user-facing copy now that both Flux surfaces exist:
"Flux TTS" in speak, "Flux STT" in listen (help text, the Aura
rejection error, and README comments).
- bound the SDK pin to >=7.7.0,<8 across all packages so a future
breaking major isn't pulled in automatically.
Gate: make check clean; full suite + live e2e (production) green.
Sign up for freeto 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.

1 participant

@GregHolmes