Add support for dailyRoomProperties when calling /start using the development runner

This commit is contained in:
Mark Backman
2025-10-31 12:01:03 -04:00
parent 4fa0de6660
commit 5fe597d355
2 changed files with 18 additions and 1 deletions

View File

@@ -160,6 +160,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- The development runner's `/start` endpoint now supports passing
`dailyRoomProperties` in the request body when `createDailyRoom` is true.
Properties are validated against the `DailyRoomProperties` type and passed to
Daily's room creation API.
- `UserImageRawFrame` new fields `append_to_context` and `text`. The
`append_to_context` field indicates if this image and text should be added to
the LLM context (by the LLM assistant aggregator). The `text` field, if set,

View File

@@ -570,6 +570,7 @@ def _setup_daily_routes(app: FastAPI):
create_daily_room = request_data.get("createDailyRoom", False)
body = request_data.get("body", {})
daily_room_properties_dict = request_data.get("dailyRoomProperties", None)
bot_module = _get_bot_module()
@@ -584,9 +585,20 @@ def _setup_daily_routes(app: FastAPI):
import aiohttp
from pipecat.runner.daily import configure
from pipecat.transports.daily.utils import DailyRoomProperties
async with aiohttp.ClientSession() as session:
room_url, token = await configure(session)
# Parse dailyRoomProperties if provided
room_properties = None
if daily_room_properties_dict:
try:
room_properties = DailyRoomProperties(**daily_room_properties_dict)
logger.debug(f"Using custom room properties: {room_properties}")
except Exception as e:
logger.error(f"Failed to parse dailyRoomProperties: {e}")
# Continue without custom properties
room_url, token = await configure(session, room_properties=room_properties)
runner_args = DailyRunnerArguments(room_url=room_url, token=token, body=body)
result = {
"dailyRoom": room_url,