Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions src/services/agent-manager/connect-to-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
ConnectionState,
CreateSessionV2Options,
CreateStreamOptions,
Interrupt,
StreamEvents,
StreamType,
StreamingState,
Expand Down Expand Up @@ -167,8 +166,6 @@ type ConnectToManagerOptions = AgentManagerOptions & {
onVideoIdChange?: (videoId: string | null) => void;
/** Internal callback for livekit-manager data channel events */
onMessage?: ChatProgressCallback;
/** Internal callback for when interrupt is detected by streaming manager */
onInterruptDetected?: (interrupt: Interrupt) => void;
onFirstAudioDetected?: (metrics: AudioDetectionMetrics) => void;
};
chatId?: string;
Expand Down
1 change: 0 additions & 1 deletion src/services/agent-manager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ export async function createAgentManager(agent: string, options: AgentManagerOpt
...options.callbacks,
onVideoIdChange: updateVideoId,
onMessage,
onInterruptDetected: interrupt,
},
},
agentsApi,
Expand Down
9 changes: 0 additions & 9 deletions src/services/streaming-manager/livekit-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,10 @@ describe('LiveKit Streaming Manager - Microphone Stream', () => {
});

describe('Transcription Interrupt Detection', () => {
let mockOnInterruptDetected: jest.Mock;
let transcriptionHandler: (segments: any[], participant?: any) => void;
let dataHandler: (payload: Uint8Array, participant?: any, kind?: any, topic?: string) => void;

beforeEach(async () => {
mockOnInterruptDetected = jest.fn();
options.callbacks.onInterruptDetected = mockOnInterruptDetected;

await createLiveKitStreamingManager(agentId, sessionOptions, options);
await simulateConnection();

Expand Down Expand Up @@ -533,16 +529,13 @@ describe('LiveKit Streaming Manager - Microphone Stream', () => {
transcriptionHandler([], localParticipant);

expect(mockLatencyTimestampTrackerUpdate).toHaveBeenCalledTimes(1);
expect(mockOnInterruptDetected).toHaveBeenCalledTimes(1);
expect(mockOnInterruptDetected).toHaveBeenCalledWith({ type: 'audio' });
});

it('should not detect interrupt when local participant sends transcription during Idle state', () => {
const localParticipant = { isLocal: true };
transcriptionHandler([], localParticipant);

expect(mockLatencyTimestampTrackerUpdate).toHaveBeenCalledTimes(1);
expect(mockOnInterruptDetected).not.toHaveBeenCalled();
});

it('should not detect interrupt when local participant sends transcription during Loading state', async () => {
Expand All @@ -556,7 +549,6 @@ describe('LiveKit Streaming Manager - Microphone Stream', () => {
transcriptionHandler([], localParticipant);

expect(mockLatencyTimestampTrackerUpdate).toHaveBeenCalledTimes(1);
expect(mockOnInterruptDetected).not.toHaveBeenCalled();
});

it('should update latency tracker but not detect interrupt when remote participant sends transcription during Talking state', () => {
Expand All @@ -567,7 +559,6 @@ describe('LiveKit Streaming Manager - Microphone Stream', () => {
transcriptionHandler([], remoteParticipant);

expect(mockLatencyTimestampTrackerUpdate).not.toHaveBeenCalled();
expect(mockOnInterruptDetected).not.toHaveBeenCalled();
});
});

Expand Down
1 change: 0 additions & 1 deletion src/services/streaming-manager/livekit-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export async function createLiveKitStreamingManager<T extends CreateSessionV2Opt
if (participant?.isLocal) {
latencyTimestampTracker.update();
if (currentActivityState === AgentActivityState.Talking) {
callbacks.onInterruptDetected?.({ type: 'audio' });
currentActivityState = AgentActivityState.Idle;
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/types/stream/stream.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Analytics } from '@sdk/services/analytics/mixpanel';
import { VideoRTCStatsReport } from '@sdk/services/streaming-manager/stats/report';
import { Auth } from '../auth';
import { Interrupt } from '../entities';
import { ChatProgressCallback } from '../entities/agents/manager';
import { CreateClipStreamRequest, CreateTalkStreamRequest, SendClipStreamPayload, SendTalkStreamPayload } from './api';
import { ICreateStreamRequestResponse, IceCandidate, SendStreamPayloadResponse, Status } from './rtc';
Expand Down Expand Up @@ -72,7 +71,6 @@ export interface ManagerCallbacks {
onVideoIdChange?: (videoId: string | null) => void;
onStreamCreated?: (stream: { stream_id: string; session_id: string; agent_id: string }) => void;
onStreamReady?: () => void;
onInterruptDetected?: (interrupt: Interrupt) => void;
onToolEvent?: ToolEventCallback;
onInterruptibleChange?: (interruptible: boolean) => void;
onFirstAudioDetected?: (metrics: AudioDetectionMetrics) => void;
Expand Down
Loading