Skip to content

Commit 821dfd9

Browse files
authored
Merge pull request #128 from AssemblyAI/D0068A307C832CBB8356B9DDF54BB16A
Sync from internal repo (YYYY/MM/DD)
2 parents c4031b5 + bf28e51 commit 821dfd9

5 files changed

Lines changed: 14 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
- Add `language_confidence_threshold` to `Transcript`, `TranscriptParams`, and `TranscriptOptionalParams`.
2424
> The confidence threshold for the automatically detected language.
25-
> An error will be returned if the langauge confidence is below this threshold.
25+
> An error will be returned if the language confidence is below this threshold.
2626
- Add `language_confidence` to `Transcript`
2727
> The confidence score for the detected language, between 0.0 (low confidence) and 1.0 (high confidence)
2828

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "assemblyai",
3-
"version": "4.25.1",
3+
"version": "4.26.0",
44
"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.",
55
"engines": {
66
"node": ">=18"

src/services/streaming/service.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,12 @@ export class StreamingTranscriber {
142142
);
143143
}
144144

145-
if (this.params.speechModel) {
146-
if (this.params.speechModel === "u3-pro") {
147-
console.warn(
148-
"[Deprecation Warning] The speech model `u3-pro` is deprecated and will be removed in a future release. Please use `u3-rt-pro` instead.",
149-
);
150-
}
151-
searchParams.set("speech_model", this.params.speechModel.toString());
145+
if (this.params.speechModel === "u3-pro") {
146+
console.warn(
147+
"[Deprecation Warning] The speech model `u3-pro` is deprecated and will be removed in a future release. Please use `u3-rt-pro` instead.",
148+
);
152149
}
150+
searchParams.set("speech_model", this.params.speechModel.toString());
153151

154152
if (this.params.languageDetection !== undefined) {
155153
searchParams.set(

src/types/streaming/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type StreamingTranscriberParams = {
1919
keyterms?: string[];
2020
keytermsPrompt?: string[];
2121
prompt?: string;
22-
speechModel?: StreamingSpeechModel;
22+
speechModel: StreamingSpeechModel;
2323
languageDetection?: boolean;
2424
inactivityTimeout?: number;
2525
speakerLabels?: boolean;

tests/unit/streaming.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ describe("streaming", () => {
4646
websocketBaseUrl: websocketBaseUrl,
4747
apiKey: "123",
4848
sampleRate: 16_000,
49+
speechModel: "universal-streaming-english",
4950
});
5051
onOpen = jest.fn();
5152
rt.on("open", onOpen);
@@ -64,12 +65,13 @@ describe("streaming", () => {
6465
await cleanup();
6566
WS.clean();
6667

67-
const wsUrl = `${websocketBaseUrl}?token=123&sample_rate=16000&speaker_labels=true`;
68+
const wsUrl = `${websocketBaseUrl}?token=123&sample_rate=16000&speech_model=universal-streaming-english&speaker_labels=true`;
6869
server = new WS(wsUrl);
6970
rt = new StreamingTranscriber({
7071
websocketBaseUrl,
7172
token: "123",
7273
sampleRate: 16_000,
74+
speechModel: "universal-streaming-english",
7375
speakerLabels: true,
7476
});
7577
onOpen = jest.fn();
@@ -81,12 +83,13 @@ describe("streaming", () => {
8183
await cleanup();
8284
WS.clean();
8385

84-
const wsUrl = `${websocketBaseUrl}?token=123&sample_rate=16000&speaker_labels=true&max_speakers=4`;
86+
const wsUrl = `${websocketBaseUrl}?token=123&sample_rate=16000&speech_model=universal-streaming-english&speaker_labels=true&max_speakers=4`;
8587
server = new WS(wsUrl);
8688
rt = new StreamingTranscriber({
8789
websocketBaseUrl,
8890
token: "123",
8991
sampleRate: 16_000,
92+
speechModel: "universal-streaming-english",
9093
speakerLabels: true,
9194
maxSpeakers: 4,
9295
});
@@ -105,7 +108,7 @@ describe("streaming", () => {
105108
websocketBaseUrl,
106109
token: "123",
107110
sampleRate: 16_000,
108-
speechModel: "whisper-rt",
111+
speechModel: "whisper-rt" as const,
109112
});
110113
onOpen = jest.fn();
111114
rt.on("open", onOpen);

0 commit comments

Comments
 (0)