The DebugPanel component is used to inspect real-time session state, including audio waveforms, event logs, performance metrics, and session usage. It provides a visual interface for debugging agent-user interactions, latency, and state transitions.
Key Props
| Prop | Type | Description |
|---|
userTrack | Track | undefined | The audio track for the user. |
agentTrack | Track | undefined | The audio track for the agent. |
events | AgentSession.AgentSessionEvent[] | An array of session events (e.g., state changes). |
overlappingSpeechEvents | OverlappingSpeechEvent[] | Events representing speech overlap (interruptions or backchannels). |
sessionUsage | AgentSession.AgentSessionUsage | null | Data regarding session resource usage. |
onClearEvents | () => void | Callback to clear the event log. |
networkLatency | number | One-way server-to-client transit time in seconds. |
uplinkLatency | UplinkLatency | undefined | Detailed client-to-agent pipeline latency. |
trackLabels | DebugPanelTrackLabels | undefined | Custom labels for the user and agent tracks. |
trackColors | DebugPanelTrackColors | undefined | Custom colors for the user and agent waveforms. |
highlightConfig | DebugPanelHighlightConfig | undefined | Custom labels and colors for interruption/backchannel highlights. |
Customization Types
DebugPanelTrackLabels
type DebugPanelTrackLabels = {
user?: string;
agent?: string;
};
DebugPanelTrackColors
type DebugPanelTrackColors = {
agent?: string;
user?: string;
};
DebugPanelHighlightConfig
type DebugPanelHighlightConfig = {
/** Label for interruption highlights. @default "Interruption" */
interruptionLabel?: string;
/** Label for backchannel highlights. @default "Backchannel" */
backchannelLabel?: string;
/** Color for interruption highlights. @default "#FA4C39" */
interruptionColor?: string;
/** Color for backchannel highlights. @default "#23DE6B" */
backchannelColor?: string;
};
import { DebugPanel } from "./debug-panel";
// Example usage:
<DebugPanel
userTrack={userTrack}
agentTrack={agentTrack}
events={events}
overlappingSpeechEvents={overlappingSpeechEvents}
sessionUsage={sessionUsage}
onClearEvents={handleClearEvents}
networkLatency={networkLatency}
uplinkLatency={uplinkLatency}
trackLabels={{ user: "Customer", agent: "AI Assistant" }}
trackColors={{ agent: "#BA1FF9", user: "#666666" }}
highlightConfig={{
interruptionLabel: "User Interrupted",
interruptionColor: "#FF0000",
}}
/>