Skip to content

Commit 7d1f6b7

Browse files
committed
In the warm transfer example, formatting fixes
1 parent 8ddc123 commit 7d1f6b7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

examples/dynamic/warm_transfer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
"""
3737

3838
import asyncio
39+
import atexit
3940
import os
4041
import sys
4142
from pathlib import Path
4243
from typing import Any, Dict
43-
import atexit
4444

4545
import aiohttp
4646
from dotenv import load_dotenv
@@ -642,7 +642,9 @@ async def on_participant_left(
642642
# hold, informing the human agent if needed
643643
"""If all human participants have left, stop the bot"""
644644
human_participants = {
645-
k: v for k, v in transport.participants().items() if v.get("info", {}).get("userId") in {"agent", "customer"}
645+
k: v
646+
for k, v in transport.participants().items()
647+
if v.get("info", {}).get("userId") in {"agent", "customer"}
646648
}
647649
if not human_participants:
648650
await task.cancel()
@@ -686,6 +688,7 @@ def cleanup_hold_music_process():
686688
except:
687689
# Exception if process already done; we don't care, it didn't hurt to try
688690
pass
691+
689692
atexit.register(cleanup_hold_music_process)
690693

691694
# Run the pipeline

0 commit comments

Comments
 (0)