Skip to content

Commit a6805e4

Browse files
authored
Merge pull request pipecat-ai#2977 from pipecat-ai/mb/request-handler-smallwebrtc
Fix: support request data in SmallWebRTC
2 parents bf5157f + 518e778 commit a6805e4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ reason")`.
3333

3434
### Fixed
3535

36+
- Fixed an issue where the `SmallWebRTCRequest` dataclass in runner would scrub
37+
arbitrary request data from client due to camelCase typing. This fixes data
38+
passthrough for JS clients where `APIRequest` is used.
39+
3640
- Fixed `GeminiLiveLLMService` session resumption after a connection timeout.
3741

3842
- `GeminiLiveLLMService` now properly supports context-provided system

src/pipecat/transports/smallwebrtc/request_handler.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ class SmallWebRTCRequest:
4040
request_data: Optional[Any] = None
4141

4242

43+
@classmethod
44+
def from_dict(cls, data: dict):
45+
"""Accept both snake_case and camelCase for the request_data field."""
46+
if "requestData" in data and "request_data" not in data:
47+
data["request_data"] = data.pop("requestData")
48+
return cls(**data)
49+
50+
4351
@dataclass
4452
class IceCandidate:
4553
"""The remote ice candidate object received from the peer connection.

0 commit comments

Comments
 (0)