turns: add external user and bot turn start strategies
External strategies are strategies where the logic for user turn start and turn end come from a different processors (e.g. an STT).
This commit is contained in:
@@ -30,7 +30,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -55,7 +55,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -86,7 +86,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -133,7 +133,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -167,7 +167,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -209,7 +209,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -239,7 +239,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -275,7 +275,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -313,7 +313,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -347,7 +347,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -392,7 +392,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -412,7 +412,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
@@ -437,7 +437,7 @@ class TestTranscriptionBotTurnStartStrategy(unittest.IsolatedAsyncioTestCase):
|
||||
should_start = None
|
||||
|
||||
@strategy.event_handler("on_bot_turn_started")
|
||||
async def on_bot_turn_started(strategy):
|
||||
async def on_bot_turn_started(strategy, enable_user_speaking_frames):
|
||||
nonlocal should_start
|
||||
should_start = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user