Skip to content

Commit 7c41660

Browse files
authored
fix: Multiple post-release bug fixes (#217)
* fix: remove unnecessary complexity from close event (#214) * fix: add missing type to channel interface (#215) * fix: mistyped definition for alternative confidence on live event (#216)
1 parent 2734f69 commit 7c41660

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

src/lib/types/LiveTranscriptionEvent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface LiveTranscriptionEvent {
88
channel: {
99
alternatives: {
1010
transcript: string;
11-
confidence: boolean;
11+
confidence: number;
1212
words: {
1313
word: string;
1414
start: number;

src/lib/types/SyncPrerecordedResponse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ interface Channel {
1818
search?: Search[];
1919
alternatives: Alternative[];
2020
detected_language?: string;
21+
language_confidence?: number;
2122
}
2223

2324
interface Entity {

src/packages/LiveClient.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ export class LiveClient extends AbstractWsClient {
3535
};
3636

3737
this._socket.onclose = (event: any) => {
38-
/**
39-
* changing the event.target to any to access the private _req
40-
* property that isn't available on the WebSocket.CloseEvent type
41-
**/
42-
const newTarget: any = event.target;
43-
44-
if (newTarget["_req"]) {
45-
const dgErrorIndex = newTarget["_req"].res.rawHeaders.indexOf("dg-error");
46-
event.reason = newTarget["_req"].res.rawHeaders[dgErrorIndex + 1];
47-
}
48-
4938
this.emit(LiveTranscriptionEvents.Close, event);
5039
};
5140

0 commit comments

Comments
 (0)