@cartesia/cartesia-js 2.2.0 → 2.2.2
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/README.md +5 -2
- package/api/resources/apiStatus/client/Client.js +1 -1
- package/api/resources/auth/client/Client.js +1 -1
- package/api/resources/infill/client/Client.js +1 -1
- package/api/resources/tts/types/GenerationRequest.d.ts +16 -0
- package/api/resources/tts/types/TtsRequest.d.ts +8 -0
- package/api/resources/tts/types/WebSocketTtsRequest.d.ts +2 -0
- package/api/resources/voices/client/Client.js +11 -9
- package/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +1 -1
- package/dist/api/resources/apiStatus/client/Client.js +1 -1
- package/dist/api/resources/auth/client/Client.js +1 -1
- package/dist/api/resources/infill/client/Client.js +1 -1
- package/dist/api/resources/tts/types/GenerationRequest.d.ts +16 -0
- package/dist/api/resources/tts/types/TtsRequest.d.ts +8 -0
- package/dist/api/resources/tts/types/WebSocketTtsRequest.d.ts +2 -0
- package/dist/api/resources/voices/client/Client.js +11 -9
- package/dist/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +1 -1
- package/dist/serialization/resources/tts/types/GenerationRequest.d.ts +2 -0
- package/dist/serialization/resources/tts/types/GenerationRequest.js +2 -0
- package/dist/serialization/resources/tts/types/TtsRequest.d.ts +1 -0
- package/dist/serialization/resources/tts/types/TtsRequest.js +1 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +2 -0
- package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/serialization/resources/tts/types/GenerationRequest.d.ts +2 -0
- package/serialization/resources/tts/types/GenerationRequest.js +2 -0
- package/serialization/resources/tts/types/TtsRequest.d.ts +1 -0
- package/serialization/resources/tts/types/TtsRequest.js +1 -0
- package/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +2 -0
- package/serialization/resources/tts/types/WebSocketTtsRequest.js +2 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
# Cartesia TypeScript
|
|
1
|
+
# Cartesia TypeScript SDK
|
|
2
2
|
|
|
3
3
|
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fcartesia-ai%2Fcartesia-js)
|
|
4
4
|
[](https://www.npmjs.com/package/@cartesia/cartesia-js)
|
|
5
5
|
[](https://discord.gg/cartesia)
|
|
6
6
|
|
|
7
|
-
The Cartesia TypeScript library provides convenient access to the Cartesia API from TypeScript.
|
|
7
|
+
The Cartesia TypeScript library provides convenient access to the Cartesia API from TypeScript/JavaScript, runnable in both Node.js and browsers.
|
|
8
|
+
|
|
9
|
+
> [!TIP]
|
|
10
|
+
> **[@cartesia-ai/cartesia-nextjs-demo](https://github.com/cartesia-ai/cartesia-nextjs-demo)** is our demo app that shows how to use Cartesia text-to-speech in a browser-based application.
|
|
8
11
|
|
|
9
12
|
## Installation
|
|
10
13
|
|
|
@@ -66,7 +66,7 @@ class ApiStatus {
|
|
|
66
66
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
67
67
|
url: (_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production,
|
|
68
68
|
method: "GET",
|
|
69
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
69
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
70
70
|
contentType: "application/json",
|
|
71
71
|
requestType: "json",
|
|
72
72
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -78,7 +78,7 @@ class Auth {
|
|
|
78
78
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
79
79
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "access-token"),
|
|
80
80
|
method: "POST",
|
|
81
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
81
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
82
82
|
contentType: "application/json",
|
|
83
83
|
requestType: "json",
|
|
84
84
|
body: serializers.TokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -113,7 +113,7 @@ class Infill {
|
|
|
113
113
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
114
114
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/infill/bytes"),
|
|
115
115
|
method: "POST",
|
|
116
|
-
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
116
|
+
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
117
117
|
requestType: "file",
|
|
118
118
|
duplex: _maybeEncodedRequest.duplex,
|
|
119
119
|
body: _maybeEncodedRequest.body,
|
|
@@ -15,12 +15,28 @@ export interface GenerationRequest {
|
|
|
15
15
|
* If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
|
|
16
16
|
*/
|
|
17
17
|
duration?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
|
|
20
|
+
*
|
|
21
|
+
* Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
|
|
22
|
+
*
|
|
23
|
+
* This parameter is only supported for `sonic-2` models.
|
|
24
|
+
*/
|
|
25
|
+
textCfg?: number;
|
|
18
26
|
contextId?: Cartesia.ContextId;
|
|
19
27
|
/**
|
|
20
28
|
* Whether this input may be followed by more inputs.
|
|
21
29
|
* If not specified, this defaults to `false`.
|
|
22
30
|
*/
|
|
23
31
|
continue?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The maximum time in milliseconds to buffer text before starting generation. Values between [0, 1000]ms are supported. Defaults to 0 (no buffering).
|
|
34
|
+
*
|
|
35
|
+
* When set, the model will buffer incoming text chunks until it's confident it has enough context to generate high-quality speech, or the buffer delay elapses, whichever comes first. Without this option set, the model will kick off generations immediately, ceding control of buffering to the user.
|
|
36
|
+
*
|
|
37
|
+
* Use this to balance responsiveness with higher quality speech generation, which often benefits from having more context.
|
|
38
|
+
*/
|
|
39
|
+
maxBufferDelayMs?: number;
|
|
24
40
|
/** Whether to flush the context. */
|
|
25
41
|
flush?: boolean;
|
|
26
42
|
/** Whether to return word-level timestamps. */
|
|
@@ -14,4 +14,12 @@ export interface TtsRequest {
|
|
|
14
14
|
* If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
|
|
15
15
|
*/
|
|
16
16
|
duration?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
|
|
19
|
+
*
|
|
20
|
+
* Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
|
|
21
|
+
*
|
|
22
|
+
* This parameter is only supported for `sonic-2` models.
|
|
23
|
+
*/
|
|
24
|
+
textCfg?: number;
|
|
17
25
|
}
|
|
@@ -70,7 +70,7 @@ class Voices {
|
|
|
70
70
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
71
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
72
72
|
method: "GET",
|
|
73
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
73
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
74
74
|
contentType: "application/json",
|
|
75
75
|
requestType: "json",
|
|
76
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -148,7 +148,9 @@ class Voices {
|
|
|
148
148
|
}
|
|
149
149
|
_request.append("language", serializers.SupportedLanguage.jsonOrThrow(request.language, { unrecognizedObjectKeys: "strip" }));
|
|
150
150
|
_request.append("mode", serializers.CloneMode.jsonOrThrow(request.mode, { unrecognizedObjectKeys: "strip" }));
|
|
151
|
-
|
|
151
|
+
if (request.enhance != null) {
|
|
152
|
+
_request.append("enhance", request.enhance.toString());
|
|
153
|
+
}
|
|
152
154
|
if (request.transcript != null) {
|
|
153
155
|
_request.append("transcript", request.transcript);
|
|
154
156
|
}
|
|
@@ -156,7 +158,7 @@ class Voices {
|
|
|
156
158
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
157
159
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/clone"),
|
|
158
160
|
method: "POST",
|
|
159
|
-
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
161
|
+
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
160
162
|
requestType: "file",
|
|
161
163
|
duplex: _maybeEncodedRequest.duplex,
|
|
162
164
|
body: _maybeEncodedRequest.body,
|
|
@@ -207,7 +209,7 @@ class Voices {
|
|
|
207
209
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
208
210
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
209
211
|
method: "DELETE",
|
|
210
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
212
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
211
213
|
contentType: "application/json",
|
|
212
214
|
requestType: "json",
|
|
213
215
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -255,7 +257,7 @@ class Voices {
|
|
|
255
257
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
256
258
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
257
259
|
method: "PATCH",
|
|
258
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
260
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
259
261
|
contentType: "application/json",
|
|
260
262
|
requestType: "json",
|
|
261
263
|
body: serializers.UpdateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -306,7 +308,7 @@ class Voices {
|
|
|
306
308
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
307
309
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
308
310
|
method: "GET",
|
|
309
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
311
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
310
312
|
contentType: "application/json",
|
|
311
313
|
requestType: "json",
|
|
312
314
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -365,7 +367,7 @@ class Voices {
|
|
|
365
367
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
366
368
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/localize"),
|
|
367
369
|
method: "POST",
|
|
368
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
370
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
369
371
|
contentType: "application/json",
|
|
370
372
|
requestType: "json",
|
|
371
373
|
body: serializers.LocalizeVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -424,7 +426,7 @@ class Voices {
|
|
|
424
426
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
425
427
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/mix"),
|
|
426
428
|
method: "POST",
|
|
427
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
429
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
428
430
|
contentType: "application/json",
|
|
429
431
|
requestType: "json",
|
|
430
432
|
body: serializers.MixVoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -483,7 +485,7 @@ class Voices {
|
|
|
483
485
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
484
486
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
485
487
|
method: "POST",
|
|
486
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
488
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
487
489
|
contentType: "application/json",
|
|
488
490
|
requestType: "json",
|
|
489
491
|
body: serializers.CreateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -47,7 +47,7 @@ export interface CloneVoiceRequest {
|
|
|
47
47
|
* Whether to enhance the clip to improve its quality before cloning. Useful if the clip has background noise.
|
|
48
48
|
*
|
|
49
49
|
*/
|
|
50
|
-
enhance
|
|
50
|
+
enhance?: boolean;
|
|
51
51
|
/**
|
|
52
52
|
* Optional transcript of the words spoken in the audio clip. Only used for similarity mode.
|
|
53
53
|
*
|
|
@@ -66,7 +66,7 @@ class ApiStatus {
|
|
|
66
66
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
67
67
|
url: (_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production,
|
|
68
68
|
method: "GET",
|
|
69
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
69
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
70
70
|
contentType: "application/json",
|
|
71
71
|
requestType: "json",
|
|
72
72
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -78,7 +78,7 @@ class Auth {
|
|
|
78
78
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
79
79
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "access-token"),
|
|
80
80
|
method: "POST",
|
|
81
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
81
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
82
82
|
contentType: "application/json",
|
|
83
83
|
requestType: "json",
|
|
84
84
|
body: serializers.TokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -113,7 +113,7 @@ class Infill {
|
|
|
113
113
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
114
114
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/infill/bytes"),
|
|
115
115
|
method: "POST",
|
|
116
|
-
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
116
|
+
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
117
117
|
requestType: "file",
|
|
118
118
|
duplex: _maybeEncodedRequest.duplex,
|
|
119
119
|
body: _maybeEncodedRequest.body,
|
|
@@ -15,12 +15,28 @@ export interface GenerationRequest {
|
|
|
15
15
|
* If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
|
|
16
16
|
*/
|
|
17
17
|
duration?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
|
|
20
|
+
*
|
|
21
|
+
* Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
|
|
22
|
+
*
|
|
23
|
+
* This parameter is only supported for `sonic-2` models.
|
|
24
|
+
*/
|
|
25
|
+
textCfg?: number;
|
|
18
26
|
contextId?: Cartesia.ContextId;
|
|
19
27
|
/**
|
|
20
28
|
* Whether this input may be followed by more inputs.
|
|
21
29
|
* If not specified, this defaults to `false`.
|
|
22
30
|
*/
|
|
23
31
|
continue?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The maximum time in milliseconds to buffer text before starting generation. Values between [0, 1000]ms are supported. Defaults to 0 (no buffering).
|
|
34
|
+
*
|
|
35
|
+
* When set, the model will buffer incoming text chunks until it's confident it has enough context to generate high-quality speech, or the buffer delay elapses, whichever comes first. Without this option set, the model will kick off generations immediately, ceding control of buffering to the user.
|
|
36
|
+
*
|
|
37
|
+
* Use this to balance responsiveness with higher quality speech generation, which often benefits from having more context.
|
|
38
|
+
*/
|
|
39
|
+
maxBufferDelayMs?: number;
|
|
24
40
|
/** Whether to flush the context. */
|
|
25
41
|
flush?: boolean;
|
|
26
42
|
/** Whether to return word-level timestamps. */
|
|
@@ -14,4 +14,12 @@ export interface TtsRequest {
|
|
|
14
14
|
* If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
|
|
15
15
|
*/
|
|
16
16
|
duration?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The text [classifier-free guidance](https://arxiv.org/abs/2207.12598) value for the request.
|
|
19
|
+
*
|
|
20
|
+
* Higher values causes the model to attend more to the text but speed up the generation. Lower values reduce the speaking rate but can increase the risk of hallucinations. The default value is `3.0`. For a slower speaking rate, we recommend values between `2.0` and `3.0`. Values are supported between `1.5` and `3.0`.
|
|
21
|
+
*
|
|
22
|
+
* This parameter is only supported for `sonic-2` models.
|
|
23
|
+
*/
|
|
24
|
+
textCfg?: number;
|
|
17
25
|
}
|
|
@@ -70,7 +70,7 @@ class Voices {
|
|
|
70
70
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
71
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
72
72
|
method: "GET",
|
|
73
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
73
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
74
74
|
contentType: "application/json",
|
|
75
75
|
requestType: "json",
|
|
76
76
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -148,7 +148,9 @@ class Voices {
|
|
|
148
148
|
}
|
|
149
149
|
_request.append("language", serializers.SupportedLanguage.jsonOrThrow(request.language, { unrecognizedObjectKeys: "strip" }));
|
|
150
150
|
_request.append("mode", serializers.CloneMode.jsonOrThrow(request.mode, { unrecognizedObjectKeys: "strip" }));
|
|
151
|
-
|
|
151
|
+
if (request.enhance != null) {
|
|
152
|
+
_request.append("enhance", request.enhance.toString());
|
|
153
|
+
}
|
|
152
154
|
if (request.transcript != null) {
|
|
153
155
|
_request.append("transcript", request.transcript);
|
|
154
156
|
}
|
|
@@ -156,7 +158,7 @@ class Voices {
|
|
|
156
158
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
157
159
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/clone"),
|
|
158
160
|
method: "POST",
|
|
159
|
-
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
161
|
+
headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
160
162
|
requestType: "file",
|
|
161
163
|
duplex: _maybeEncodedRequest.duplex,
|
|
162
164
|
body: _maybeEncodedRequest.body,
|
|
@@ -207,7 +209,7 @@ class Voices {
|
|
|
207
209
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
208
210
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
209
211
|
method: "DELETE",
|
|
210
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
212
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
211
213
|
contentType: "application/json",
|
|
212
214
|
requestType: "json",
|
|
213
215
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -255,7 +257,7 @@ class Voices {
|
|
|
255
257
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
256
258
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
257
259
|
method: "PATCH",
|
|
258
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
260
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
259
261
|
contentType: "application/json",
|
|
260
262
|
requestType: "json",
|
|
261
263
|
body: serializers.UpdateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -306,7 +308,7 @@ class Voices {
|
|
|
306
308
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
307
309
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
308
310
|
method: "GET",
|
|
309
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
311
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
310
312
|
contentType: "application/json",
|
|
311
313
|
requestType: "json",
|
|
312
314
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -365,7 +367,7 @@ class Voices {
|
|
|
365
367
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
366
368
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/localize"),
|
|
367
369
|
method: "POST",
|
|
368
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
370
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
369
371
|
contentType: "application/json",
|
|
370
372
|
requestType: "json",
|
|
371
373
|
body: serializers.LocalizeVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -424,7 +426,7 @@ class Voices {
|
|
|
424
426
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
425
427
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/mix"),
|
|
426
428
|
method: "POST",
|
|
427
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
429
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
428
430
|
contentType: "application/json",
|
|
429
431
|
requestType: "json",
|
|
430
432
|
body: serializers.MixVoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -483,7 +485,7 @@ class Voices {
|
|
|
483
485
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
484
486
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
485
487
|
method: "POST",
|
|
486
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.
|
|
488
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
487
489
|
contentType: "application/json",
|
|
488
490
|
requestType: "json",
|
|
489
491
|
body: serializers.CreateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -47,7 +47,7 @@ export interface CloneVoiceRequest {
|
|
|
47
47
|
* Whether to enhance the clip to improve its quality before cloning. Useful if the clip has background noise.
|
|
48
48
|
*
|
|
49
49
|
*/
|
|
50
|
-
enhance
|
|
50
|
+
enhance?: boolean;
|
|
51
51
|
/**
|
|
52
52
|
* Optional transcript of the words spoken in the audio clip. Only used for similarity mode.
|
|
53
53
|
*
|
|
@@ -17,8 +17,10 @@ export declare namespace GenerationRequest {
|
|
|
17
17
|
language?: SupportedLanguage.Raw | null;
|
|
18
18
|
output_format: WebSocketRawOutputFormat.Raw;
|
|
19
19
|
duration?: number | null;
|
|
20
|
+
text_cfg?: number | null;
|
|
20
21
|
context_id?: ContextId.Raw | null;
|
|
21
22
|
continue?: boolean | null;
|
|
23
|
+
max_buffer_delay_ms?: number | null;
|
|
22
24
|
flush?: boolean | null;
|
|
23
25
|
add_timestamps?: boolean | null;
|
|
24
26
|
add_phoneme_timestamps?: boolean | null;
|
|
@@ -49,8 +49,10 @@ exports.GenerationRequest = core.serialization.object({
|
|
|
49
49
|
language: SupportedLanguage_1.SupportedLanguage.optional(),
|
|
50
50
|
outputFormat: core.serialization.property("output_format", WebSocketRawOutputFormat_1.WebSocketRawOutputFormat),
|
|
51
51
|
duration: core.serialization.number().optional(),
|
|
52
|
+
textCfg: core.serialization.property("text_cfg", core.serialization.number().optional()),
|
|
52
53
|
contextId: core.serialization.property("context_id", ContextId_1.ContextId.optional()),
|
|
53
54
|
continue: core.serialization.boolean().optional(),
|
|
55
|
+
maxBufferDelayMs: core.serialization.property("max_buffer_delay_ms", core.serialization.number().optional()),
|
|
54
56
|
flush: core.serialization.boolean().optional(),
|
|
55
57
|
addTimestamps: core.serialization.property("add_timestamps", core.serialization.boolean().optional()),
|
|
56
58
|
addPhonemeTimestamps: core.serialization.property("add_phoneme_timestamps", core.serialization.boolean().optional()),
|
|
@@ -48,4 +48,5 @@ exports.TtsRequest = core.serialization.object({
|
|
|
48
48
|
language: SupportedLanguage_1.SupportedLanguage.optional(),
|
|
49
49
|
outputFormat: core.serialization.property("output_format", OutputFormat_1.OutputFormat),
|
|
50
50
|
duration: core.serialization.number().optional(),
|
|
51
|
+
textCfg: core.serialization.property("text_cfg", core.serialization.number().optional()),
|
|
51
52
|
});
|
|
@@ -52,4 +52,6 @@ exports.WebSocketTtsRequest = core.serialization.object({
|
|
|
52
52
|
useOriginalTimestamps: core.serialization.property("use_original_timestamps", core.serialization.boolean().optional()),
|
|
53
53
|
continue: core.serialization.boolean().optional(),
|
|
54
54
|
contextId: core.serialization.property("context_id", core.serialization.string().optional()),
|
|
55
|
+
maxBufferDelayMs: core.serialization.property("max_buffer_delay_ms", core.serialization.number().optional()),
|
|
56
|
+
textCfg: core.serialization.property("text_cfg", core.serialization.number().optional()),
|
|
55
57
|
});
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.2.
|
|
1
|
+
export declare const SDK_VERSION = "2.2.2";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -17,8 +17,10 @@ export declare namespace GenerationRequest {
|
|
|
17
17
|
language?: SupportedLanguage.Raw | null;
|
|
18
18
|
output_format: WebSocketRawOutputFormat.Raw;
|
|
19
19
|
duration?: number | null;
|
|
20
|
+
text_cfg?: number | null;
|
|
20
21
|
context_id?: ContextId.Raw | null;
|
|
21
22
|
continue?: boolean | null;
|
|
23
|
+
max_buffer_delay_ms?: number | null;
|
|
22
24
|
flush?: boolean | null;
|
|
23
25
|
add_timestamps?: boolean | null;
|
|
24
26
|
add_phoneme_timestamps?: boolean | null;
|
|
@@ -49,8 +49,10 @@ exports.GenerationRequest = core.serialization.object({
|
|
|
49
49
|
language: SupportedLanguage_1.SupportedLanguage.optional(),
|
|
50
50
|
outputFormat: core.serialization.property("output_format", WebSocketRawOutputFormat_1.WebSocketRawOutputFormat),
|
|
51
51
|
duration: core.serialization.number().optional(),
|
|
52
|
+
textCfg: core.serialization.property("text_cfg", core.serialization.number().optional()),
|
|
52
53
|
contextId: core.serialization.property("context_id", ContextId_1.ContextId.optional()),
|
|
53
54
|
continue: core.serialization.boolean().optional(),
|
|
55
|
+
maxBufferDelayMs: core.serialization.property("max_buffer_delay_ms", core.serialization.number().optional()),
|
|
54
56
|
flush: core.serialization.boolean().optional(),
|
|
55
57
|
addTimestamps: core.serialization.property("add_timestamps", core.serialization.boolean().optional()),
|
|
56
58
|
addPhonemeTimestamps: core.serialization.property("add_phoneme_timestamps", core.serialization.boolean().optional()),
|
|
@@ -48,4 +48,5 @@ exports.TtsRequest = core.serialization.object({
|
|
|
48
48
|
language: SupportedLanguage_1.SupportedLanguage.optional(),
|
|
49
49
|
outputFormat: core.serialization.property("output_format", OutputFormat_1.OutputFormat),
|
|
50
50
|
duration: core.serialization.number().optional(),
|
|
51
|
+
textCfg: core.serialization.property("text_cfg", core.serialization.number().optional()),
|
|
51
52
|
});
|
|
@@ -52,4 +52,6 @@ exports.WebSocketTtsRequest = core.serialization.object({
|
|
|
52
52
|
useOriginalTimestamps: core.serialization.property("use_original_timestamps", core.serialization.boolean().optional()),
|
|
53
53
|
continue: core.serialization.boolean().optional(),
|
|
54
54
|
contextId: core.serialization.property("context_id", core.serialization.string().optional()),
|
|
55
|
+
maxBufferDelayMs: core.serialization.property("max_buffer_delay_ms", core.serialization.number().optional()),
|
|
56
|
+
textCfg: core.serialization.property("text_cfg", core.serialization.number().optional()),
|
|
55
57
|
});
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.2.
|
|
1
|
+
export declare const SDK_VERSION = "2.2.2";
|
package/version.js
CHANGED