From e0e2b6ac6b75facd967ce0142e22b0fcab2d24e6 Mon Sep 17 00:00:00 2001 From: Jon Taylor Date: Mon, 20 Oct 2025 22:45:40 +0100 Subject: [PATCH] draft patch: pass request data through to bot module --- src/pipecat/runner/run.py | 5 ++++- src/pipecat/runner/types.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pipecat/runner/run.py b/src/pipecat/runner/run.py index a90c96ac5..ccd190707 100644 --- a/src/pipecat/runner/run.py +++ b/src/pipecat/runner/run.py @@ -260,7 +260,10 @@ def _setup_webrtc_routes( # Prepare runner arguments with the callback to run your bot async def webrtc_connection_callback(connection): bot_module = _get_bot_module() - runner_args = SmallWebRTCRunnerArguments(webrtc_connection=connection) + runner_args = SmallWebRTCRunnerArguments( + webrtc_connection=connection, + body=request.request_data + ) background_tasks.add_task(bot_module.bot, runner_args) # Delegate handling to SmallWebRTCRequestHandler diff --git a/src/pipecat/runner/types.py b/src/pipecat/runner/types.py index 89aecd84c..87357d582 100644 --- a/src/pipecat/runner/types.py +++ b/src/pipecat/runner/types.py @@ -24,10 +24,13 @@ class RunnerArguments: handle_sigterm: bool = field(init=False) pipeline_idle_timeout_secs: int = field(init=False) + body: Optional[Any] = field(default_factory=dict) + def __post_init__(self): self.handle_sigint = False self.handle_sigterm = False self.pipeline_idle_timeout_secs = 300 + self.body = self.body or {} @dataclass @@ -42,7 +45,6 @@ class DailyRunnerArguments(RunnerArguments): room_url: str token: Optional[str] = None - body: Optional[Any] = field(default_factory=dict) @dataclass @@ -55,7 +57,6 @@ class WebSocketRunnerArguments(RunnerArguments): """ websocket: WebSocket - body: Optional[Any] = field(default_factory=dict) @dataclass