Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 866aa163adf6fabda92141265e759d297f3bded3
  • Loading branch information
AssemblyAI authored and Swimburger committed Apr 17, 2024
1 parent 651cdb7 commit bc35dec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -23,7 +29,7 @@
- `SpeechModel.Best` enum
- `TranscriptListItem.error` property

### Updated
### Changed

- Make `PageDetails.prev_url` nullable
- Rename Realtime to Streaming inside code documentation
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.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"
Expand Down
11 changes: 3 additions & 8 deletions src/services/realtime/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions src/types/realtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
} & (
Expand Down Expand Up @@ -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;
} & (
Expand Down

0 comments on commit bc35dec

Please sign in to comment.