Skip to content

Commit faf6df2

Browse files
committed
Added updates to diarize option, updated transcription response to include speaker_confidence
1 parent b4f0f61 commit faf6df2

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/types/liveTranscriptionOptions.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@ export type LiveTranscriptionOptions = {
6262
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/redact
6363
*/
6464
redact?: Array<string>;
65+
6566
/**
66-
* Indicates whether to recognize speaker changes. When set to true, each word
67+
* Indicates whether to recognize speaker changes. When passed in, each word
6768
* in the transcript will be assigned a speaker number starting at 0.
69+
* Allowed values are either "latest" or "VERSION" where VERSION is the specified version of the diarizer.
70+
* If 'true' is passed, it will be assumed to be the old version of the diarizer, and 'speaker_confidence' will not be returned in the response.
6871
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/diarize
6972
*/
70-
diarize?: boolean;
73+
diarize?: string | boolean;
74+
7175
/**
7276
* Indicates whether to transcribe each audio channel independently. When set
7377
* to true, you will receive one transcript for each channel, which means you

src/types/prerecordedTranscriptionOptions.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,16 @@ export type PrerecordedTranscriptionOptions = {
6262
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/redact
6363
*/
6464
redact?: Array<string>;
65+
6566
/**
66-
* Indicates whether to recognize speaker changes. When set to true, each word
67+
* Indicates whether to recognize speaker changes. When passed in, each word
6768
* in the transcript will be assigned a speaker number starting at 0.
69+
* Allowed values are either "latest" or "VERSION" where VERSION is the specified version of the diarizer.
70+
* If 'true' is passed, it will be assumed to be the old version of the diarizer, and 'speaker_confidence' will not be returned in the response.
6871
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/diarize
6972
*/
70-
diarize?: boolean;
73+
diarize?: string | boolean;
74+
7175
/**
7276
* Indicates whether to transcribe each audio channel independently. When set
7377
* to true, you will receive one transcript for each channel, which means you

src/types/wordBase.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ export type WordBase = {
55
confidence: number;
66
punctuated_word?: string;
77
speaker?: number;
8+
// speaker_confidence will only be included if 'diarize=latest' or 'diarize=VERSION' is passed in the request
9+
speaker_confidence?: number;
810
};

0 commit comments

Comments
 (0)