Skip to content

Commit

Permalink
Merge pull request #101 from deepgram/ner-tag-parity
Browse files Browse the repository at this point in the history
added tag to transcription endpoints. Added Delete endpoint to projects
  • Loading branch information
briancbarrow authored Jan 23, 2023
2 parents 3c617e1 + 3450cf1 commit 5aa33c8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/httpRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ export function _request<T>(
}

if (dgRes.statusCode && dgRes.statusCode >= 400) {
reject(`DG: ${dgResponse.error}: ${dgResponse.reason}`);
if (dgResponse.error) {
reject(`DG: ${dgResponse.error}: ${dgResponse.reason}`);
} else {
reject(`DG: ${dgResponse.err_msg}`);
}
}

if (dgResponse.error) {
Expand Down
14 changes: 14 additions & 0 deletions src/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,18 @@ export class Projects {
JSON.stringify(payload)
);
}

/**
* Delete a specific project
* @param project project to delete
* */
async delete(projectId: string): Promise<void> {
return this._request(
"DELETE",
this._credentials,
this._apiUrl,
this._requireSSL,
`${this.apiPath}/${projectId}`
);
}
}
5 changes: 5 additions & 0 deletions src/types/createKeyOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ export type CreateKeyOptions = {
* Length of time (in seconds) during which the key you would like to create will remain valid.
*/
timeToLive?: number;

/**
* Tags associated with the key you would like to create
* */
tags?: string[];
};
7 changes: 7 additions & 0 deletions src/types/liveTranscriptionOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,11 @@ export type LiveTranscriptionOptions = {
* tracking numbers, and more.
* */
smart_format?: boolean;

/**
* allows you to label your API requests for the purpose of identification during usage reporting.
* You can also apply tags to API Keys; if you do, any tags applied to the API Key running the API request
* will also be applied to the request itself.
* */
tag?: Array<string>;
};
9 changes: 8 additions & 1 deletion src/types/prerecordedTranscriptionOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export type PrerecordedTranscriptionOptions = {

/**
* Indicates whether Deepgram will Identify and detect entities in the transcript
* This is a beta feature and is is subject to change. Right now, pass in the string "latest" instead of a boolean value
*/
detect_entities?: boolean;

Expand Down Expand Up @@ -251,11 +252,17 @@ export type PrerecordedTranscriptionOptions = {
* */
measurements?: boolean;


/**
* Indicates whether to use Smart Format on the transcript. When enabled,
* Smart Format will add punctuation and formatting to entities like dates, times,
* tracking numbers, and more.
* */
smart_format?: boolean;

/**
* allows you to label your API requests for the purpose of identification during usage reporting.
* You can also apply tags to API Keys; if you do, any tags applied to the API Key running the API request
* will also be applied to the request itself.
* */
tag?: Array<string>;
};

0 comments on commit 5aa33c8

Please sign in to comment.