Skip to content

fix(streaming): send mode mid-session and reject unknown session params - #297

Merged
ccampbell-aai merged 2 commits into
masterfrom
ccampbell/streaming-update-config-mode
Nov 17, 2026
Merged

ccampbell-aai merged 2 commits into
masterfrom
ccampbell/streaming-update-config-mode

Conversation

@ccampbell-aai

@ccampbell-aai ccampbell-aai commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #296.

  • RealTimeSessionParameters gains mode, continuous_partials and max_turn_duration. The streaming API accepts all three in UpdateConfiguration; max_turn_duration is also accepted at connect.
  • Session params (set_params) reject unknown fields. Connect params (RealTimeParameters) ignore them and log a warning per key.
  • set_params warns when given format_turns or filter_profanity, which the API only applies at connect. They are still sent, matching the Node SDK.
  • New update_configuration(**kwargs) on both clients, a thin wrapper around set_params.
  • README/CLAUDE.md no longer say format_turns can change mid-session. Bumps to 1.10.11.

Test plan

  • New sync + async tests in test_streaming*.py
  • Full unit suite (latest deps); streaming tests on the pydantic 1.10 floor
  • ruff 0.3.5 on changed assemblyai/ files

Node counterpart: AssemblyAI/assemblyai-node-sdk#213

  • Prod (streaming.assemblyai.com, assemblyai-stt-3-7-realtime-agent), sync + async: update_configuration(mode="manual") after the first turn stops natural turn ends until force_endpoint() (control: 4 natural turns); Datadog shows UpdateConfiguration {mode: manual}. Wire frame, max_turn_duration (connect + mid-session), unknown-param warning/rejection, format_turns warning and Termination all as expected

🤖 Generated with Claude Code

ccampbell-aai and others added 2 commits November 16, 2026 17:49
RealTimeSessionParameters had no `mode` field and pydantic's default
extra="ignore" dropped it, so set_params(mode="manual") sent nothing for
mode. Add `mode` and `continuous_partials` (both accepted by the server's
UpdateConfiguration), forbid unknown fields on the session/connect
parameter models, and add a keyword `update_configuration(**kwargs)`
wrapper on StreamingClient and AsyncStreamingClient.

Fixes #296

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…duration

Connect parameters drop unknown fields with a logged warning instead of
raising; session parameters still raise. Add max_turn_duration (accepted
at connect and mid-session). set_params warns when format_turns or
filter_profanity is set, since the server applies them only at connect,
and still sends them. Fix README/CLAUDE.md, which said format_turns can
be switched mid-session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ccampbell-aai
ccampbell-aai marked this pull request as ready for review November 17, 2026 01:21
@ccampbell-aai
ccampbell-aai merged commit db7e341 into master Nov 17, 2026
8 checks passed
@ccampbell-aai
ccampbell-aai deleted the ccampbell/streaming-update-config-mode branch November 17, 2026 01:40
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.

Streaming: set_params can't update mode, and unknown fields are silently dropped

2 participants