@deepgram/sdk 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +251 -361
  2. package/dist/billing.d.ts +4 -4
  3. package/dist/helpers/secondsToTimestamp.d.ts +1 -1
  4. package/dist/httpRequest.d.ts +1 -0
  5. package/dist/index.js +1 -1
  6. package/dist/invitation.d.ts +5 -5
  7. package/dist/keys.d.ts +3 -3
  8. package/dist/members.d.ts +5 -5
  9. package/dist/projects.d.ts +8 -8
  10. package/dist/scopes.d.ts +5 -5
  11. package/dist/transcription/index.d.ts +5 -5
  12. package/dist/transcription/preRecordedTranscription.d.ts +1 -1
  13. package/dist/types/alternatives.d.ts +1 -1
  14. package/dist/types/balance.d.ts +3 -1
  15. package/dist/types/balanceList.d.ts +3 -1
  16. package/dist/types/channel.d.ts +1 -1
  17. package/dist/types/createKeyOptions.d.ts +1 -1
  18. package/dist/types/entity.d.ts +1 -1
  19. package/dist/types/error.d.ts +1 -1
  20. package/dist/types/hit.d.ts +1 -1
  21. package/dist/types/invitationList.d.ts +3 -1
  22. package/dist/types/invitationOptions.d.ts +1 -1
  23. package/dist/types/key.d.ts +3 -1
  24. package/dist/types/keyResponse.d.ts +3 -1
  25. package/dist/types/keyResponseObj.d.ts +1 -1
  26. package/dist/types/keyword.d.ts +1 -1
  27. package/dist/types/liveTranscriptionOptions.d.ts +1 -1
  28. package/dist/types/liveTranscriptionResponse.d.ts +1 -1
  29. package/dist/types/member.d.ts +1 -1
  30. package/dist/types/memberList.d.ts +3 -1
  31. package/dist/types/message.d.ts +3 -1
  32. package/dist/types/metadata.d.ts +9 -1
  33. package/dist/types/paragraph.d.ts +1 -1
  34. package/dist/types/paragraphGroup.d.ts +1 -1
  35. package/dist/types/prerecordedTranscriptionOptions.d.ts +2 -2
  36. package/dist/types/prerecordedTranscriptionResponse.d.ts +13 -10
  37. package/dist/types/project.d.ts +3 -1
  38. package/dist/types/projectPatchRequest.d.ts +1 -1
  39. package/dist/types/projectPatchResponse.d.ts +3 -1
  40. package/dist/types/projectResponse.d.ts +3 -1
  41. package/dist/types/requestFunction.d.ts +4 -3
  42. package/dist/types/scopeList.d.ts +3 -1
  43. package/dist/types/search.d.ts +1 -1
  44. package/dist/types/sentence.d.ts +1 -1
  45. package/dist/types/summary.d.ts +1 -1
  46. package/dist/types/toggleConfigOptions.d.ts +1 -1
  47. package/dist/types/topic.d.ts +1 -1
  48. package/dist/types/topicGroup.d.ts +1 -1
  49. package/dist/types/transcriptionSource.d.ts +5 -4
  50. package/dist/types/translation.d.ts +1 -1
  51. package/dist/types/usageCallback.d.ts +1 -1
  52. package/dist/types/usageField.d.ts +3 -1
  53. package/dist/types/usageFieldOptions.d.ts +1 -1
  54. package/dist/types/usageOptions.d.ts +2 -2
  55. package/dist/types/usageRequest.d.ts +3 -1
  56. package/dist/types/usageRequestDetail.d.ts +1 -1
  57. package/dist/types/usageRequestList.d.ts +3 -1
  58. package/dist/types/usageRequestListOptions.d.ts +1 -1
  59. package/dist/types/usageRequestMessage.d.ts +1 -1
  60. package/dist/types/usageResponse.d.ts +3 -1
  61. package/dist/types/usageResponseDetail.d.ts +1 -1
  62. package/dist/types/utterance.d.ts +1 -1
  63. package/dist/types/wordBase.d.ts +1 -1
  64. package/dist/usage.d.ts +7 -7
  65. package/package.json +3 -2
