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
7 changes: 6 additions & 1 deletion src/types/alternatives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ParagraphGroup } from "./paragraphGroup";
import { WordBase } from "./wordBase";
import { Entity } from "./entity";
import { Summary } from "./summary";
import { Translation } from "./translation"
import { TopicGroup } from "./topicGroup";

export type Alternative = {
Expand Down Expand Up @@ -34,7 +35,11 @@ export type Alternative = {
*/
detected_language?: string;
/**
* Array of topic group objects.
* Array of language objects for each language the response has been translated into
*/
translations?: Array<Translation>;
/**
* Array of topic group objects.
*/
topics?: Array<TopicGroup>;
};
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export * from "./summary";
export * from "./topic";
export * from "./topicGroup";
export * from "./transcriptionSource";
export * from "./translation";
export * from "./usageCallback";
export * from "./usageField";
export * from "./usageFieldOptions";
Expand Down
20 changes: 19 additions & 1 deletion src/types/prerecordedTranscriptionOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,19 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/language
*/
language?: string;

/**
* Indicates whether to add punctuation and capitalization to the transcript.
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/punctuate
*/
punctuate?: boolean;

/**
* Indicates whether to remove profanity from the transcript.
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/profanity_filter
*/
profanity_filter?: boolean;

/**
* Indicates whether to redact sensitive information, replacing redacted content with asterisks (*).
* @remarks Options include:
Expand Down Expand Up @@ -89,12 +92,14 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/multichannel
*/
multichannel?: boolean;

/**
* Maximum number of transcript alternatives to return. Just like a human listener,
* Deepgram can provide multiple possible interpretations of what it hears.
* @default 1
*/
alternatives?: number;

/**
* Indicates whether to convert numbers from written format (e.g., one) to
* numerical format (e.g., 1). Deepgram can format numbers up to 999,999.
Expand All @@ -103,13 +108,15 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/numerals
*/
numerals?: boolean;

/**
* Terms or phrases to search for in the submitted audio. Deepgram searches
* for acoustic patterns in audio rather than text patterns in transcripts
* because we have noticed that acoustic pattern matching is more performant.
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/search
*/
search?: Array<string>;

/**
* Callback URL to provide if you would like your submitted audio to be
* processed asynchronously. When passed, Deepgram will immediately respond
Expand All @@ -120,6 +127,7 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/callback
*/
callback?: string;

/**
* Keywords to which the model should pay particular attention to boosting
* or suppressing to help it understand context. Just like a human listener,
Expand All @@ -128,6 +136,7 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/keywords
*/
keywords?: Array<string>;

/**
* Indicates whether Deepgram will segment speech into meaningful semantic
* units, which allows the model to interact more naturally and effectively
Expand All @@ -143,6 +152,7 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/utterances
*/
utterances?: boolean;

/**
* Length of time in seconds of silence between words that Deepgram will
* use when determining where to split utterances. Used when utterances
Expand All @@ -151,8 +161,9 @@ export type PrerecordedTranscriptionOptions = {
* @see https://developers.deepgram.com/api-reference/speech-recognition-api#operation/transcribeAudio/properties/utt_split
*/
utt_split?: number;

/**
* Detects the language of the reocrded audio and passes audio through appropriate model
* Detects the language of the recorded audio and passes audio through appropriate model
*
*
* @see https://developers.deepgram.com/api-reference/#detect-language-pr
Expand All @@ -175,6 +186,13 @@ export type PrerecordedTranscriptionOptions = {
* Indicates whether Deepgram should provide summarizations of sections of the provided audio.
*/
summarize?: boolean;

/**
* Corresponds to the language code Deepgram will translate the results into
* For example, 'es', 'fr', 'ja'
* If requests translation in the same language as their ASR request, a 400 will be returned.
*/
translation?: Array<string>;

/**
* Indicates whether Deepgram will identify and detect topics in the transcript.
Expand Down
10 changes: 10 additions & 0 deletions src/types/translation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export type Translation = {
/**
* Language code of the translation.
*/
language: string;
/**
* Translated transcript.
*/
translation: string;
};
1 change: 1 addition & 0 deletions src/types/usageOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type UsageOptions = {
redact?: boolean;
alternatives?: boolean;
numerals?: boolean;
translation?:boolean;
detect_entities?: boolean;
detect_topics?: boolean;
summarize?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/types/usageRequestDetail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type UsageRequestDetail = {
redact?: boolean;
alternatives?: boolean;
numerals?: boolean;
translation?:boolean;
};
};
};