A processor that monitors user inactivity and triggers callbacks after specified timeout periods
UserIdleProcessor
is a specialized frame processor that monitors user activity in a conversation and executes callbacks when the user becomes idle. It’s particularly useful for maintaining engagement by detecting periods of user inactivity and providing escalating responses to inactivity.
async def(processor: UserIdleProcessor) -> None
async def(processor: UserIdleProcessor, retry_count: int) -> bool
where returning False
stops idle monitoring
UserStartedSpeakingFrame
or BotSpeakingFrame
). It manages idle state based on the following rules:
False
UserIdleProcessor
: one with the basic callback and one with the retry callback:
UserStartedSpeakingFrame
: Marks user as active, resets idle timer and retry countUserStoppedSpeakingFrame
: Starts idle monitoringBotSpeakingFrame
: Resets idle timerEndFrame
/ CancelFrame
: Stops idle monitoring