Skip to content

feat(inworld tts): add delivery_mode parameter for inworld-tts-2#5801

Merged
tinalenguyen merged 2 commits into
mainfrom
chrisa/add-inworld-tts-2-params
May 21, 2026
Merged

feat(inworld tts): add delivery_mode parameter for inworld-tts-2#5801
tinalenguyen merged 2 commits into
mainfrom
chrisa/add-inworld-tts-2-params

Conversation

@chrisackermann
Copy link
Copy Markdown
Contributor

Summary

  • Adds delivery_mode to the Inworld TTS plugin, exposing the TTS-2-only
    deliveryMode output-variation control. Accepts "DELIVERY_MODE_UNSPECIFIED",
    "STABLE", "BALANCED", or "CREATIVE" per the Inworld REST API reference.
  • Wired through both transport paths: the WebSocket streaming create packet
    (SynthesizeStream via _InworldConnection._send_loop) and the HTTP
    streaming request body (ChunkedStream._run). Mirrors the existing
    text_normalization / timestamp_type plumbing.
  • Surfaced on TTS.__init__, TTS.update_options, and _TTSOptions, with
    the same _validate_str_param validation used by the sibling enum params.

Why

Inworld TTS-2 introduced deliveryMode and silently ignores temperature
on that model. Previously the plugin gave TTS-2 users no way to steer output
variation. Defaults are unchanged — delivery_mode is opt-in and absent from
the wire when unset, letting the server default (BALANCED) apply.

No client-side model-gating: Inworld silently ignores the wrong knob on each
model, and gating client-side would require tracking Inworld's per-model field
support over time. The docstring calls out the TTS-2-only semantics.

Test plan

  • uv run pytest tests/test_plugin_inworld_tts.py — 9 new unit tests pass
    (option round-trip + validation for all four documented values + rejection
    of unknown values + wire-payload assertions for both WS and HTTP paths,
    including the negative case that deliveryMode is omitted when unset)
  • make check — ruff lint, ruff format, mypy clean
  • Live-tested against the real Inworld API end-to-end: rendered the same
    line with delivery_mode="STABLE", "BALANCED", and "CREATIVE" against
    inworld-tts-2. All three were accepted (no fallback to EXPRESSIVE needed —
    the REST docs are authoritative, the Inworld Python SDK docstring is stale)
    and produced audibly different cadence/expressiveness.

@chenghao-mou chenghao-mou requested a review from a team May 21, 2026 18:57
@chrisackermann chrisackermann requested review from tinalenguyen and removed request for a team May 21, 2026 18:57
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Member

@tinalenguyen tinalenguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm and tested it, thank you @chrisackermann!

@tinalenguyen tinalenguyen merged commit 09424f1 into main May 21, 2026
26 checks passed
@tinalenguyen tinalenguyen deleted the chrisa/add-inworld-tts-2-params branch May 21, 2026 19:12
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