Merge pull request #3071 from pipecat-ai/filipi/small_webrtc_custom_data
Passing the custom request_data to the SmallWebRTCRunnerArguments body.
This commit is contained in:
@@ -48,6 +48,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed an issue in the `Runner` where, when using `SmallWebRTCTransport`, the
|
||||||
|
`request_data` was not being passed to the `SmallWebRTCRunnerArguments` body.
|
||||||
|
|
||||||
- Fixed subtle issue of assistant context messages ending up with double spaces
|
- Fixed subtle issue of assistant context messages ending up with double spaces
|
||||||
between words or sentences.
|
between words or sentences.
|
||||||
|
|
||||||
|
|||||||
@@ -264,7 +264,10 @@ def _setup_webrtc_routes(
|
|||||||
# Prepare runner arguments with the callback to run your bot
|
# Prepare runner arguments with the callback to run your bot
|
||||||
async def webrtc_connection_callback(connection):
|
async def webrtc_connection_callback(connection):
|
||||||
bot_module = _get_bot_module()
|
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)
|
background_tasks.add_task(bot_module.bot, runner_args)
|
||||||
|
|
||||||
# Delegate handling to SmallWebRTCRequestHandler
|
# Delegate handling to SmallWebRTCRequestHandler
|
||||||
@@ -326,7 +329,8 @@ def _setup_webrtc_routes(
|
|||||||
type=request_data["type"],
|
type=request_data["type"],
|
||||||
pc_id=request_data.get("pc_id"),
|
pc_id=request_data.get("pc_id"),
|
||||||
restart_pc=request_data.get("restart_pc"),
|
restart_pc=request_data.get("restart_pc"),
|
||||||
request_data=request_data,
|
request_data=request_data.get("request_data")
|
||||||
|
or request_data.get("requestData"),
|
||||||
)
|
)
|
||||||
return await offer(webrtc_request, background_tasks)
|
return await offer(webrtc_request, background_tasks)
|
||||||
elif request.method == HTTPMethod.PATCH.value:
|
elif request.method == HTTPMethod.PATCH.value:
|
||||||
|
|||||||
Reference in New Issue
Block a user