@@ -9,32 +9,32 @@ export declare class Projects {
9
9
  * Returns all projects accessible by the API key.
10
10
  * @param {string} endpoint Custom API endpoint
11
11
  *
12
- * @returns {Promise<ProjectResponse | ErrorResponse>}
12
+ * @returns {Promise<ProjectResponse>}
13
13
  */
14
- list(endpoint?: string): Promise<ProjectResponse | ErrorResponse>;
14
+ list(endpoint?: string): Promise<ProjectResponse>;
15
15
  /**
16
16
  * Retrieves a specific project based on the provided project_id.
17
17
  * @param {string} projectId Unique identifier of the project
18
18
  * @param {string} endpoint Custom API endpoint
19
19
  *
20
- * @returns {Promise<Project | ErrorResponse>}
20
+ * @returns {Promise<Project>}
21
21
  */
22
- get(projectId: string, endpoint?: string): Promise<Project | ErrorResponse>;
22
+ get(projectId: string, endpoint?: string): Promise<Project>;
23
23
  /**
24
24
  * Update a project.
25
- * @param {Project} project Project to update
25
+ * @param {string | Project} project Project to update
26
26
  * @param {ProjectPatchRequest} payload Details to change as an object
27
27
  * @param {string} endpoint Custom API endpoint
28
28
  *
29
- * @returns {Promise<ProjectPatchResponse | ErrorResponse>}
29
+ * @returns {Promise<ProjectPatchResponse>}
30
30
  */
31
- update(project: Project, payload: ProjectPatchRequest, endpoint?: string): Promise<ProjectPatchResponse | ErrorResponse>;
31
+ update(project: string | Project, payload: ProjectPatchRequest, endpoint?: string): Promise<ProjectPatchResponse>;
32
32
  /**
33
33
  * Delete a project.
34
34
  * @param {string} projectId Unique identifier of the project
35
35
  * @param {string} endpoint Custom API endpoint
36
36
  *
37
- * @returns {Promise<Message | ErrorResponse>}
37
+ * @returns {Promise<void | ErrorResponse>}
38
38
  */
39
39
  delete(projectId: string, endpoint?: string): Promise<void | ErrorResponse>;
40
40
  }
