@cartesia/cartesia-js 3.0.0-b3 → 3.0.0-b4
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.
- package/CHANGELOG.md +9 -0
- package/README.md +21 -21
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/access-token.d.mts +5 -0
- package/resources/access-token.d.mts.map +1 -1
- package/resources/access-token.d.ts +5 -0
- package/resources/access-token.d.ts.map +1 -1
- package/resources/agents/agents.js +1 -1
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs +1 -1
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/metrics/index.d.mts +1 -1
- package/resources/agents/metrics/index.d.mts.map +1 -1
- package/resources/agents/metrics/index.d.ts +1 -1
- package/resources/agents/metrics/index.d.ts.map +1 -1
- package/resources/agents/metrics/index.js.map +1 -1
- package/resources/agents/metrics/index.mjs.map +1 -1
- package/resources/agents/metrics/metrics.d.mts +2 -2
- package/resources/agents/metrics/metrics.d.mts.map +1 -1
- package/resources/agents/metrics/metrics.d.ts +2 -2
- package/resources/agents/metrics/metrics.d.ts.map +1 -1
- package/resources/agents/metrics/metrics.js.map +1 -1
- package/resources/agents/metrics/metrics.mjs.map +1 -1
- package/resources/agents/metrics/results.d.mts +23 -22
- package/resources/agents/metrics/results.d.mts.map +1 -1
- package/resources/agents/metrics/results.d.ts +23 -22
- package/resources/agents/metrics/results.d.ts.map +1 -1
- package/resources/agents/metrics/results.js +4 -5
- package/resources/agents/metrics/results.js.map +1 -1
- package/resources/agents/metrics/results.mjs +4 -5
- package/resources/agents/metrics/results.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/infill.d.mts +3 -4
- package/resources/infill.d.mts.map +1 -1
- package/resources/infill.d.ts +3 -4
- package/resources/infill.d.ts.map +1 -1
- package/resources/infill.js +0 -2
- package/resources/infill.js.map +1 -1
- package/resources/infill.mjs +0 -2
- package/resources/infill.mjs.map +1 -1
- package/resources/pronunciation-dicts.d.mts +0 -8
- package/resources/pronunciation-dicts.d.mts.map +1 -1
- package/resources/pronunciation-dicts.d.ts +0 -8
- package/resources/pronunciation-dicts.d.ts.map +1 -1
- package/resources/pronunciation-dicts.js +0 -18
- package/resources/pronunciation-dicts.js.map +1 -1
- package/resources/pronunciation-dicts.mjs +0 -18
- package/resources/pronunciation-dicts.mjs.map +1 -1
- package/resources/stt.d.mts +1 -104
- package/resources/stt.d.mts.map +1 -1
- package/resources/stt.d.ts +1 -104
- package/resources/stt.d.ts.map +1 -1
- package/resources/tts/tts.d.mts +79 -115
- package/resources/tts/tts.d.mts.map +1 -1
- package/resources/tts/tts.d.ts +79 -115
- package/resources/tts/tts.d.ts.map +1 -1
- package/resources/voice-changer.d.mts +2 -2
- package/resources/voice-changer.d.mts.map +1 -1
- package/resources/voice-changer.d.ts +2 -2
- package/resources/voice-changer.d.ts.map +1 -1
- package/resources/voices.d.mts +70 -34
- package/resources/voices.d.mts.map +1 -1
- package/resources/voices.d.ts +70 -34
- package/resources/voices.d.ts.map +1 -1
- package/resources/voices.js +45 -3
- package/resources/voices.js.map +1 -1
- package/resources/voices.mjs +45 -3
- package/resources/voices.mjs.map +1 -1
- package/src/client.ts +2 -0
- package/src/resources/access-token.ts +6 -0
- package/src/resources/agents/agents.ts +1 -1
- package/src/resources/agents/metrics/index.ts +1 -0
- package/src/resources/agents/metrics/metrics.ts +2 -0
- package/src/resources/agents/metrics/results.ts +27 -23
- package/src/resources/index.ts +1 -0
- package/src/resources/infill.ts +3 -4
- package/src/resources/pronunciation-dicts.ts +0 -20
- package/src/resources/stt.ts +102 -104
- package/src/resources/tts/tts.ts +146 -128
- package/src/resources/voice-changer.ts +2 -2
- package/src/resources/voices.ts +105 -38
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/voices.ts
CHANGED
|
@@ -14,6 +14,14 @@ export class Voices extends APIResource {
|
|
|
14
14
|
* Update the name, description, and gender of a voice. To set the gender back to
|
|
15
15
|
* the default, set the gender to `null`. If gender is not specified, the gender
|
|
16
16
|
* will not be updated.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const voice = await client.voices.update('id', {
|
|
21
|
+
* description: 'description',
|
|
22
|
+
* name: 'name',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
17
25
|
*/
|
|
18
26
|
update(id: string, body: VoiceUpdateParams, options?: RequestOptions): APIPromise<Voice> {
|
|
19
27
|
return this._client.patch(path`/voices/${id}`, { body, ...options });
|
|
@@ -21,16 +29,29 @@ export class Voices extends APIResource {
|
|
|
21
29
|
|
|
22
30
|
/**
|
|
23
31
|
* List Voices
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Automatically fetches more pages as needed.
|
|
36
|
+
* for await (const voice of client.voices.list()) {
|
|
37
|
+
* // ...
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
24
40
|
*/
|
|
25
41
|
list(
|
|
26
42
|
query: VoiceListParams | null | undefined = {},
|
|
27
43
|
options?: RequestOptions,
|
|
28
44
|
): PagePromise<VoicesCursorIDPage, Voice> {
|
|
29
|
-
return this._client.getAPIList('/voices
|
|
45
|
+
return this._client.getAPIList('/voices', CursorIDPage<Voice>, { query, ...options });
|
|
30
46
|
}
|
|
31
47
|
|
|
32
48
|
/**
|
|
33
49
|
* Delete Voice
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* await client.voices.delete('id');
|
|
54
|
+
* ```
|
|
34
55
|
*/
|
|
35
56
|
delete(id: string, options?: RequestOptions): APIPromise<void> {
|
|
36
57
|
return this._client.delete(path`/voices/${id}`, {
|
|
@@ -43,6 +64,11 @@ export class Voices extends APIResource {
|
|
|
43
64
|
* Clone a high similarity voice from an audio clip. Clones are more similar to the
|
|
44
65
|
* source clip, but may reproduce background noise. For these, use an audio clip
|
|
45
66
|
* about 5 seconds long.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const voiceMetadata = await client.voices.clone();
|
|
71
|
+
* ```
|
|
46
72
|
*/
|
|
47
73
|
clone(body: VoiceCloneParams, options?: RequestOptions): APIPromise<VoiceMetadata> {
|
|
48
74
|
return this._client.post(
|
|
@@ -53,14 +79,34 @@ export class Voices extends APIResource {
|
|
|
53
79
|
|
|
54
80
|
/**
|
|
55
81
|
* Get Voice
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const voice = await client.voices.get('id');
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
get(
|
|
89
|
+
id: string,
|
|
90
|
+
query: VoiceGetParams | null | undefined = {},
|
|
91
|
+
options?: RequestOptions,
|
|
92
|
+
): APIPromise<Voice> {
|
|
93
|
+
return this._client.get(path`/voices/${id}`, { query, ...options });
|
|
59
94
|
}
|
|
60
95
|
|
|
61
96
|
/**
|
|
62
97
|
* Create a new voice from an existing voice localized to a new language and
|
|
63
98
|
* dialect.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* const voiceMetadata = await client.voices.localize({
|
|
103
|
+
* description: 'description',
|
|
104
|
+
* language: 'en',
|
|
105
|
+
* name: 'name',
|
|
106
|
+
* original_speaker_gender: 'male',
|
|
107
|
+
* voice_id: 'voice_id',
|
|
108
|
+
* });
|
|
109
|
+
* ```
|
|
64
110
|
*/
|
|
65
111
|
localize(body: VoiceLocalizeParams, options?: RequestOptions): APIPromise<VoiceMetadata> {
|
|
66
112
|
return this._client.post('/voices/localize', { body, ...options });
|
|
@@ -72,11 +118,8 @@ export type VoicesCursorIDPage = CursorIDPage<Voice>;
|
|
|
72
118
|
export type GenderPresentation = 'masculine' | 'feminine' | 'gender_neutral';
|
|
73
119
|
|
|
74
120
|
/**
|
|
75
|
-
* The language that the given voice should speak the transcript in.
|
|
76
|
-
*
|
|
77
|
-
* Options: English (en), French (fr), German (de), Spanish (es), Portuguese (pt),
|
|
78
|
-
* Chinese (zh), Japanese (ja), Hindi (hi), Italian (it), Korean (ko), Dutch (nl),
|
|
79
|
-
* Polish (pl), Russian (ru), Swedish (sv), Turkish (tr).
|
|
121
|
+
* The language that the given voice should speak the transcript in. For valid
|
|
122
|
+
* options, see [Models](/build-with-cartesia/tts-models).
|
|
80
123
|
*/
|
|
81
124
|
export type SupportedLanguage =
|
|
82
125
|
| 'en'
|
|
@@ -93,7 +136,34 @@ export type SupportedLanguage =
|
|
|
93
136
|
| 'pl'
|
|
94
137
|
| 'ru'
|
|
95
138
|
| 'sv'
|
|
96
|
-
| 'tr'
|
|
139
|
+
| 'tr'
|
|
140
|
+
| 'tl'
|
|
141
|
+
| 'bg'
|
|
142
|
+
| 'ro'
|
|
143
|
+
| 'ar'
|
|
144
|
+
| 'cs'
|
|
145
|
+
| 'el'
|
|
146
|
+
| 'fi'
|
|
147
|
+
| 'hr'
|
|
148
|
+
| 'ms'
|
|
149
|
+
| 'sk'
|
|
150
|
+
| 'da'
|
|
151
|
+
| 'ta'
|
|
152
|
+
| 'uk'
|
|
153
|
+
| 'hu'
|
|
154
|
+
| 'no'
|
|
155
|
+
| 'vi'
|
|
156
|
+
| 'bn'
|
|
157
|
+
| 'th'
|
|
158
|
+
| 'he'
|
|
159
|
+
| 'ka'
|
|
160
|
+
| 'id'
|
|
161
|
+
| 'te'
|
|
162
|
+
| 'gu'
|
|
163
|
+
| 'kn'
|
|
164
|
+
| 'ml'
|
|
165
|
+
| 'mr'
|
|
166
|
+
| 'pa';
|
|
97
167
|
|
|
98
168
|
export interface Voice {
|
|
99
169
|
/**
|
|
@@ -112,7 +182,7 @@ export interface Voice {
|
|
|
112
182
|
description: string;
|
|
113
183
|
|
|
114
184
|
/**
|
|
115
|
-
* Whether
|
|
185
|
+
* Whether your organization owns the voice.
|
|
116
186
|
*/
|
|
117
187
|
is_owner: boolean;
|
|
118
188
|
|
|
@@ -122,11 +192,8 @@ export interface Voice {
|
|
|
122
192
|
is_public: boolean;
|
|
123
193
|
|
|
124
194
|
/**
|
|
125
|
-
* The language that the given voice should speak the transcript in.
|
|
126
|
-
*
|
|
127
|
-
* Options: English (en), French (fr), German (de), Spanish (es), Portuguese (pt),
|
|
128
|
-
* Chinese (zh), Japanese (ja), Hindi (hi), Italian (it), Korean (ko), Dutch (nl),
|
|
129
|
-
* Polish (pl), Russian (ru), Swedish (sv), Turkish (tr).
|
|
195
|
+
* The language that the given voice should speak the transcript in. For valid
|
|
196
|
+
* options, see [Models](/build-with-cartesia/tts-models).
|
|
130
197
|
*/
|
|
131
198
|
language: SupportedLanguage;
|
|
132
199
|
|
|
@@ -141,10 +208,13 @@ export interface Voice {
|
|
|
141
208
|
gender?: GenderPresentation | null;
|
|
142
209
|
|
|
143
210
|
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
211
|
+
* A URL to download a preview audio file for this voice. Useful to avoid consuming
|
|
212
|
+
* credits when looking for the right voice. The URL requires the same
|
|
213
|
+
* Authorization header. Voice previews may be changed, moved, or deleted so you
|
|
214
|
+
* should avoid storing the URL permanently. This property will be null if there's
|
|
215
|
+
* no preview available. Only included when `expand[]` includes `preview_file_url`.
|
|
146
216
|
*/
|
|
147
|
-
|
|
217
|
+
preview_file_url?: string | null;
|
|
148
218
|
}
|
|
149
219
|
|
|
150
220
|
export interface VoiceMetadata {
|
|
@@ -169,11 +239,8 @@ export interface VoiceMetadata {
|
|
|
169
239
|
is_public: boolean;
|
|
170
240
|
|
|
171
241
|
/**
|
|
172
|
-
* The language that the given voice should speak the transcript in.
|
|
173
|
-
*
|
|
174
|
-
* Options: English (en), French (fr), German (de), Spanish (es), Portuguese (pt),
|
|
175
|
-
* Chinese (zh), Japanese (ja), Hindi (hi), Italian (it), Korean (ko), Dutch (nl),
|
|
176
|
-
* Polish (pl), Russian (ru), Swedish (sv), Turkish (tr).
|
|
242
|
+
* The language that the given voice should speak the transcript in. For valid
|
|
243
|
+
* options, see [Models](/build-with-cartesia/tts-models).
|
|
177
244
|
*/
|
|
178
245
|
language: SupportedLanguage;
|
|
179
246
|
|
|
@@ -206,7 +273,7 @@ export interface VoiceListParams extends CursorIDPageParams {
|
|
|
206
273
|
/**
|
|
207
274
|
* Additional fields to include in the response.
|
|
208
275
|
*/
|
|
209
|
-
expand?: Array<'
|
|
276
|
+
expand?: Array<'preview_file_url'> | null;
|
|
210
277
|
|
|
211
278
|
/**
|
|
212
279
|
* The gender presentation of the voices to return.
|
|
@@ -214,21 +281,19 @@ export interface VoiceListParams extends CursorIDPageParams {
|
|
|
214
281
|
gender?: GenderPresentation | null;
|
|
215
282
|
|
|
216
283
|
/**
|
|
217
|
-
* Whether to only return voices owned
|
|
284
|
+
* Whether to only return voices owned your organization.
|
|
218
285
|
*/
|
|
219
286
|
is_owner?: boolean | null;
|
|
220
287
|
|
|
221
288
|
/**
|
|
222
|
-
*
|
|
289
|
+
* The number of Voices to return per page, ranging between 1 and 100.
|
|
223
290
|
*/
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
language?: string;
|
|
291
|
+
limit?: number | null;
|
|
227
292
|
|
|
228
293
|
/**
|
|
229
|
-
*
|
|
294
|
+
* Query string to search for voices by name, description, or Voice ID.
|
|
230
295
|
*/
|
|
231
|
-
|
|
296
|
+
q?: string | null;
|
|
232
297
|
}
|
|
233
298
|
|
|
234
299
|
export interface VoiceCloneParams {
|
|
@@ -244,12 +309,6 @@ export interface VoiceCloneParams {
|
|
|
244
309
|
*/
|
|
245
310
|
description?: string | null;
|
|
246
311
|
|
|
247
|
-
/**
|
|
248
|
-
* Whether to apply AI enhancements to the clip to reduce background noise. This is
|
|
249
|
-
* not recommended unless the source clip is extremely low quality.
|
|
250
|
-
*/
|
|
251
|
-
enhance?: boolean | null;
|
|
252
|
-
|
|
253
312
|
/**
|
|
254
313
|
* The language of the voice.
|
|
255
314
|
*/
|
|
@@ -261,6 +320,13 @@ export interface VoiceCloneParams {
|
|
|
261
320
|
name?: string;
|
|
262
321
|
}
|
|
263
322
|
|
|
323
|
+
export interface VoiceGetParams {
|
|
324
|
+
/**
|
|
325
|
+
* Additional fields to include in the response.
|
|
326
|
+
*/
|
|
327
|
+
expand?: Array<'preview_file_url'> | null;
|
|
328
|
+
}
|
|
329
|
+
|
|
264
330
|
export interface VoiceLocalizeParams {
|
|
265
331
|
/**
|
|
266
332
|
* The description of the new localized voice.
|
|
@@ -320,6 +386,7 @@ export declare namespace Voices {
|
|
|
320
386
|
type VoiceUpdateParams as VoiceUpdateParams,
|
|
321
387
|
type VoiceListParams as VoiceListParams,
|
|
322
388
|
type VoiceCloneParams as VoiceCloneParams,
|
|
389
|
+
type VoiceGetParams as VoiceGetParams,
|
|
323
390
|
type VoiceLocalizeParams as VoiceLocalizeParams,
|
|
324
391
|
};
|
|
325
392
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '3.0.0-
|
|
1
|
+
export const VERSION = '3.0.0-b4'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.0.0-
|
|
1
|
+
export declare const VERSION = "3.0.0-b4";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "3.0.0-
|
|
1
|
+
export declare const VERSION = "3.0.0-b4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '3.0.0-
|
|
1
|
+
export const VERSION = '3.0.0-b4'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|