Skip to content

feat(voice): forward custom WebSocket headers via connect()#120

Draft
sam-s10s wants to merge 1 commit into
mainfrom
pr/voice-ws-headers
Draft

feat(voice): forward custom WebSocket headers via connect()#120
sam-s10s wants to merge 1 commit into
mainfrom
pr/voice-ws-headers

Conversation

@sam-s10s

@sam-s10s sam-s10s commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

Adds an optional ws_headers argument to VoiceAgentClient.connect(), forwarded through to start_session. The underlying RT client already supports custom WebSocket handshake headers; this wires the Voice SDK up to it.

Changes

  • VoiceAgentClient.connect(ws_headers: Optional[dict] = None) → passed to start_session(..., ws_headers=ws_headers).
  • Tests: test_with_headers (valid headers connect/disconnect) and test_with_corrupted_headers (malformed headers handled gracefully) in tests/voice/test_06_stt_config.py.

Notes

  • Touches sdk/voice/speechmatics/voice/_client.py (only the connect() region). Two sibling PRs (pr/voice-8khz, pr/voice-forced-eou) also touch this file but in disjoint regions — they merge cleanly in any order; whichever lands later may need a trivial rebase.
  • Extracted from the voice/v0.2.9-rc3 pre-release line.

Test plan

  • tests/voice/test_06_stt_config.py passes with a valid API key
  • Verify custom headers reach the WebSocket handshake

Add optional ws_headers argument to VoiceAgentClient.connect(), forwarded to
start_session (RT client already supports it). Adds header handling tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant