SIGN IN SIGN UP

feat(regen): add Flux TTS batch (REST) endpoint and agent latency report (#744)

## feat(regen): Flux TTS batch (REST) + agent latency report

Regenerates the Python SDK against the latest Fern generator and API
spec. Headline addition is the **Flux TTS batch (REST)** endpoint (`POST
/v2/speak`), the companion to the existing streaming (WebSocket)
`speak.v2.connect()`.

### What's new (generated surface)
- **Flux TTS batch**: `client.speak.v2.audio.generate()` (+ raw client),
`SpeakV2Response` / `SpeakV2AcceptedResponse` (the callback ack),
`speak/v2/audio/**`, and `tests/wire/test_speak_v2_audio.py`.
- `model` required (flux-only), optional `encoding` / `container` /
`sample_rate` / `bit_rate` / `callback` / `callback_method` / `tag` /
`mip_opt_out` / `priority`. No `speed` (GA-only, correctly excluded for
EA).
  - `sample_rate` and `bit_rate` generate as `int` (see fix below).
- **`AgentV1LatencyReport`**: new agent type + request, wired into the
agent socket client response union.
- **Agent inject-message `interrupt`**: new `interrupt` value on
`AgentV1InjectAgentMessageBehavior` (spec update).

### `sample_rate` / `bit_rate` corrected to integer
Initially generated as `float` (spec used `type: number`, mirroring
v1/Aura). stem types both as `NonZeroU32`; a float like `24000.0` is
rejected on the wire. The docs spec was corrected to `type: integer`,
the SDK re-generated, and patches re-reconciled. They now generate as
`typing.Optional[int]`.

### Patch reconciliation
Regen followed the freeze workflow (unfreeze frozen-and-patched files to
`.bak` -> Fern overwrites -> re-apply). All 27 manual patches were still
needed; **none dropped**, every `.fernignore` entry restored. Net diff
vs `main` is exactly the new surface above with all patches preserved
verbatim.
- Behavioral: `query_encoder` bool coercion, `client_wrapper`
release-please annotations, 5 socket clients (broad except, optional
control-message params, agent `_sanitize_numeric_types`, listen/v2
`send_configure` shim).
- Schema back-compat: `agent_v1settings*` (callable wrapper,
`messages`->`context`, `.messages`), `language_hint`->`language_hints`
validators.
- `__init__.py` re-exports and the `create-key` wire-alias test.

### Verification
- `mypy src/deepgram`: success (856 files).
- `pytest`: 325 passed, 1 skipped.
- `ruff check src/deepgram`: clean. (Pre-existing import-sort errors in
frozen hand-written `tests/manual` / `examples` are unchanged from
`main` and out of scope.)
- **Live against staging**: `speak.v2.audio.generate()` returns real
audio for mp3 / linear16 / flac; integer `sample_rate` (incl. `44100`)
and `bit_rate` accepted; a forced float `"24000.0"` is rejected by stem
(`expected a nonzero u32`), confirming the integer typing is correct.

### Merge
Squash-merge (repo convention). The `feat(regen)` title drives a
release-please minor bump for the new endpoint.

---------

Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
G
Greg Holmes committed
6ca71c40e158f5bdf084e6b55572deca1532c465
Parent: 69a2445
Committed by GitHub <noreply@github.com> on 7/14/2026, 2:53:04 PM