agents icon indicating copy to clipboard operation
agents copied to clipboard

Programmatic control to interrupt the current voice playback

Open davidzhao opened this issue 1 year ago • 2 comments

Currently interruptions are only allowed if they came from the user's voice track. It would be nice to have a function like agent.interrupt() to programmatically clear the current playout queue in order to switch speech tracks

davidzhao avatar Oct 25 '24 20:10 davidzhao

I thought I saw something like that merged a few weeks ago:

https://github.com/livekit/agents/commit/d780acf4def7476e487f260b6582332945e4b13a

Maybe just need a wrapper around:

agent._pending_agent_reply.cancel()

jezell avatar Oct 26 '24 06:10 jezell

ah ha.. maybe just need better docs then :) ideally there's a top level API that one could use.

davidzhao avatar Oct 29 '24 21:10 davidzhao

we now have session.interrupt() in v1.x

davidzhao avatar Apr 30 '25 07:04 davidzhao