spitch 1.48.0 → 1.49.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.
@@ -7,8 +7,7 @@ import { RequestOptions } from "../internal/request-options.mjs";
7
7
  */
8
8
  export declare class Speech extends APIResource {
9
9
  /**
10
- * Convert text to speech. Select a voice and use that to generate audio in any
11
- * format. Audio is retured in chunks.
10
+ * Generate audio
12
11
  */
13
12
  generate(body: SpeechGenerateParams, options?: RequestOptions): APIPromise<Response>;
14
13
  /**
@@ -42,39 +41,55 @@ export interface Transcription {
42
41
  /**
43
42
  * for audit purposes.
44
43
  */
45
- request_id: string;
46
- text: string;
47
- /**
48
- * sentence-level or word-level groupings of your transcript. Each sentence (or
49
- * word) will fall within a time range.
50
- */
51
- segments?: Array<Segment> | null;
44
+ request_id?: string;
52
45
  /**
53
- * @deprecated sentence-level or word-level groupings of your transcript. Each
46
+ * Either `sentence-level` or `word-level` groupings of your transcript. Each
54
47
  * sentence (or word) will fall within a time range.
55
48
  */
56
- timestamps?: Array<Segment> | null;
49
+ segments?: Array<Segment> | null;
50
+ text?: string;
57
51
  }
58
52
  export interface SpeechGenerateParams {
59
- language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
53
+ /**
54
+ * The text for which you want to generate audio.
55
+ */
60
56
  text: string;
61
- voice: 'sade' | 'segun' | 'femi' | 'funmi' | 'amina' | 'aliyu' | 'hasan' | 'zainab' | 'john' | 'jude' | 'lina' | 'lucy' | 'henry' | 'kani' | 'ngozi' | 'amara' | 'obinna' | 'ebuka' | 'hana' | 'selam' | 'tena' | 'tesfaye';
62
57
  /**
63
- * the audio format for the returned audio bytes.
58
+ * The voice you want to be used for audio generation.
59
+ */
60
+ voice: 'sade' | 'segun' | 'femi' | 'funmi' | 'amina' | 'aliyu' | 'hasan' | 'zainab' | 'john' | 'jude' | 'lina' | 'lucy' | 'henry' | 'kani' | 'remi' | 'kingsley' | 'ngozi' | 'amara' | 'obinna' | 'ebuka' | 'hana' | 'haile' | 'tena' | 'tesfaye' | 'ufoma' | 'tega' | 'justice' | 'boma';
61
+ /**
62
+ * The audio format for the returned audio data, defaults to `wav`.
64
63
  */
65
64
  format?: 'mp3' | 'wav' | 'ogg_opus' | 'webm_opus' | 'mulaw' | 'alaw' | 'flac' | 'pcm_s16le';
66
- model?: string | null;
65
+ /**
66
+ * This is optional; an ISO 639 language code to be used for the generation.
67
+ */
68
+ language?: string;
69
+ /**
70
+ * The speed of the voice, defaults to `1.0`
71
+ */
72
+ speed?: number;
67
73
  }
68
74
  export interface SpeechTranscribeParams {
69
- language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
70
- content?: Uploadable | string | null;
71
- model?: 'mansa_v1' | 'legacy' | null;
72
- special_words?: string | null;
73
- timestamp?: 'sentence' | 'word' | 'none' | null;
74
75
  /**
75
- * @deprecated
76
+ * The audio file or content that you want to transcribe. This could be;
77
+ * `file bytes`, a `url to an audio file` (ensure the link does not require
78
+ * authentication to access the file) or a `file UUID`.
79
+ */
80
+ content: Uploadable | string;
81
+ /**
82
+ * This is optional, an ISO-639 language code that corresponds to the language in
83
+ * the `content`.
84
+ */
85
+ language?: string | null;
86
+ /**
87
+ * @deprecated Select the model to be used to perform the transcription, this param
88
+ * has been deprecated.
76
89
  */
77
- url?: string | null;
90
+ model?: 'mansa_v1' | 'legacy' | null;
91
+ special_words?: string | null;
92
+ timestamp?: 'sentence' | 'word' | null;
78
93
  }
