diff --git a/CHANGELOG.md b/CHANGELOG.md index e4ffbff..9a1dd9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [4.4.1] - 2024-04-16 + +### Changed + +- Deprecate `enableExtraSessionInformation` parameter in `CreateRealtimeTranscriberParams` type + ## [4.4.0] - 2024-04-12 ### Added @@ -8,7 +14,7 @@ - Add `enableExtraSessionInformation` parameter to `CreateRealtimeTranscriberParams` - Add `session_information` event to `RealtimeTranscriber.on()` -### Updated +### Changed - ⚠️ Deprecate `conformer-2` literal for `TranscriptParams.speech_model` property @@ -23,7 +29,7 @@ - `SpeechModel.Best` enum - `TranscriptListItem.error` property -### Updated +### Changed - Make `PageDetails.prev_url` nullable - Rename Realtime to Streaming inside code documentation diff --git a/package.json b/package.json index f43501a..d1820b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "assemblyai", - "version": "4.4.0", + "version": "4.4.1", "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/realtime/service.ts b/src/services/realtime/service.ts index 79d05e2..9227aa5 100644 --- a/src/services/realtime/service.ts +++ b/src/services/realtime/service.ts @@ -50,7 +50,6 @@ export class RealtimeTranscriber { private apiKey?: string; private token?: string; private endUtteranceSilenceThreshold?: number; - private enableExtraSessionInformation?: boolean; private disablePartialTranscripts?: boolean; private socket?: WebSocket; @@ -63,7 +62,6 @@ export class RealtimeTranscriber { this.wordBoost = params.wordBoost; this.encoding = params.encoding; this.endUtteranceSilenceThreshold = params.endUtteranceSilenceThreshold; - this.enableExtraSessionInformation = params.enableExtraSessionInformation; this.disablePartialTranscripts = params.disablePartialTranscripts; if ("token" in params && params.token) this.token = params.token; if ("apiKey" in params && params.apiKey) this.apiKey = params.apiKey; @@ -91,12 +89,9 @@ export class RealtimeTranscriber { if (this.encoding) { searchParams.set("encoding", this.encoding); } - if (this.enableExtraSessionInformation) { - searchParams.set( - "enable_extra_session_information", - this.enableExtraSessionInformation.toString(), - ); - } + + searchParams.set("enable_extra_session_information", "true"); + if (this.disablePartialTranscripts) { searchParams.set( "disable_partial_transcripts", diff --git a/src/types/realtime/index.ts b/src/types/realtime/index.ts index 5999aee..42505a1 100644 --- a/src/types/realtime/index.ts +++ b/src/types/realtime/index.ts @@ -37,7 +37,8 @@ type CreateRealtimeTranscriberParams = { /** * Enable extra session information. * Set to `true` to receive the `session_information` message before the session ends. Defaults to `false`. - * @defaultValue false + * @defaultValue true + * @deprecated This parameter is now ignored and will be removed. Session information will always be sent. */ enableExtraSessionInformation?: boolean; } & ( @@ -91,7 +92,8 @@ type RealtimeTranscriberParams = { /** * Enable extra session information. * Set to `true` to receive the `session_information` message before the session ends. Defaults to `false`. - * @defaultValue false + * @defaultValue true + * @deprecated This parameter is now ignored and will be removed. Session information will always be sent. */ enableExtraSessionInformation?: boolean; } & (