feat: update AI voice settings for improved responsiveness and pacing
deploy / deploy (push) Successful in 31s
deploy / deploy (push) Successful in 31s
This commit is contained in:
@@ -2861,7 +2861,6 @@ def test_media_runtime_no_speech_watchdog_reprompts_on_silence_timeout():
|
||||
handle_media_error=lambda session_id, message, metadata: None,
|
||||
)
|
||||
runtime._no_speech_reprompt_seconds = 0.05
|
||||
runtime._no_speech_reprompt_poll_seconds = 0.02
|
||||
|
||||
spoken: list[str] = []
|
||||
|
||||
@@ -2887,16 +2886,21 @@ def test_media_runtime_no_speech_watchdog_reprompts_on_silence_timeout():
|
||||
frame_ms=20,
|
||||
frame_bytes=320,
|
||||
)
|
||||
# The no-speech watchdog check now rides the existing keepalive loop
|
||||
# instead of its own dedicated task; keep last_outbound_audio_monotonic
|
||||
# fresh so the loop's silence-keepalive-audio branch (which needs a
|
||||
# real writer) doesn't fire during this test.
|
||||
actor.last_outbound_audio_monotonic = time.monotonic()
|
||||
await runtime._set_actor_state(actor, "listening")
|
||||
watchdog_task = asyncio.create_task(runtime._no_speech_reprompt_loop(actor))
|
||||
for _ in range(50):
|
||||
keepalive_task = asyncio.create_task(runtime._keepalive_loop(actor))
|
||||
for _ in range(20):
|
||||
if spoken:
|
||||
break
|
||||
await asyncio.sleep(0.02)
|
||||
await asyncio.sleep(0.05)
|
||||
actor.closed = True
|
||||
watchdog_task.cancel()
|
||||
keepalive_task.cancel()
|
||||
with contextlib.suppress(asyncio.CancelledError, Exception):
|
||||
await watchdog_task
|
||||
await keepalive_task
|
||||
assert spoken, "watchdog should reprompt after prolonged silence in listening state"
|
||||
|
||||
asyncio.run(_scenario())
|
||||
|
||||
Reference in New Issue
Block a user