Skip to content

Commit

Permalink
Merge pull request #60 from deepgram/language-detection
Browse files Browse the repository at this point in the history
added detect language option to preRecordedOptions
  • Loading branch information
briancbarrow authored Sep 20, 2022
2 parents 7d11819 + 7cc2fa1 commit b753263
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deepgram/sdk",
"version": "1.7.0",
"version": "1.8.0",
"description": "An SDK for the Deepgram automated speech recognition platform",
"types": "dist/index.d.ts",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/types/alternatives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ export type Alternative = {
* Array of paragraph objects.
*/
paragraphs?: Array<ParagraphGroup>;
/**
* String indicating the detected language. eg: 'en'
*/
detected_language?: string;
};
7 changes: 7 additions & 0 deletions src/types/prerecordedTranscriptionOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ 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
*
*
* @see https://developers.deepgram.com/api-reference/#detect-language-pr
*/
detect_language?: boolean;

/**
* Indicates whether Deepgram will split audio into paragraphs to improve transcript
Expand Down
8 changes: 4 additions & 4 deletions src/usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class Usage {
options?: UsageRequestListOptions
): Promise<UsageRequestList> {
const requestOptions = { ...{}, ...options };
return this._request(
return await this._request(
"GET",
this._credentials,
this._apiUrl,
Expand All @@ -49,7 +49,7 @@ export class Usage {
projectId: string,
requestId: string
): Promise<UsageRequest> {
return this._request(
return await this._request(
"GET",
this._credentials,
this._apiUrl,
Expand All @@ -68,7 +68,7 @@ export class Usage {
options?: UsageOptions
): Promise<UsageResponse> {
const requestOptions = { ...{}, ...options };
return this._request(
return await this._request(
"GET",
this._credentials,
this._apiUrl,
Expand All @@ -89,7 +89,7 @@ export class Usage {
options?: UsageFieldOptions
): Promise<UsageField> {
const requestOptions = { ...{}, ...options };
return this._request(
return await this._request(
"GET",
this._credentials,
this._apiUrl,
Expand Down

0 comments on commit b753263

Please sign in to comment.