Add ability to trigger ReplyOnPause without waiting for pause (#250)

* Add code

* Send text or audio demo
This commit is contained in:
Freddy Boulton
2025-04-03 20:19:50 -04:00
committed by GitHub
parent aed34825e3
commit 8dd17d3216
5 changed files with 726 additions and 2 deletions

View File

@@ -206,6 +206,11 @@ class ReplyOnPause(StreamHandler):
self.event.clear()
self.state = AppState()
def trigger_response(self):
self.event.set()
if self.state.stream is None:
self.state.stream = np.array([], dtype=np.int16)
async def async_iterate(self, generator) -> EmitType:
return await anext(generator)