-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add Intelligent interruption handling #4549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added detailed documentation for the interruption filter feature, including usage examples, configuration options, and implementation details.
Added a comprehensive proof of functionality for the interruption filter, including test execution logs, results, scenarios, and evaluation criteria.
Update test script name in README.
This script tests the functionality of the InterruptionFilter class by simulating various user inputs and agent states. It includes multiple test cases to validate the filter's behavior in different scenarios.
Added interruption filter to manage interruptions during speech.
Implements an interruption filter to manage user interruptions based on agent speaking status and predefined ignore words.
Add unit and integration tests for InterruptionFilter class
Refactor tests for InterruptionFilter class to use pytest framework and remove direct execution of interruption_filter.py.
Refactor InterruptionFilter to use set instead of Set for ignore words and improve logging.
Refactor InterruptionFilter class and its tests to improve structure and logging.
Add check for normalized phrase in ignore words list
Added parameters for interruption filtering in agent session.
Removed unused import of the 'os' module.
Refactor InterruptionFilter to improve clarity and functionality.
Split 'got it' into separate entries 'got' and 'it'.
Refactor interruption filtering logic to normalize ignore words and improve handling of backchanneling phrases.
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughIntroduces an InterruptionFilter feature to distinguish backchannel utterances from meaningful interruptions in voice agents. When the agent is speaking, common filler words like "yeah" and "ok" are ignored as interruptions while genuine interruptions are processed. Includes configuration options, type annotation modernization, documentation, tests, and integration with AgentSession and AgentActivity. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AgentActivity
participant InterruptionFilter
participant Logger
participant Decision
User->>AgentActivity: Audio input detected
AgentActivity->>AgentActivity: Extract transcript
AgentActivity->>AgentActivity: Determine agent_is_speaking state
AgentActivity->>InterruptionFilter: should_ignore_interruption(transcribed_text, agent_is_speaking)
alt Filter Enabled & Agent Speaking
InterruptionFilter->>InterruptionFilter: Normalize text (lowercase, remove punctuation)
InterruptionFilter->>InterruptionFilter: Check if all words in ignore_words set
alt All words are backchannels
InterruptionFilter->>Logger: Log debug "Backchannel detected"
InterruptionFilter-->>AgentActivity: return True
AgentActivity->>Decision: Skip interruption handling
else Contains non-backchannel words
InterruptionFilter->>Logger: Log info "Real interruption"
InterruptionFilter-->>AgentActivity: return False
AgentActivity->>Decision: Process interruption normally
end
else Filter Disabled or Agent Silent
InterruptionFilter-->>AgentActivity: return False
AgentActivity->>Decision: Process interruption normally
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (16)
✏️ Tip: You can disable this entire section by setting Comment |
feat: Add intelligent interruption handling
Fixes an issue where the agent stops speaking when the user says simple listening words like “yeah” or “ok” during agent speech.
Changes
Added an InterruptionFilter to ignore backchanneling words
Integrated the filter into the agent’s interruption logic
Added configuration options to:
Enable or disable the filter
Customize the list of ignored words
All four test cases are passing
How it works
When the user speaks while the agent is talking, the filter checks:
Whether the agent is currently speaking
Whether the user’s input contains only backchanneling words
If both conditions are true, the interruption is ignored and the agent continues speaking.
Otherwise, the agent is interrupted as usual.
Summary by CodeRabbit
New Features
Interruption filter for voice agents that ignores common backchannel utterances while the agent is speaking; enabled by default.
Configuration
Custom ignore-word lists, environment variable support, case-sensitivity toggle, and runtime enable/disable controls; session option to enable/disable filter.
Documentation
New README and proof-of-test documenting behavior, examples, and usage.
Tests
Extensive unit tests covering behavior, edge cases, punctuation, case sensitivity, and runtime updates.
Public API
Filter and related voice exports added for integration.
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.