package/dist/scopes.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ScopeList, Message, RequestFunction, ErrorResponse } from "./types";
1
+ import { ScopeList, Message, RequestFunction } from "./types";
2
2
  export declare class Scopes {
3
3
  private _credentials;
4
4
  private _apiUrl;
@@ -11,9 +11,9 @@ export declare class Scopes {
11
11
  * @param {string} memberId Unique identifier of the member
12
12
  * @param {string} endpoint Custom API endpoint
13
13
  *
14
- * @returns {Promise<ScopeList | ErrorResponse>}
14
+ * @returns {Promise<ScopeList>}
15
15
  */
16
- get(projectId: string, memberId: string, endpoint?: string): Promise<ScopeList | ErrorResponse>;
16
+ get(projectId: string, memberId: string, endpoint?: string): Promise<ScopeList>;
17
17
  /**
18
18
  * Updates the scope for the specified member in the specified project.
19
19
  * @param {string} projectId Unique identifier of the project
@@ -21,7 +21,7 @@ export declare class Scopes {
21
21
  * @param {string} scope Scope to update the member to
22
22
  * @param {string} endpoint Custom API endpoint
23
23
  *
24
- * @returns {Promise<Message | ErrorResponse>}
24
+ * @returns {Promise<Message>}
25
25
  */
26
- update(projectID: string, memberId: string, scope: string, endpoint?: string): Promise<Message | ErrorResponse>;
26
+ update(projectID: string, memberId: string, scope: string, endpoint?: string): Promise<Message>;
27
27
  }
@@ -1,4 +1,4 @@
1
- import { LiveTranscriptionOptions, PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, TranscriptionSource, ErrorResponse } from "../types";
1
+ import { LiveTranscriptionOptions, PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, TranscriptionSource } from "../types";
2
2
  import { LiveTranscription } from "./liveTranscription";
3
3
  export declare class Transcriber {
4
4
  private _credentials;
@@ -11,15 +11,15 @@ export declare class Transcriber {
11
11
  * @param {PrerecordedTranscriptionOptions} options Options used to toggle transcription features
12
12
  * @param {string} endpoint Custom API endpoint
13
13
  *
14
- * @returns {Promise<PrerecordedTranscriptionResponse | ErrorResponse>}
14
+ * @returns {Promise<PrerecordedTranscriptionResponse>}
15
15
  */
16
- preRecorded(source: TranscriptionSource, options?: PrerecordedTranscriptionOptions, endpoint?: string): Promise<PrerecordedTranscriptionResponse | ErrorResponse>;
16
+ preRecorded(source: TranscriptionSource, options?: PrerecordedTranscriptionOptions, endpoint?: string): Promise<PrerecordedTranscriptionResponse>;
17
17
  /**
18
18
  * Opens a websocket to Deepgram's API for live transcriptions
19
19
  * @param {LiveTranscriptionOptions} options Options used to toggle transcription features
20
20
  * @param {string} endpoint Custom API endpoint
21
21
  *
22
- * @returns {LiveTranscription | ErrorResponse}
22
+ * @returns {LiveTranscription}
23
23
  */
24
- live(options?: LiveTranscriptionOptions, endpoint?: string): LiveTranscription | ErrorResponse;
24
+ live(options?: LiveTranscriptionOptions, endpoint?: string): LiveTranscription;
25
25
  }
@@ -10,4 +10,4 @@ import { PrerecordedTranscriptionOptions, PrerecordedTranscriptionResponse, Tran
10
10
  * @param options string
11
11
  * @returns Promise<PrerecordedTranscriptionResponse>
12
12
  */
13
- export declare const preRecordedTranscription: (apiKey: string, apiUrl: string, requireSSL: boolean, source: TranscriptionSource, options?: PrerecordedTranscriptionOptions | undefined, endpoint?: string) => Promise<PrerecordedTranscriptionResponse>;
13
+ export declare const preRecordedTranscription: (apiKey: string, apiUrl: string, requireSSL: boolean, source: TranscriptionSource, options?: PrerecordedTranscriptionOptions, endpoint?: string) => Promise<PrerecordedTranscriptionResponse>;
@@ -4,7 +4,7 @@ import { Entity } from "./entity";
4
4
  import { Summary } from "./summary";
5
5
  import { Translation } from "./translation";
6
6
  import { TopicGroup } from "./topicGroup";
7
- export declare type Alternative = {
7
+ export type Alternative = {
8
8
  /**
9
9
  * Text of speech identified by API
10
10
  */
@@ -1,6 +1,8 @@
1
- export declare type Balance = {
1
+ export type Balance = {
2
2
  balance_id: string;
3
3
  amount: number;
4
4
  units: string;
5
5
  purchase: string;
6
+ err_code?: string;
7
+ err_msg?: string;
6
8
  };
@@ -1,4 +1,6 @@
1
1
  import { Balance } from "./balance";
2
- export declare type BalanceList = {
2
+ export type BalanceList = {
3
3
  balances?: Array<Balance>;
4
+ err_code?: string;
5
+ err_msg?: string;
4
6
  };
@@ -3,7 +3,7 @@ import { Search } from "./search";
3
3
  /**
4
4
  * Channel of speech identified by Deepgram
5
5
  */
6
- export declare type Channel = {
6
+ export type Channel = {
7
7
  /**
8
8
  * Searched terms & results
9
9
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Optional options used when creating an API key
3
3
  */
4
- export declare type CreateKeyOptions = {
4
+ export type CreateKeyOptions = {
5
5
  /**
6
6
  * Date on which the key you would like to create should expire.
7
7
  */
@@ -1,4 +1,4 @@
1
- export declare type Entity = {
1
+ export type Entity = {
2
2
  /**
3
3
  * This is the type of the entity.
4
4
  * Examples include: PER, ORG, DATE, etc.
@@ -1,4 +1,4 @@
1
- export declare type ErrorResponse = {
1
+ export type ErrorResponse = {
2
2
  err_code: string;
3
3
  err_msg: string;
4
4
  request_id: string;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Represents an identified search term in the transcript
3
3
  */
4
- export declare type Hit = {
4
+ export type Hit = {
5
5
  /**
6
6
  * Value between 0 and 1 that indicates the model's relative confidence in this hit.
7
7
  */
@@ -1,4 +1,6 @@
1
1
  import { InvitationOptions } from "./invitationOptions";
2
- export declare type InvitationList = {
2
+ export type InvitationList = {
3
3
  invites?: Array<InvitationOptions>;
4
+ err_code?: string;
5
+ err_msg?: string;
4
6
  };
@@ -1,4 +1,4 @@
1
- export declare type InvitationOptions = {
1
+ export type InvitationOptions = {
2
2
  email?: string;
3
3
  scope?: string;
4
4
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * API key used for authenticating with the Deepgram API
3
3
  */
4
- export declare type Key = {
4
+ export type Key = {
5
5
  /**
6
6
  * Unique identifier of the key to use in API requests
7
7
  */
@@ -22,4 +22,6 @@ export declare type Key = {
22
22
  * Array of scopes assigned to the key
23
23
  */
24
24
  scopes: Array<string>;
25
+ err_code?: string;
26
+ err_msg?: string;
25
27
  };
@@ -2,9 +2,11 @@ import { KeyResponseObj } from "./keyResponseObj";
2
2
  /**
3
3
  * Response from the Deepgram API to list keys
4
4
  */
5
- export declare type KeyResponse = {
5
+ export type KeyResponse = {
6
6
  /**
7
7
  * Array of API keys associated with the project
8
8
  */
9
9
  api_keys: Array<KeyResponseObj>;
10
+ err_code?: string;
11
+ err_msg?: string;
10
12
  };
@@ -1,6 +1,6 @@
1
1
  import { Key } from "./key";
2
2
  import { Member } from "./member";
3
- export declare type KeyResponseObj = {
3
+ export type KeyResponseObj = {
4
4
  /**
5
5
  * Optional member associated with the API key
6
6
  */
@@ -1,4 +1,4 @@
1
- export declare type Keyword = {
1
+ export type Keyword = {
2
2
  keyword: string;
3
3
  boost?: number;
4
4
  };
@@ -2,7 +2,7 @@ import { Models } from "../enums";
2
2
  /**
3
3
  * Options for transcription
4
4
  */
5
- export declare type LiveTranscriptionOptions = {
5
+ export type LiveTranscriptionOptions = {
6
6
  /**
7
7
  * AI model used to process submitted audio.
8
8
  * @default general
@@ -1,5 +1,5 @@
1
1
  import { Channel } from "./channel";
2
- export declare type LiveTranscriptionResponse = {
2
+ export type LiveTranscriptionResponse = {
3
3
  channel_index: Array<number>;
4
4
  duration: number;
5
5
  start: number;
@@ -1,4 +1,4 @@
1
- export declare type Member = {
1
+ export type Member = {
2
2
  member_id: string;
3
3
  first_name?: string;
4
4
  last_name?: string;
@@ -1,4 +1,6 @@
1
1
  import { Member } from "./member";
2
- export declare type MemberList = {
2
+ export type MemberList = {
3
3
  members?: Array<Member>;
4
+ err_code?: string;
5
+ err_msg?: string;
4
6
  };
@@ -1,3 +1,5 @@
1
- export declare type Message = {
1
+ export type Message = {
2
2
  message?: string;
3
+ err_code?: string;
4
+ err_msg?: string;
3
5
  };
@@ -1,8 +1,16 @@
1
- export declare type Metadata = {
1
+ export type Metadata = {
2
2
  request_id: string;
3
3
  transaction_key: string;
4
4
  sha256: string;
5
5
  created: string;
6
6
  duration: number;
7
7
  channels: number;
8
+ model_info: {
9
+ [key: string]: {
10
+ name: string;
11
+ version: string;
12
+ arch: string;
13
+ };
14
+ };
15
+ models: Array<string>;
8
16
  };
@@ -1,5 +1,5 @@
1
1
  import { Sentence } from "./sentence";
2
- export declare type Paragraph = {
2
+ export type Paragraph = {
3
3
  /**
4
4
  * Sentences within the paragraph.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { Paragraph } from "./paragraph";
2
- export declare type ParagraphGroup = {
2
+ export type ParagraphGroup = {
3
3
  /**
4
4
  * Full transcript
5
5
  */
@@ -2,7 +2,7 @@ import { Models } from "../enums";
2
2
  /**
3
3
  * Options for transcription
4
4
  */
5
- export declare type PrerecordedTranscriptionOptions = {
5
+ export type PrerecordedTranscriptionOptions = {
6
6
  /**
7
7
  * AI model used to process submitted audio.
8
8
  * @default general
@@ -178,7 +178,7 @@ export declare type PrerecordedTranscriptionOptions = {
178
178
  /**
179
179
  * Indicates whether Deepgram should provide summarizations of sections of the provided audio.
180
180
  */
181
- summarize?: boolean;
181
+ summarize?: boolean | string;
182
182
  /**
183
183
  * Corresponds to the language code Deepgram will translate the results into
184
184
  * For example, 'es', 'fr', 'ja'
@@ -2,24 +2,27 @@ import { Metadata } from "./metadata";
2
2
  import { Channel } from "./channel";
3
3
  import { Utterance } from "./utterance";
4
4
  export declare class PrerecordedTranscriptionResponse {
5
+ err_code?: string;
6
+ err_msg?: string;
5
7
  request_id?: string;
6
8
  metadata?: Metadata;
7
9
  results?: {
8
10
  channels: Array<Channel>;
9
11
  utterances?: Array<Utterance>;
12
+ summary?: {
13
+ short: string;
14
+ };
10
15
  };
11
16
  /**
12
- * Converts the transcription to the WebVTT format
13
- * @remarks In order to translate the transcription to WebVTT, the utterances
14
- * feature must be used.
15
- * @returns A string with the transcription in the WebVTT format
17
+ * Returns a VTT formatted string based on the transcription response.
18
+ * @param {number} lineLength The maximum line length. Default: 8
19
+ * @returns {string}
16
20
  */
17
- toWebVTT(): string;
21
+ toWebVTT(lineLength?: number): string;
18
22
  /**
19
- * Converts the transcription to the SRT format
20
- * @remarks In order to translate the transcription to SRT, the utterances
21
- * feature must be used.
22
- * @returns A string with the transcription in the SRT format
23
+ * Returns a SRT formatted string based on the transcription response.
24
+ * @param {number} lineLength The maximum line length. Default: 8
25
+ * @returns {string}
23
26
  */
24
- toSRT(): string;
27
+ toSRT(lineLength?: number): string;
25
28
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Deepgram project
3
3
  */
4
- export declare type Project = {
4
+ export type Project = {
5
5
  /**
6
6
  * Unique identifier of the project
7
7
  */
@@ -14,4 +14,6 @@ export declare type Project = {
14
14
  * Name of the company associated with the project. Optional.
15
15
  */
16
16
  company?: string;
17
+ err_code?: string;
18
+ err_msg?: string;
17
19
  };
@@ -1,4 +1,4 @@
1
- export declare type ProjectPatchRequest = {
1
+ export type ProjectPatchRequest = {
2
2
  name?: string;
3
3
  company?: string;
4
4
  };
@@ -1,6 +1,8 @@
1
- export declare type ProjectPatchResponse = {
1
+ export type ProjectPatchResponse = {
2
2
  /**
3
3
  * Success message.
4
4
  */
5
5
  message: string;
6
+ err_code?: string;
7
+ err_msg?: string;
6
8
  };
@@ -1,4 +1,6 @@
1
1
  import { Project } from "./project";
2
- export declare type ProjectResponse = {
2
+ export type ProjectResponse = {
3
3
  projects: Array<Project>;
4
+ err_code?: string;
5
+ err_msg?: string;
4
6
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { ReadStream } from "fs";
3
- export declare type RequestFunction = NodeRequest | BrowserRequest;
4
- export declare type NodeRequest = (method: string, apiKey: string, apiUrl: string, requireSSL: boolean, path: string, payload?: string | Buffer | ReadStream, options?: Object) => Promise<any>;
5
- export declare type BrowserRequest = (method: string, apiKey: string, apiUrl: string, requireSSL: boolean, path: string, payload?: string) => Promise<any>;
4
+ export type RequestFunction = NodeRequest | BrowserRequest;
5
+ export type NodeRequest = (method: string, apiKey: string, apiUrl: string, requireSSL: boolean, path: string, payload?: string | Buffer | ReadStream, options?: Object) => Promise<any>;
6
+ export type BrowserRequest = (method: string, apiKey: string, apiUrl: string, requireSSL: boolean, path: string, payload?: string) => Promise<any>;
@@ -1,3 +1,5 @@
1
- export declare type ScopeList = {
1
+ export type ScopeList = {
2
2
  scopes: Array<string>;
3
+ err_code?: string;
4
+ err_msg?: string;
3
5
  };
@@ -2,7 +2,7 @@ import { Hit } from "./hit";
2
2
  /**
3
3
  * Search result for a transcription
4
4
  */
5
- export declare type Search = {
5
+ export type Search = {
6
6
  /**
7
7
  * Term for which Deepgram is searching.
8
8
  */
@@ -1,4 +1,4 @@
1
- export declare type Sentence = {
1
+ export type Sentence = {
2
2
  /**
3
3
  * Text transcript of the sentence.
4
4
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Summary of a section of audio provided.
3
3
  */
4
- export declare type Summary = {
4
+ export type Summary = {
5
5
  /**
6
6
  * Summary of a section of the transcript
7
7
  */
@@ -1,3 +1,3 @@
1
- export declare type ToggleConfigOptions = {
1
+ export type ToggleConfigOptions = {
2
2
  numerals: boolean;
3
3
  };
@@ -1,4 +1,4 @@
1
- export declare type Topic = {
1
+ export type Topic = {
2
2
  /**
3
3
  * Topic detected.
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { Topic } from "./topic";
2
- export declare type TopicGroup = {
2
+ export type TopicGroup = {
3
3
  /**
4
4
  * Array of Topics identified.
5
5
  */
@@ -1,14 +1,15 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { Readable } from "stream";
3
- export declare type TranscriptionSource = UrlSource | BufferSource | ReadStreamSource;
4
- export declare type ReadStreamSource = {
4
+ export type TranscriptionSource = UrlSource | BufferSource | ReadStreamSource;
5
+ export type ReadStreamSource = {
5
6
  stream: Readable;
6
7
  mimetype: string;
7
8
  };
8
- export declare type UrlSource = {
9
+ export type UrlSource = {
9
10
  url: string;
10
11
  };
11
- export declare type BufferSource = {
12
+ export type BufferSource = {
12
13
  buffer: Buffer;
13
14
  mimetype: string;
14
15
  };
@@ -1,4 +1,4 @@
1
- export declare type Translation = {
1
+ export type Translation = {
2
2
  /**
3
3
  * Language code of the translation.
4
4
  */
@@ -1,4 +1,4 @@
1
- export declare type UsageCallback = {
1
+ export type UsageCallback = {
2
2
  code: number;
3
3
  completed: string;
4
4
  };
@@ -1,7 +1,9 @@
1
- export declare type UsageField = {
1
+ export type UsageField = {
2
2
  tags: Array<string>;
3
3
  models: Array<string>;
4
4
  processing_methods: Array<string>;
5
5
  languages: Array<string>;
6
6
  features: Array<string>;
7
+ err_code?: string;
8
+ err_msg?: string;
7
9
  };
@@ -1,4 +1,4 @@
1
- export declare type UsageFieldOptions = {
1
+ export type UsageFieldOptions = {
2
2
  start?: string;
3
3
  end?: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- export declare type UsageOptions = {
1
+ export type UsageOptions = {
2
2
  start?: string;
3
3
  end?: string;
4
4
  accessor?: string;
@@ -24,7 +24,7 @@ export declare type UsageOptions = {
24
24
  translate?: boolean;
25
25
  detect_entities?: boolean;
26
26
  detect_topics?: boolean;
27
- summarize?: boolean;
27
+ summarize?: boolean | string;
28
28
  paragraphs?: boolean;
29
29
  utt_split?: boolean;
30
30
  analyze_sentiment?: boolean;
@@ -1,11 +1,13 @@
1
1
  import { UsageCallback } from "./usageCallback";
2
2
  import { UsageRequestDetail } from "./usageRequestDetail";
3
3
  import { UsageRequestMessage } from "./usageRequestMessage";
4
- export declare type UsageRequest = {
4
+ export type UsageRequest = {
5
5
  request_id: string;
6
6
  created: string;
7
7
  path: string;
8
8
  accessor: string;
9
9
  response?: UsageRequestDetail | UsageRequestMessage;
10
10
  callback?: UsageCallback;
11
+ err_code?: string;
12
+ err_msg?: string;
11
13
  };
@@ -1,4 +1,4 @@
1
- export declare type UsageRequestDetail = {
1
+ export type UsageRequestDetail = {
2
2
  details: {
3
3
  usd: number;
4
4
  duration: number;
@@ -1,6 +1,8 @@
1
1
  import { UsageRequest } from "./usageRequest";
2
- export declare type UsageRequestList = {
2
+ export type UsageRequestList = {
3
3
  page: number;
4
4
  limit: number;
5
5
  requests?: Array<UsageRequest>;
6
+ err_code?: string;
7
+ err_msg?: string;
6
8
  };
@@ -1,4 +1,4 @@
1
- export declare type UsageRequestListOptions = {
1
+ export type UsageRequestListOptions = {
2
2
  start?: string;
3
3
  end?: string;
4
4
  page?: number;
@@ -1,3 +1,3 @@
1
- export declare type UsageRequestMessage = {
1
+ export type UsageRequestMessage = {
2
2
  message?: string;
3
3
  };
@@ -1,5 +1,5 @@
1
1
  import { UsageResponseDetail } from "./usageResponseDetail";
2
- export declare type UsageResponse = {
2
+ export type UsageResponse = {
3
3
  start: string;
4
4
  end: string;
5
5
  resolution: {
@@ -7,4 +7,6 @@ export declare type UsageResponse = {
7
7
  amount: number;
8
8
  };
9
9
  results: Array<UsageResponseDetail>;
10
+ err_code?: string;
11
+ err_msg?: string;
10
12
  };
@@ -1,4 +1,4 @@
1
- export declare type UsageResponseDetail = {
1
+ export type UsageResponseDetail = {
2
2
  start: string;
3
3
  end: string;
4
4
  hours: number;
@@ -1,5 +1,5 @@
1
1
  import { WordBase } from "./wordBase";
2
- export declare type Utterance = {
2
+ export type Utterance = {
3
3
  /**
4
4
  * Start time (in seconds) from the beginning of the audio stream.
5
5
  */