Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "assemblyai",
"version": "4.25.1",
"version": "4.26.0",
"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"
Expand Down
12 changes: 5 additions & 7 deletions src/services/streaming/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,12 @@ export class StreamingTranscriber {
);
}

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

if (this.params.languageDetection !== undefined) {
searchParams.set(
Expand Down
2 changes: 1 addition & 1 deletion src/types/streaming/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type StreamingTranscriberParams = {
keyterms?: string[];
keytermsPrompt?: string[];
prompt?: string;
speechModel?: StreamingSpeechModel;
speechModel: StreamingSpeechModel;
languageDetection?: boolean;
inactivityTimeout?: number;
speakerLabels?: boolean;
Expand Down
9 changes: 6 additions & 3 deletions tests/unit/streaming.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe("streaming", () => {
websocketBaseUrl: websocketBaseUrl,
apiKey: "123",
sampleRate: 16_000,
speechModel: "universal-streaming-english",
});
onOpen = jest.fn();
rt.on("open", onOpen);
Expand All @@ -64,12 +65,13 @@ describe("streaming", () => {
await cleanup();
WS.clean();

const wsUrl = `${websocketBaseUrl}?token=123&sample_rate=16000&speaker_labels=true`;
const wsUrl = `${websocketBaseUrl}?token=123&sample_rate=16000&speech_model=universal-streaming-english&speaker_labels=true`;
server = new WS(wsUrl);
rt = new StreamingTranscriber({
websocketBaseUrl,
token: "123",
sampleRate: 16_000,
speechModel: "universal-streaming-english",
speakerLabels: true,
});
onOpen = jest.fn();
Expand All @@ -81,12 +83,13 @@ describe("streaming", () => {
await cleanup();
WS.clean();

const wsUrl = `${websocketBaseUrl}?token=123&sample_rate=16000&speaker_labels=true&max_speakers=4`;
const wsUrl = `${websocketBaseUrl}?token=123&sample_rate=16000&speech_model=universal-streaming-english&speaker_labels=true&max_speakers=4`;
server = new WS(wsUrl);
rt = new StreamingTranscriber({
websocketBaseUrl,
token: "123",
sampleRate: 16_000,
speechModel: "universal-streaming-english",
speakerLabels: true,
maxSpeakers: 4,
});
Expand All @@ -105,7 +108,7 @@ describe("streaming", () => {
websocketBaseUrl,
token: "123",
sampleRate: 16_000,
speechModel: "whisper-rt",
speechModel: "whisper-rt" as const,
});
onOpen = jest.fn();
rt.on("open", onOpen);
Expand Down