-
Notifications
You must be signed in to change notification settings - Fork 785
Refeature/interrupt-handler-SirjanSingh #498
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
base: main
Are you sure you want to change the base?
Changes from all commits
7871872
76fefa4
8118f12
cef1b4b
4ad08ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,78 +1,201 @@ | ||||||
| # Voice Agents Examples | ||||||
| # Intelligent Interruption Handling for LiveKit Voice Agent | ||||||
|
|
||||||
| This directory contains a comprehensive collection of voice-based agent examples demonstrating various capabilities and integrations with the LiveKit Agents framework. | ||||||
| ## Overview | ||||||
|
|
||||||
| ## 📋 Table of Contents | ||||||
| This document explains the modifications made to `basic_agent.py` to implement intelligent interruption handling that distinguishes between **filler words** (acknowledgments like "yeah", "okay") and **command words** (interruptions like "stop", "wait"). | ||||||
|
|
||||||
| ### 🚀 Getting Started | ||||||
| --- | ||||||
| ## Student Details | ||||||
| - **Name:** Sirjan Singh | ||||||
| - **College Roll Number:** 23UCS715 | ||||||
| - **Demo Video Link:** [Drive Link](https://drive.google.com/drive/folders/1LXnojdfCtswc14PxWH60ZqynbLN03F3J?usp=sharing) | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| - [`basic_agent.py`](./basic_agent.py) - A fundamental voice agent with metrics collection | ||||||
| ## The Challenge | ||||||
|
|
||||||
| ### 🛠️ Tool Integration & Function Calling | ||||||
| In a natural voice conversation, users often say acknowledgment words like "yeah", "okay", or "hmm" while the agent is speaking. These are **backchannel responses** that mean "I'm listening, continue" — not "stop talking." | ||||||
|
|
||||||
| - [`annotated_tool_args.py`](./annotated_tool_args.py) - Using Python type annotations for tool arguments | ||||||
| - [`dynamic_tool_creation.py`](./dynamic_tool_creation.py) - Creating and registering tools dynamically at runtime | ||||||
| - [`raw_function_description.py`](./raw_function_description.py) - Using raw JSON schema definitions for tool descriptions | ||||||
| - [`silent_function_call.py`](./silent_function_call.py) - Executing function calls without verbal responses to user | ||||||
| - [`long_running_function.py`](./long_running_function.py) - Handling long running function calls with interruption support | ||||||
| However, LiveKit's default Voice Activity Detection (VAD) treats ALL user speech as potential interruptions, causing the agent to stop mid-sentence when hearing these fillers. | ||||||
|
|
||||||
| ### ⚡ Real-time Models | ||||||
| **Requirements:** | ||||||
| 1. **When agent is speaking + user says filler** → Agent continues uninterrupted | ||||||
| 2. **When agent is speaking + user says command** → Agent stops immediately | ||||||
| 3. **When agent is silent** → All user speech is valid input | ||||||
|
||||||
| 3. **When agent is silent** → All user speech is valid input | |
| 3. **When agent is silent** → Non-filler user speech is valid input; idle fillers may be ignored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This README now focuses solely on the intelligent interruption handler in
basic_agent.py, but theexamples/voice_agentsdirectory still contains many other example scripts that were previously indexed here; consider restoring or relocating a lightweight table of contents so users can still discover the rest of the voice agent examples from this README.