Update Tavus transport example

Show how to use on_connected event handler to obtain
Daily room URL
This commit is contained in:
Mark Backman
2026-04-15 23:04:31 -04:00
parent ac43a70d36
commit 7291026695
2 changed files with 22 additions and 0 deletions

View File

@@ -91,6 +91,14 @@ async def main():
),
)
@transport.event_handler("on_connected")
async def on_connected(transport, data):
# Extract the room name to build the conversation URL. Share this
# URL with a frontend client so it can join the same Daily room.
room_name = data.get("callConfig", {}).get("roomName")
conversation_url = f"https://tavus.daily.co/{room_name}"
logger.info(f"Conversation URL: {conversation_url}")
@transport.event_handler("on_client_connected")
async def on_client_connected(transport, participant):
logger.info(f"Client connected")