assemblyai 4.36.3 → 4.36.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,8 +94,8 @@ export type StreamingTranscriberParams = {
94
94
  connectionRetryDelay?: number;
95
95
  /**
96
96
  * Required for PCM encodings (and for dual-channel mode). May be omitted
97
- * for Opus encodings (`opus`, `ogg_opus`) — the stream is self-describing
98
- * and the server ignores the value.
97
+ * for self-describing encodings (`opus`, `ogg_opus`, `aac`) — the stream
98
+ * carries its own rate and the server ignores the value.
99
99
  */
100
100
  sampleRate?: number;
101
101
  encoding?: AudioEncoding;
@@ -108,6 +108,7 @@ export type StreamingTranscriberParams = {
108
108
  maxTurnSilence?: number;
109
109
  vadThreshold?: number;
110
110
  formatTurns?: boolean;
111
+ sessionHeartbeat?: boolean;
111
112
  filterProfanity?: boolean;
112
113
  keyterms?: string[];
113
114
  keytermsPrompt?: string[];
@@ -184,6 +185,7 @@ export type StreamingEvents =
184
185
  | "llmGatewayResponse"
185
186
  | "speakerRevision"
186
187
  | "warning"
188
+ | "heartbeat"
187
189
  | "vad"
188
190
  | "error";
189
191
 
@@ -195,6 +197,7 @@ export type StreamingListeners = {
195
197
  llmGatewayResponse?: (event: LLMGatewayResponseEvent) => void;
196
198
  speakerRevision?: (event: SpeakerRevisionEvent) => void;
197
199
  warning?: (event: WarningEvent) => void;
200
+ heartbeat?: (event: HeartbeatEvent) => void;
198
201
  vad?: (event: VadFrame) => void;
199
202
  error?: (error: Error) => void;
200
203
  };
@@ -370,6 +373,7 @@ export type StreamingUpdateConfiguration = {
370
373
  max_turn_silence?: number;
371
374
  vad_threshold?: number;
372
375
  format_turns?: boolean;
376
+ session_heartbeat?: boolean;
373
377
  keyterms_prompt?: string[];
374
378
  prompt?: string;
375
379
  agent_context?: string;
@@ -404,6 +408,14 @@ export type WarningEvent = {
404
408
  warning: string;
405
409
  };
406
410
 
411
+ export type HeartbeatEvent = {
412
+ type: "Heartbeat";
413
+ total_audio_received_ms: number;
414
+ total_duration_ms: number;
415
+ realtime_factor: number;
416
+ max_speech_probability: number;
417
+ };
418
+
407
419
  export type LLMGatewayResponseEvent = {
408
420
  type: "LLMGatewayResponse";
409
421
  turn_order: number;
@@ -443,7 +455,8 @@ export type StreamingEventMessage =
443
455
  | LLMGatewayResponseEvent
444
456
  | SpeakerRevisionEvent
445
457
  | ErrorEvent
446
- | WarningEvent;
458
+ | WarningEvent
459
+ | HeartbeatEvent;
447
460
 
448
461
  export type StreamingOperationMessage =
449
462
  | StreamingUpdateConfiguration