/** * Callback invoked when voicemail is detected. * @param payload Detection details (e.g. `transcript`, `confidence`). */ export type VoiceMailCallback = (payload: Record) => void | Promise; /** Options for {@link VoiceMailDetector}. */ export type VoiceMailDetectorOptions = { /** LLM used for classification. Default: `null`. */ llm?: any; /** Callback fired on detection. Default: `null`. */ callback?: VoiceMailCallback | null; /** Detection window in seconds. Default: `2.0`. Overridden by {@link VoiceMailDetectorOptions.maxDetectionSeconds} when set. */ duration?: number; /** Custom classifier prompt; falls back to the built-in prompt when empty. Default: `''`. */ customPrompt?: string | null; /** Hang up automatically when voicemail is detected. Default: `false`. */ autoHangup?: boolean; /** Confidence threshold (0-1) required to count as a detection. Default: `1.0`. */ detectionThreshold?: number; /** Maximum detection window in seconds; takes precedence over {@link VoiceMailDetectorOptions.duration}. Default: `null`. */ maxDetectionSeconds?: number | null; }; declare class VoiceMailDetectorImpl { /** Built-in classifier prompt used when no custom prompt is provided. */ static readonly DEFAULT_PROMPT: string; callback: VoiceMailCallback | null; duration: number; customPrompt: string; autoHangup: boolean; detectionThreshold: number; llm: any; private _detected; private _lastEvent; constructor(opts?: VoiceMailDetectorOptions); /** Whether voicemail has been detected during this session. */ get isDetected(): boolean; /** The most recent detection event payload, or `null` if none yet. */ get lastEvent(): Record | null; _onRuntimeEvent(payload: Record): Promise; } /** * Detects whether an outbound call reached a human or voicemail, firing an * optional callback (and optionally hanging up) on detection. */ export type VoiceMailDetector = VoiceMailDetectorImpl; /** Create a {@link VoiceMailDetector}. */ export declare const VoiceMailDetector: (opts?: VoiceMailDetectorOptions) => VoiceMailDetector; export {};