Update client examples to use latest versions (#1523)

This commit is contained in:
Mattie Ruth
2025-04-03 15:47:03 -04:00
committed by GitHub
parent c226c20e12
commit ec00edc893
15 changed files with 875 additions and 3238 deletions

View File

@@ -111,15 +111,19 @@ async def create_room_and_token() -> tuple[str, str]:
Raises:
HTTPException: If room creation or token generation fails
"""
room = await daily_helpers["rest"].create_room(DailyRoomParams())
if not room.url:
raise HTTPException(status_code=500, detail="Failed to create room")
room_url = os.getenv("DAILY_SAMPLE_ROOM_URL", None)
token = os.getenv("DAILY_SAMPLE_ROOM_TOKEN", None)
if not room_url:
room = await daily_helpers["rest"].create_room(DailyRoomParams())
if not room.url:
raise HTTPException(status_code=500, detail="Failed to create room")
room_url = room.url
token = await daily_helpers["rest"].get_token(room.url)
if not token:
raise HTTPException(status_code=500, detail=f"Failed to get token for room: {room.url}")
token = await daily_helpers["rest"].get_token(room_url)
if not token:
raise HTTPException(status_code=500, detail=f"Failed to get token for room: {room_url}")
return room.url, token
return room_url, token
@app.get("/")