79
94
  export declare namespace Speech {
80
95
  export { type Segment as Segment, type Transcription as Transcription, type SpeechGenerateParams as SpeechGenerateParams, type SpeechTranscribeParams as SpeechTranscribeParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"speech.d.mts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OAEnB,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qB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AAG,MAAM,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -7,8 +7,7 @@ import { RequestOptions } from "../internal/request-options.js";
7
7
  */
8
8
  export declare class Speech extends APIResource {
9
9
  /**
10
- * Convert text to speech. Select a voice and use that to generate audio in any
11
- * format. Audio is retured in chunks.
10
+ * Generate audio
12
11
  */
13
12
  generate(body: SpeechGenerateParams, options?: RequestOptions): APIPromise<Response>;
14
13
  /**
@@ -42,39 +41,55 @@ export interface Transcription {
42
41
  /**
43
42
  * for audit purposes.
44
43
  */
45
- request_id: string;
46
- text: string;
47
- /**
48
- * sentence-level or word-level groupings of your transcript. Each sentence (or
49
- * word) will fall within a time range.
50
- */
51
- segments?: Array<Segment> | null;
44
+ request_id?: string;
52
45
  /**
53
- * @deprecated sentence-level or word-level groupings of your transcript. Each
46
+ * Either `sentence-level` or `word-level` groupings of your transcript. Each
54
47
  * sentence (or word) will fall within a time range.
55
48
  */
56
- timestamps?: Array<Segment> | null;
49
+ segments?: Array<Segment> | null;
50
+ text?: string;
57
51
  }
58
52
  export interface SpeechGenerateParams {
59
- language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
53
+ /**
54
+ * The text for which you want to generate audio.
55
+ */
60
56
  text: string;
61
- voice: 'sade' | 'segun' | 'femi' | 'funmi' | 'amina' | 'aliyu' | 'hasan' | 'zainab' | 'john' | 'jude' | 'lina' | 'lucy' | 'henry' | 'kani' | 'ngozi' | 'amara' | 'obinna' | 'ebuka' | 'hana' | 'selam' | 'tena' | 'tesfaye';
62
57
  /**
63
- * the audio format for the returned audio bytes.
58
+ * The voice you want to be used for audio generation.
59
+ */
60
+ voice: 'sade' | 'segun' | 'femi' | 'funmi' | 'amina' | 'aliyu' | 'hasan' | 'zainab' | 'john' | 'jude' | 'lina' | 'lucy' | 'henry' | 'kani' | 'remi' | 'kingsley' | 'ngozi' | 'amara' | 'obinna' | 'ebuka' | 'hana' | 'haile' | 'tena' | 'tesfaye' | 'ufoma' | 'tega' | 'justice' | 'boma';
61
+ /**
62
+ * The audio format for the returned audio data, defaults to `wav`.
64
63
  */
65
64
  format?: 'mp3' | 'wav' | 'ogg_opus' | 'webm_opus' | 'mulaw' | 'alaw' | 'flac' | 'pcm_s16le';
66
- model?: string | null;
65
+ /**
66
+ * This is optional; an ISO 639 language code to be used for the generation.
67
+ */
68
+ language?: string;
69
+ /**
70
+ * The speed of the voice, defaults to `1.0`
71
+ */
72
+ speed?: number;
67
73
  }
68
74
  export interface SpeechTranscribeParams {
69
- language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
70
- content?: Uploadable | string | null;
71
- model?: 'mansa_v1' | 'legacy' | null;
72
- special_words?: string | null;
73
- timestamp?: 'sentence' | 'word' | 'none' | null;
74
75
  /**
75
- * @deprecated
76
+ * The audio file or content that you want to transcribe. This could be;
77
+ * `file bytes`, a `url to an audio file` (ensure the link does not require
78
+ * authentication to access the file) or a `file UUID`.
79
+ */
80
+ content: Uploadable | string;
81
+ /**
82
+ * This is optional, an ISO-639 language code that corresponds to the language in
83
+ * the `content`.
84
+ */
85
+ language?: string | null;
86
+ /**
87
+ * @deprecated Select the model to be used to perform the transcription, this param
88
+ * has been deprecated.
76
89
  */
77
- url?: string | null;
90
+ model?: 'mansa_v1' | 'legacy' | null;
91
+ special_words?: string | null;
92
+ timestamp?: 'sentence' | 'word' | null;
78
93
  }
79
94
  export declare namespace Speech {
80
95
  export { type Segment as Segment, type Transcription as Transcription, type SpeechGenerateParams as SpeechGenerateParams, type SpeechTranscribeParams as SpeechTranscribeParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],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CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,IAAI,CAAC;IAErC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,SAAS,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -10,8 +10,7 @@ const uploads_1 = require("../internal/uploads.js");
10
10
  */
11
11
  class Speech extends resource_1.APIResource {
12
12
  /**
13
- * Convert text to speech. Select a voice and use that to generate audio in any
14
- * format. Audio is retured in chunks.
13
+ * Generate audio
15
14
  */
16
15
  generate(body, options) {
17
16
  return this._client.post('/v1/speech', {
@@ -1 +1 @@
1
- {"version":3,"file":"speech.js","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAAkE;AAElE;;GAEG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC;;;OAGG;IACH,QAAQ,CAAC,IAA0B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;YACrC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAClE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,IAA4B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,oBAAoB,EACpB,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;CACF;AAxBD,wBAwBC"}
1
+ {"version":3,"file":"speech.js","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAAmD;AAEnD,oDAAkE;AAElE;;GAEG;AACH,MAAa,MAAO,SAAQ,sBAAW;IACrC;;OAEG;IACH,QAAQ,CAAC,IAA0B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;YACrC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YAClE,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,UAAU,CAAC,IAA4B,EAAE,OAAwB;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,oBAAoB,EACpB,IAAA,qCAA2B,EAAC,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;CACF;AAvBD,wBAuBC"}
@@ -7,8 +7,7 @@ import { multipartFormRequestOptions } from "../internal/uploads.mjs";
7
7
  */
8
8
  export class Speech extends APIResource {
9
9
  /**
10
- * Convert text to speech. Select a voice and use that to generate audio in any
11
- * format. Audio is retured in chunks.
10
+ * Generate audio
12
11
  */
13
12
  generate(body, options) {
14
13
  return this._client.post('/v1/speech', {
@@ -1 +1 @@
1
- {"version":3,"file":"speech.mjs","sourceRoot":"","sources":["../src/resources/speech.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,YAAY,EAAE;OAEhB,EAAE,2BAA2B,EAAE;AAEtC;;GAEG;AACH,MAAM,O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,IAAI,CAAC,OAAO,CAAC,CAChE,CAAC;IACJ,CAAC;CACF"}
@@ -3,7 +3,7 @@ import { APIPromise } from "../core/api-promise.mjs";
3
3
  import { RequestOptions } from "../internal/request-options.mjs";
4
4
  export declare class Text extends APIResource {
5
5
  /**
6
- * Add appopriate tone marks to text.
6
+ * Add appropriate tone marks to text.
7
7
  */
8
8
  toneMark(body: TextToneMarkParams, options?: RequestOptions): APIPromise<Diacritics>;
9
9
  /**
@@ -21,13 +21,33 @@ export interface Translation {
21
21
  text: string;
22
22
  }
23
23
  export interface TextToneMarkParams {
24
- language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
24
+ /**
25
+ * Only Yoruba is supported at the moment.
26
+ */
27
+ language: string;
25
28
  text: string;
26
29
  }
27
30
  export interface TextTranslateParams {
28
- source: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
29
- target: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
31
+ /**
32
+ * An ISO 639 code of the language you want to translate to.
33
+ */
34
+ target: string;
35
+ /**
36
+ * The text to be translated.
37
+ */
30
38
  text: string;
39
+ /**
40
+ * Whether to be `formal` or `casual`.
41
+ */
42
+ formality?: 'casual' | 'formal';
43
+ /**
44
+ * An ISO 639 code of the language you're translating from
45
+ */
46
+ source?: string | null;
47
+ /**
48
+ * The tone of the translated text.
49
+ */
50
+ tone?: 'neutral' | 'warm' | 'professional' | 'narration';
31
51
  }
32
52
  export declare namespace Text {
33
53
  export { type Diacritics as Diacritics, type Translation as Translation, type TextToneMarkParams as TextToneMarkParams, type TextTranslateParams as TextTranslateParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.mts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE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AAU,CAAC,UAAU,CAAC;IAIpF;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;CAGxF;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAEhC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,CAAC;CAC1D;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -3,7 +3,7 @@ import { APIPromise } from "../core/api-promise.js";
3
3
  import { RequestOptions } from "../internal/request-options.js";
4
4
  export declare class Text extends APIResource {
5
5
  /**
6
- * Add appopriate tone marks to text.
6
+ * Add appropriate tone marks to text.
7
7
  */
8
8
  toneMark(body: TextToneMarkParams, options?: RequestOptions): APIPromise<Diacritics>;
9
9
  /**
@@ -21,13 +21,33 @@ export interface Translation {
21
21
  text: string;
22
22
  }
23
23
  export interface TextToneMarkParams {
24
- language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
24
+ /**
25
+ * Only Yoruba is supported at the moment.
26
+ */
27
+ language: string;
25
28
  text: string;
26
29
  }
27
30
  export interface TextTranslateParams {
28
- source: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
29
- target: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
31
+ /**
32
+ * An ISO 639 code of the language you want to translate to.
33
+ */
34
+ target: string;
35
+ /**
36
+ * The text to be translated.
37
+ */
30
38
  text: string;
39
+ /**
40
+ * Whether to be `formal` or `casual`.
41
+ */
42
+ formality?: 'casual' | 'formal';
43
+ /**
44
+ * An ISO 639 code of the language you're translating from
45
+ */
46
+ source?: string | null;
47
+ /**
48
+ * The tone of the translated text.
49
+ */
50
+ tone?: 'neutral' | 'warm' | 'professional' | 'narration';
31
51
  }
32
52
  export declare namespace Text {
33
53
  export { type Diacritics as Diacritics, type Translation as Translation, type TextToneMarkParams as TextToneMarkParams, type TextTranslateParams as TextTranslateParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../src/resources/text.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,IAAK,SAAQ,WAAW;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAIpF;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC;CAGxF;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;I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AAW,kBAAkB;IACjC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAEhC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,CAAC;CAC1D;AAED,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
package/resources/text.js CHANGED
@@ -5,7 +5,7 @@ exports.Text = void 0;
5
5
  const resource_1 = require("../core/resource.js");
6
6
  class Text extends resource_1.APIResource {
7
7
  /**
8
- * Add appopriate tone marks to text.
8
+ * Add appropriate tone marks to text.
9
9
  */
10
10
  toneMark(body, options) {
11
11
  return this._client.post('/v1/diacritics', { body, ...options });
@@ -2,7 +2,7 @@
2
2
  import { APIResource } from "../core/resource.mjs";
3
3
  export class Text extends APIResource {
4
4
  /**
5
- * Add appopriate tone marks to text.
5
+ * Add appropriate tone marks to text.
6
6
  */
7
7
  toneMark(body, options) {
8
8
  return this._client.post('/v1/diacritics', { body, ...options });
package/src/client.ts CHANGED
@@ -152,7 +152,7 @@ export class Spitch {
152
152
  *
153
153
  * @param {string | undefined} [opts.apiKey=process.env['SPITCH_API_KEY'] ?? undefined]
154
154
  * @param {boolean | null | undefined} [opts.dataRetention=true]
155
- * @param {string} [opts.baseURL=process.env['SPITCH_BASE_URL'] ?? https://api.spi-tch.com] - Override the default base URL for the API.
155
+ * @param {string} [opts.baseURL=process.env['SPITCH_BASE_URL'] ?? https://api.spitch.app] - Override the default base URL for the API.
156
156
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
157
157
  * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
158
158
  * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -176,7 +176,7 @@ export class Spitch {
176
176
  apiKey,
177
177
  dataRetention,
178
178
  ...opts,
179
- baseURL: baseURL || `https://api.spi-tch.com`,
179
+ baseURL: baseURL || `https://api.spitch.app`,
180
180
  };
181
181
 
182
182
  this.baseURL = options.baseURL!;
@@ -194,6 +194,18 @@ export class Spitch {
194
194
  this.fetch = options.fetch ?? Shims.getDefaultFetch();
195
195
  this.#encoder = Opts.FallbackEncoder;
196
196
 
197
+ const customHeadersEnv = readEnv('SPITCH_CUSTOM_HEADERS');
198
+ if (customHeadersEnv) {
199
+ const parsed: Record<string, string> = {};
200
+ for (const line of customHeadersEnv.split('\n')) {
201
+ const colon = line.indexOf(':');
202
+ if (colon >= 0) {
203
+ parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim();
204
+ }
205
+ }
206
+ options.defaultHeaders = { ...parsed, ...options.defaultHeaders };
207
+ }
208
+
197
209
  this._options = options;
198
210
 
199
211
  this.apiKey = apiKey;
@@ -224,7 +236,7 @@ export class Spitch {
224
236
  * Check whether the base URL is set to its default.
225
237
  */
226
238
  #baseURLOverridden(): boolean {
227
- return this.baseURL !== 'https://api.spi-tch.com';
239
+ return this.baseURL !== 'https://api.spitch.app';
228
240
  }
229
241
 
230
242
  protected defaultQuery(): Record<string, string | undefined> | undefined {
@@ -40,7 +40,6 @@ type OverloadedParameters<T> =
40
40
  : T extends (...args: infer A) => unknown ? A
41
41
  : never;
42
42
 
43
- /* eslint-disable */
44
43
  /**
45
44
  * These imports attempt to get types from a parent package's dependencies.
46
45
  * Unresolved bare specifiers can trigger [automatic type acquisition][1] in some projects, which
@@ -63,19 +62,18 @@ type OverloadedParameters<T> =
63
62
  *
64
63
  * [1]: https://www.typescriptlang.org/tsconfig/#typeAcquisition
65
64
  */
66
- /** @ts-ignore For users with \@types/node */
65
+ /** @ts-ignore For users with \@types/node */ /* prettier-ignore */
67
66
  type UndiciTypesRequestInit = NotAny<import('../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici-types/index.d.ts').RequestInit>;
68
- /** @ts-ignore For users with undici */
67
+ /** @ts-ignore For users with undici */ /* prettier-ignore */
69
68
  type UndiciRequestInit = NotAny<import('../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/undici/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/undici/index.d.ts').RequestInit>;
70
- /** @ts-ignore For users with \@types/bun */
69
+ /** @ts-ignore For users with \@types/bun */ /* prettier-ignore */
71
70
  type BunRequestInit = globalThis.FetchRequestInit;
72
- /** @ts-ignore For users with node-fetch@2 */
71
+ /** @ts-ignore For users with node-fetch@2 */ /* prettier-ignore */
73
72
  type NodeFetch2RequestInit = NotAny<import('../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/@types/node-fetch/index.d.ts').RequestInit>;
74
- /** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */
73
+ /** @ts-ignore For users with node-fetch@3, doesn't need file extension because types are at ./@types/index.d.ts */ /* prettier-ignore */
75
74
  type NodeFetch3RequestInit = NotAny<import('../node_modules/node-fetch').RequestInit> | NotAny<import('../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../node_modules/node-fetch').RequestInit> | NotAny<import('../../../../../../../../../../node_modules/node-fetch').RequestInit>;
76
- /** @ts-ignore For users who use Deno */
75
+ /** @ts-ignore For users who use Deno */ /* prettier-ignore */
77
76
  type FetchRequestInit = NonNullable<OverloadedParameters<typeof fetch>[1]>;
78
- /* eslint-enable */
79
77
 
80
78
  type RequestInits =
81
79
  | NotAny<UndiciTypesRequestInit>
@@ -12,8 +12,7 @@ import { multipartFormRequestOptions } from '../internal/uploads';
12
12
  */
13
13
  export class Speech extends APIResource {
14
14
  /**
15
- * Convert text to speech. Select a voice and use that to generate audio in any
16
- * format. Audio is retured in chunks.
15
+ * Generate audio
17
16
  */
18
17
  generate(body: SpeechGenerateParams, options?: RequestOptions): APIPromise<Response> {
19
18
  return this._client.post('/v1/speech', {
@@ -64,28 +63,26 @@ export interface Transcription {
64
63
  /**
65
64
  * for audit purposes.
66
65
  */
67
- request_id: string;
68
-
69
- text: string;
66
+ request_id?: string;
70
67
 
71
68
  /**
72
- * sentence-level or word-level groupings of your transcript. Each sentence (or
73
- * word) will fall within a time range.
69
+ * Either `sentence-level` or `word-level` groupings of your transcript. Each
70
+ * sentence (or word) will fall within a time range.
74
71
  */
75
72
  segments?: Array<Segment> | null;
76
73
 
77
- /**
78
- * @deprecated sentence-level or word-level groupings of your transcript. Each
79
- * sentence (or word) will fall within a time range.
80
- */
81
- timestamps?: Array<Segment> | null;
74
+ text?: string;
82
75
  }
83
76
 
84
77
  export interface SpeechGenerateParams {
85
- language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
86
-
78
+ /**
79
+ * The text for which you want to generate audio.
80
+ */
87
81
  text: string;
88
82
 
83
+ /**
84
+ * The voice you want to be used for audio generation.
85
+ */
89
86
  voice:
90
87
  | 'sade'
91
88
  | 'segun'
@@ -101,38 +98,60 @@ export interface SpeechGenerateParams {
101
98
  | 'lucy'
102
99
  | 'henry'
103
100
  | 'kani'
101
+ | 'remi'
102
+ | 'kingsley'
104
103
  | 'ngozi'
105
104
  | 'amara'
106
105
  | 'obinna'
107
106
  | 'ebuka'
108
107
  | 'hana'
109
- | 'selam'
108
+ | 'haile'
110
109
  | 'tena'
111
- | 'tesfaye';
110
+ | 'tesfaye'
111
+ | 'ufoma'
112
+ | 'tega'
113
+ | 'justice'
114
+ | 'boma';
112
115
 
113
116
  /**
114
- * the audio format for the returned audio bytes.
117
+ * The audio format for the returned audio data, defaults to `wav`.
115
118
  */
116
119
  format?: 'mp3' | 'wav' | 'ogg_opus' | 'webm_opus' | 'mulaw' | 'alaw' | 'flac' | 'pcm_s16le';
117
120
 
118
- model?: string | null;
121
+ /**
122
+ * This is optional; an ISO 639 language code to be used for the generation.
123
+ */
124
+ language?: string;
125
+
126
+ /**
127
+ * The speed of the voice, defaults to `1.0`
128
+ */
129
+ speed?: number;
119
130
  }
120
131
 
121
132
  export interface SpeechTranscribeParams {
122
- language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
133
+ /**
134
+ * The audio file or content that you want to transcribe. This could be;
135
+ * `file bytes`, a `url to an audio file` (ensure the link does not require
136
+ * authentication to access the file) or a `file UUID`.
137
+ */
138
+ content: Uploadable | string;
123
139
 
124
- content?: Uploadable | string | null;
140
+ /**
141
+ * This is optional, an ISO-639 language code that corresponds to the language in
142
+ * the `content`.
143
+ */
144
+ language?: string | null;
125
145
 
146
+ /**
147
+ * @deprecated Select the model to be used to perform the transcription, this param
148
+ * has been deprecated.
149
+ */
126
150
  model?: 'mansa_v1' | 'legacy' | null;
127
151
 
128
152
  special_words?: string | null;
129
153
 
130
- timestamp?: 'sentence' | 'word' | 'none' | null;
131
-
132
- /**
133
- * @deprecated
134
- */
135
- url?: string | null;
154
+ timestamp?: 'sentence' | 'word' | null;
136
155
  }
137
156
 
138
157
  export declare namespace Speech {
@@ -6,7 +6,7 @@ import { RequestOptions } from '../internal/request-options';
6
6
 
7
7
  export class Text extends APIResource {
8
8
  /**
9
- * Add appopriate tone marks to text.
9
+ * Add appropriate tone marks to text.
10
10
  */
11
11
  toneMark(body: TextToneMarkParams, options?: RequestOptions): APIPromise<Diacritics> {
12
12
  return this._client.post('/v1/diacritics', { body, ...options });
@@ -34,17 +34,39 @@ export interface Translation {
34
34
  }
35
35
 
36
36
  export interface TextToneMarkParams {
37
- language: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
37
+ /**
38
+ * Only Yoruba is supported at the moment.
39
+ */
40
+ language: string;
38
41
 
39
42
  text: string;
40
43
  }
41
44
 
42
45
  export interface TextTranslateParams {
43
- source: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
44
-
45
- target: 'yo' | 'en' | 'ha' | 'ig' | 'am' | 'pcm';
46
+ /**
47
+ * An ISO 639 code of the language you want to translate to.
48
+ */
49
+ target: string;
46
50
 
51
+ /**
52
+ * The text to be translated.
53
+ */
47
54
  text: string;
55
+
56
+ /**
57
+ * Whether to be `formal` or `casual`.
58
+ */
59
+ formality?: 'casual' | 'formal';
60
+
61
+ /**
62
+ * An ISO 639 code of the language you're translating from
63
+ */
64
+ source?: string | null;
65
+
66
+ /**
67
+ * The tone of the translated text.
68
+ */
69
+ tone?: 'neutral' | 'warm' | 'professional' | 'narration';
48
70
  }
49
71
 
50
72
  export declare namespace Text {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.48.0'; // x-release-please-version
1
+ export const VERSION = '1.49.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.48.0";
1
+ export declare const VERSION = "1.49.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.48.0";
1
+ export declare const VERSION = "1.49.0";
2
2
  //# sourceMappingURL=version.d.ts.map