From 2506e29188fa1cb836080cd29e61cb69e3d2d4a2 Mon Sep 17 00:00:00 2001 From: AssemblyAI Date: Tue, 28 Oct 2025 03:26:28 -0700 Subject: [PATCH 1/2] Project import generated by Copybara. GitOrigin-RevId: ad224a848ad094d931b98cc76a921d550ed6dd8e --- package.json | 2 +- src/services/streaming/service.ts | 4 ++++ src/types/streaming/index.ts | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5cc5390..ad3c440 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "assemblyai", - "version": "4.18.4", + "version": "4.18.5", "description": "The AssemblyAI JavaScript SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, as well as the latest LeMUR models.", "engines": { "node": ">=18" diff --git a/src/services/streaming/service.ts b/src/services/streaming/service.ts index 92bac99..8b8430a 100644 --- a/src/services/streaming/service.ts +++ b/src/services/streaming/service.ts @@ -124,6 +124,10 @@ export class StreamingTranscriber { ); } + if (this.params.speechModel) { + searchParams.set("speech_model", this.params.speechModel.toString()); + } + url.search = searchParams.toString(); return url; diff --git a/src/types/streaming/index.ts b/src/types/streaming/index.ts index 388d296..7443fe5 100644 --- a/src/types/streaming/index.ts +++ b/src/types/streaming/index.ts @@ -13,6 +13,7 @@ export type StreamingTranscriberParams = { filterProfanity?: boolean; keyterms?: string[]; keytermsPrompt?: string[]; + speechModel?: StreamingSpeechModel; }; export type StreamingEvents = "open" | "close" | "turn" | "error"; @@ -24,6 +25,8 @@ export type StreamingListeners = { error?: (error: Error) => void; }; +export type StreamingSpeechModel = "universal-streaming-english" | "universal-streaming-multilingual"; + export type StreamingTokenParams = { expires_in_seconds: number; max_session_duration_seconds?: number; From 2ecec0d51d041066f46f208685881671b1d632fd Mon Sep 17 00:00:00 2001 From: dan-ince-aai Date: Tue, 28 Oct 2025 10:32:11 +0000 Subject: [PATCH 2/2] lint --- src/types/streaming/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/types/streaming/index.ts b/src/types/streaming/index.ts index 7443fe5..3faf00e 100644 --- a/src/types/streaming/index.ts +++ b/src/types/streaming/index.ts @@ -25,7 +25,9 @@ export type StreamingListeners = { error?: (error: Error) => void; }; -export type StreamingSpeechModel = "universal-streaming-english" | "universal-streaming-multilingual"; +export type StreamingSpeechModel = + | "universal-streaming-english" + | "universal-streaming-multilingual"; export type StreamingTokenParams = { expires_in_seconds: number;