From 01f3421052e16282e22080987770c46c39d0cbc0 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Tue, 4 Nov 2025 17:14:29 -0500 Subject: [PATCH] Fix: support request data in SmallWebRTC --- CHANGELOG.md | 4 ++++ src/pipecat/transports/smallwebrtc/request_handler.py | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0beaeab2f..c7b9ba07f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,10 @@ reason")`. ### Fixed +- Fixed an issue where the `SmallWebRTCRequest` dataclass in runner would scrub + arbitrary request data from client due to camelCase typing. This fixes data + passthrough for JS clients where `APIRequest` is used. + - Fixed `GeminiLiveLLMService` session resumption after a connection timeout. - `GeminiLiveLLMService` now properly supports context-provided system diff --git a/src/pipecat/transports/smallwebrtc/request_handler.py b/src/pipecat/transports/smallwebrtc/request_handler.py index b2c02a03e..adbca920e 100644 --- a/src/pipecat/transports/smallwebrtc/request_handler.py +++ b/src/pipecat/transports/smallwebrtc/request_handler.py @@ -40,6 +40,14 @@ class SmallWebRTCRequest: request_data: Optional[Any] = None +@classmethod +def from_dict(cls, data: dict): + """Accept both snake_case and camelCase for the request_data field.""" + if "requestData" in data and "request_data" not in data: + data["request_data"] = data.pop("requestData") + return cls(**data) + + @dataclass class IceCandidate: """The remote ice candidate object received from the peer connection.