Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions agents/src/inference/interruption/interruption_detector.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2026 LiveKit, Inc.
//
// SPDX-License-Identifier: Apache-2.0
import { ThrowsPromise } from '@livekit/throws-transformer/throws';
import type { TypedEventEmitter } from '@livekit/typed-emitter';
import EventEmitter from 'events';
import { log } from '../../log.js';
Expand Down Expand Up @@ -152,28 +151,4 @@ export class AdaptiveInterruptionDetector extends (EventEmitter as new () => Typ
removeStream(stream: InterruptionStreamBase): void {
this.streams.delete(stream);
}

/**
* Update options for the detector and propagate to all active streams.
* For WebSocket streams, this triggers a reconnection with new settings.
*/
async updateOptions(options: {
threshold?: number;
minInterruptionDurationInS?: number;
}): Promise<void> {
if (options.threshold !== undefined) {
this.options.threshold = options.threshold;
}
if (options.minInterruptionDurationInS !== undefined) {
this.options.minInterruptionDurationInS = options.minInterruptionDurationInS;
this.options.minFrames = Math.ceil(options.minInterruptionDurationInS * FRAMES_PER_SECOND);
}

// Propagate option updates to all active streams (matching Python behavior)
const updatePromises: Promise<void>[] = [];
for (const stream of this.streams) {
updatePromises.push(stream.updateOptions(options));
}
await ThrowsPromise.all(updatePromises);
}
}
Loading