@cartesia/cartesia-js 2.1.0 → 2.1.1
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 +15 -4
- package/api/resources/apiStatus/client/Client.js +1 -1
- package/api/resources/datasets/client/Client.js +4 -4
- package/api/resources/tts/types/Controls.d.ts +1 -1
- package/api/resources/tts/types/Emotion.d.ts +1 -5
- package/api/resources/tts/types/Emotion.js +0 -4
- package/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
- package/api/resources/voices/client/Client.js +8 -8
- package/dist/api/resources/apiStatus/client/Client.js +1 -1
- package/dist/api/resources/datasets/client/Client.js +4 -4
- package/dist/api/resources/tts/types/Controls.d.ts +1 -1
- package/dist/api/resources/tts/types/Emotion.d.ts +1 -5
- package/dist/api/resources/tts/types/Emotion.js +0 -4
- package/dist/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
- package/dist/api/resources/voices/client/Client.js +8 -8
- package/dist/serialization/resources/tts/types/Controls.d.ts +1 -1
- package/dist/serialization/resources/tts/types/Controls.js +1 -1
- package/dist/serialization/resources/tts/types/Emotion.d.ts +1 -1
- package/dist/serialization/resources/tts/types/Emotion.js +0 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +5 -8
- package/serialization/resources/tts/types/Controls.d.ts +1 -1
- package/serialization/resources/tts/types/Controls.js +1 -1
- package/serialization/resources/tts/types/Emotion.d.ts +1 -1
- package/serialization/resources/tts/types/Emotion.js +0 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
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
|
+
[](https://discord.gg/cartesia)
|
|
5
6
|
|
|
6
7
|
The Cartesia TypeScript library provides convenient access to the Cartesia API from TypeScript.
|
|
7
8
|
|
|
@@ -23,9 +24,14 @@ Instantiate and use the client with the following:
|
|
|
23
24
|
|
|
24
25
|
```typescript
|
|
25
26
|
import { CartesiaClient } from "@cartesia/cartesia-js";
|
|
27
|
+
import process from "node:process"
|
|
28
|
+
import fs from "node:fs"
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
// Set up the client.
|
|
31
|
+
const client = new CartesiaClient({ apiKey: process.env.CARTESIA_API_KEY });
|
|
32
|
+
|
|
33
|
+
// Call the TTS API's bytes endpoint, which returns binary audio data as an ArrayBuffer.
|
|
34
|
+
const response = await client.tts.bytes({
|
|
29
35
|
modelId: "sonic-english",
|
|
30
36
|
transcript: "Hello, world!",
|
|
31
37
|
voice: {
|
|
@@ -34,20 +40,24 @@ await client.tts.bytes({
|
|
|
34
40
|
},
|
|
35
41
|
language: "en",
|
|
36
42
|
outputFormat: {
|
|
37
|
-
container: "
|
|
43
|
+
container: "wav",
|
|
38
44
|
sampleRate: 44100,
|
|
39
45
|
encoding: "pcm_f32le",
|
|
40
46
|
},
|
|
41
47
|
});
|
|
48
|
+
|
|
49
|
+
// Write the response to a file.
|
|
50
|
+
fs.writeFileSync("sonic.wav", new Uint8Array(response));
|
|
42
51
|
```
|
|
43
52
|
|
|
44
53
|
### TTS over WebSocket
|
|
45
54
|
|
|
46
55
|
```js
|
|
47
56
|
import { CartesiaClient } from "@cartesia/cartesia-js";
|
|
57
|
+
import process from "node:process"
|
|
48
58
|
|
|
49
59
|
const cartesia = new CartesiaClient({
|
|
50
|
-
apiKey:
|
|
60
|
+
apiKey: process.env.CARTESIA_API_KEY,
|
|
51
61
|
});
|
|
52
62
|
|
|
53
63
|
// Initialize the WebSocket. Make sure the output format you specify is supported.
|
|
@@ -61,6 +71,7 @@ try {
|
|
|
61
71
|
await websocket.connect();
|
|
62
72
|
} catch (error) {
|
|
63
73
|
console.error(`Failed to connect to Cartesia: ${error}`);
|
|
74
|
+
process.exit(1);
|
|
64
75
|
}
|
|
65
76
|
|
|
66
77
|
// Create a stream.
|
|
@@ -56,7 +56,7 @@ class ApiStatus {
|
|
|
56
56
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
57
57
|
url: (_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production,
|
|
58
58
|
method: "GET",
|
|
59
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
59
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
60
60
|
contentType: "application/json",
|
|
61
61
|
requestType: "json",
|
|
62
62
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -60,7 +60,7 @@ class Datasets {
|
|
|
60
60
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
61
61
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/datasets/"),
|
|
62
62
|
method: "GET",
|
|
63
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
63
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
64
64
|
contentType: "application/json",
|
|
65
65
|
requestType: "json",
|
|
66
66
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -112,7 +112,7 @@ class Datasets {
|
|
|
112
112
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
113
113
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/datasets/"),
|
|
114
114
|
method: "POST",
|
|
115
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
115
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
116
116
|
contentType: "application/json",
|
|
117
117
|
requestType: "json",
|
|
118
118
|
body: serializers.CreateDatasetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -163,7 +163,7 @@ class Datasets {
|
|
|
163
163
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
164
164
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/datasets/${encodeURIComponent(id)}/files`),
|
|
165
165
|
method: "GET",
|
|
166
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
166
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
167
167
|
contentType: "application/json",
|
|
168
168
|
requestType: "json",
|
|
169
169
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -219,7 +219,7 @@ class Datasets {
|
|
|
219
219
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
220
220
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/datasets/${encodeURIComponent(id)}/files`),
|
|
221
221
|
method: "POST",
|
|
222
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
222
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
|
|
223
223
|
requestType: "file",
|
|
224
224
|
duplex: _maybeEncodedRequest.duplex,
|
|
225
225
|
body: _maybeEncodedRequest.body,
|
|
@@ -8,16 +8,14 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Supported levels are: lowest, low, (omit), high, highest.
|
|
10
10
|
*/
|
|
11
|
-
export declare type Emotion = "anger:lowest" | "anger:low" | "anger
|
|
11
|
+
export declare type Emotion = "anger:lowest" | "anger:low" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "curiosity:low" | "curiosity:high" | "curiosity:highest";
|
|
12
12
|
export declare const Emotion: {
|
|
13
13
|
readonly AngerLowest: "anger:lowest";
|
|
14
14
|
readonly AngerLow: "anger:low";
|
|
15
|
-
readonly AngerNormal: "anger";
|
|
16
15
|
readonly AngerHigh: "anger:high";
|
|
17
16
|
readonly AngerHighest: "anger:highest";
|
|
18
17
|
readonly PositivityLowest: "positivity:lowest";
|
|
19
18
|
readonly PositivityLow: "positivity:low";
|
|
20
|
-
readonly PositivityNormal: "positivity";
|
|
21
19
|
readonly PositivityHigh: "positivity:high";
|
|
22
20
|
readonly PositivityHighest: "positivity:highest";
|
|
23
21
|
readonly SurpriseLowest: "surprise:lowest";
|
|
@@ -25,9 +23,7 @@ export declare const Emotion: {
|
|
|
25
23
|
readonly SurpriseHighest: "surprise:highest";
|
|
26
24
|
readonly SadnessLowest: "sadness:lowest";
|
|
27
25
|
readonly SadnessLow: "sadness:low";
|
|
28
|
-
readonly SadnessNormal: "sadness";
|
|
29
26
|
readonly CuriosityLow: "curiosity:low";
|
|
30
|
-
readonly CuriosityNormal: "curiosity";
|
|
31
27
|
readonly CuriosityHigh: "curiosity:high";
|
|
32
28
|
readonly CuriosityHighest: "curiosity:highest";
|
|
33
29
|
};
|
|
@@ -7,12 +7,10 @@ exports.Emotion = void 0;
|
|
|
7
7
|
exports.Emotion = {
|
|
8
8
|
AngerLowest: "anger:lowest",
|
|
9
9
|
AngerLow: "anger:low",
|
|
10
|
-
AngerNormal: "anger",
|
|
11
10
|
AngerHigh: "anger:high",
|
|
12
11
|
AngerHighest: "anger:highest",
|
|
13
12
|
PositivityLowest: "positivity:lowest",
|
|
14
13
|
PositivityLow: "positivity:low",
|
|
15
|
-
PositivityNormal: "positivity",
|
|
16
14
|
PositivityHigh: "positivity:high",
|
|
17
15
|
PositivityHighest: "positivity:highest",
|
|
18
16
|
SurpriseLowest: "surprise:lowest",
|
|
@@ -20,9 +18,7 @@ exports.Emotion = {
|
|
|
20
18
|
SurpriseHighest: "surprise:highest",
|
|
21
19
|
SadnessLowest: "sadness:lowest",
|
|
22
20
|
SadnessLow: "sadness:low",
|
|
23
|
-
SadnessNormal: "sadness",
|
|
24
21
|
CuriosityLow: "curiosity:low",
|
|
25
|
-
CuriosityNormal: "curiosity",
|
|
26
22
|
CuriosityHigh: "curiosity:high",
|
|
27
23
|
CuriosityHighest: "curiosity:highest",
|
|
28
24
|
};
|
|
@@ -60,7 +60,7 @@ class Voices {
|
|
|
60
60
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
61
61
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
62
62
|
method: "GET",
|
|
63
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
63
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
64
64
|
contentType: "application/json",
|
|
65
65
|
requestType: "json",
|
|
66
66
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -116,7 +116,7 @@ class Voices {
|
|
|
116
116
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
117
117
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
118
118
|
method: "POST",
|
|
119
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
119
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
120
120
|
contentType: "application/json",
|
|
121
121
|
requestType: "json",
|
|
122
122
|
body: serializers.CreateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -167,7 +167,7 @@ class Voices {
|
|
|
167
167
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
168
168
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
169
169
|
method: "DELETE",
|
|
170
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
170
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
171
171
|
contentType: "application/json",
|
|
172
172
|
requestType: "json",
|
|
173
173
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -215,7 +215,7 @@ class Voices {
|
|
|
215
215
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
216
216
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
217
217
|
method: "PATCH",
|
|
218
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
218
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
219
219
|
contentType: "application/json",
|
|
220
220
|
requestType: "json",
|
|
221
221
|
body: serializers.UpdateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -266,7 +266,7 @@ class Voices {
|
|
|
266
266
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
267
267
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
268
268
|
method: "GET",
|
|
269
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
269
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
270
270
|
contentType: "application/json",
|
|
271
271
|
requestType: "json",
|
|
272
272
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -321,7 +321,7 @@ class Voices {
|
|
|
321
321
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
322
322
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/localize"),
|
|
323
323
|
method: "POST",
|
|
324
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
324
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
325
325
|
contentType: "application/json",
|
|
326
326
|
requestType: "json",
|
|
327
327
|
body: serializers.LocalizeVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -377,7 +377,7 @@ class Voices {
|
|
|
377
377
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
378
378
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/mix"),
|
|
379
379
|
method: "POST",
|
|
380
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
380
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
381
381
|
contentType: "application/json",
|
|
382
382
|
requestType: "json",
|
|
383
383
|
body: serializers.MixVoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -464,7 +464,7 @@ class Voices {
|
|
|
464
464
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
465
465
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/clone"),
|
|
466
466
|
method: "POST",
|
|
467
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
467
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
|
|
468
468
|
requestType: "file",
|
|
469
469
|
duplex: _maybeEncodedRequest.duplex,
|
|
470
470
|
body: _maybeEncodedRequest.body,
|
|
@@ -56,7 +56,7 @@ class ApiStatus {
|
|
|
56
56
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
57
57
|
url: (_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production,
|
|
58
58
|
method: "GET",
|
|
59
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
59
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
60
60
|
contentType: "application/json",
|
|
61
61
|
requestType: "json",
|
|
62
62
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -60,7 +60,7 @@ class Datasets {
|
|
|
60
60
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
61
61
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/datasets/"),
|
|
62
62
|
method: "GET",
|
|
63
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
63
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
64
64
|
contentType: "application/json",
|
|
65
65
|
requestType: "json",
|
|
66
66
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -112,7 +112,7 @@ class Datasets {
|
|
|
112
112
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
113
113
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/datasets/"),
|
|
114
114
|
method: "POST",
|
|
115
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
115
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
116
116
|
contentType: "application/json",
|
|
117
117
|
requestType: "json",
|
|
118
118
|
body: serializers.CreateDatasetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -163,7 +163,7 @@ class Datasets {
|
|
|
163
163
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
164
164
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/datasets/${encodeURIComponent(id)}/files`),
|
|
165
165
|
method: "GET",
|
|
166
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
166
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
167
167
|
contentType: "application/json",
|
|
168
168
|
requestType: "json",
|
|
169
169
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -219,7 +219,7 @@ class Datasets {
|
|
|
219
219
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
220
220
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/datasets/${encodeURIComponent(id)}/files`),
|
|
221
221
|
method: "POST",
|
|
222
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
222
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
|
|
223
223
|
requestType: "file",
|
|
224
224
|
duplex: _maybeEncodedRequest.duplex,
|
|
225
225
|
body: _maybeEncodedRequest.body,
|
|
@@ -8,16 +8,14 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Supported levels are: lowest, low, (omit), high, highest.
|
|
10
10
|
*/
|
|
11
|
-
export declare type Emotion = "anger:lowest" | "anger:low" | "anger
|
|
11
|
+
export declare type Emotion = "anger:lowest" | "anger:low" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "curiosity:low" | "curiosity:high" | "curiosity:highest";
|
|
12
12
|
export declare const Emotion: {
|
|
13
13
|
readonly AngerLowest: "anger:lowest";
|
|
14
14
|
readonly AngerLow: "anger:low";
|
|
15
|
-
readonly AngerNormal: "anger";
|
|
16
15
|
readonly AngerHigh: "anger:high";
|
|
17
16
|
readonly AngerHighest: "anger:highest";
|
|
18
17
|
readonly PositivityLowest: "positivity:lowest";
|
|
19
18
|
readonly PositivityLow: "positivity:low";
|
|
20
|
-
readonly PositivityNormal: "positivity";
|
|
21
19
|
readonly PositivityHigh: "positivity:high";
|
|
22
20
|
readonly PositivityHighest: "positivity:highest";
|
|
23
21
|
readonly SurpriseLowest: "surprise:lowest";
|
|
@@ -25,9 +23,7 @@ export declare const Emotion: {
|
|
|
25
23
|
readonly SurpriseHighest: "surprise:highest";
|
|
26
24
|
readonly SadnessLowest: "sadness:lowest";
|
|
27
25
|
readonly SadnessLow: "sadness:low";
|
|
28
|
-
readonly SadnessNormal: "sadness";
|
|
29
26
|
readonly CuriosityLow: "curiosity:low";
|
|
30
|
-
readonly CuriosityNormal: "curiosity";
|
|
31
27
|
readonly CuriosityHigh: "curiosity:high";
|
|
32
28
|
readonly CuriosityHighest: "curiosity:highest";
|
|
33
29
|
};
|
|
@@ -7,12 +7,10 @@ exports.Emotion = void 0;
|
|
|
7
7
|
exports.Emotion = {
|
|
8
8
|
AngerLowest: "anger:lowest",
|
|
9
9
|
AngerLow: "anger:low",
|
|
10
|
-
AngerNormal: "anger",
|
|
11
10
|
AngerHigh: "anger:high",
|
|
12
11
|
AngerHighest: "anger:highest",
|
|
13
12
|
PositivityLowest: "positivity:lowest",
|
|
14
13
|
PositivityLow: "positivity:low",
|
|
15
|
-
PositivityNormal: "positivity",
|
|
16
14
|
PositivityHigh: "positivity:high",
|
|
17
15
|
PositivityHighest: "positivity:highest",
|
|
18
16
|
SurpriseLowest: "surprise:lowest",
|
|
@@ -20,9 +18,7 @@ exports.Emotion = {
|
|
|
20
18
|
SurpriseHighest: "surprise:highest",
|
|
21
19
|
SadnessLowest: "sadness:lowest",
|
|
22
20
|
SadnessLow: "sadness:low",
|
|
23
|
-
SadnessNormal: "sadness",
|
|
24
21
|
CuriosityLow: "curiosity:low",
|
|
25
|
-
CuriosityNormal: "curiosity",
|
|
26
22
|
CuriosityHigh: "curiosity:high",
|
|
27
23
|
CuriosityHighest: "curiosity:highest",
|
|
28
24
|
};
|
|
@@ -60,7 +60,7 @@ class Voices {
|
|
|
60
60
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
61
61
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
62
62
|
method: "GET",
|
|
63
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
63
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
64
64
|
contentType: "application/json",
|
|
65
65
|
requestType: "json",
|
|
66
66
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -116,7 +116,7 @@ class Voices {
|
|
|
116
116
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
117
117
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/"),
|
|
118
118
|
method: "POST",
|
|
119
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
119
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
120
120
|
contentType: "application/json",
|
|
121
121
|
requestType: "json",
|
|
122
122
|
body: serializers.CreateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -167,7 +167,7 @@ class Voices {
|
|
|
167
167
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
168
168
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
169
169
|
method: "DELETE",
|
|
170
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
170
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
171
171
|
contentType: "application/json",
|
|
172
172
|
requestType: "json",
|
|
173
173
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -215,7 +215,7 @@ class Voices {
|
|
|
215
215
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
216
216
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
217
217
|
method: "PATCH",
|
|
218
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
218
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
219
219
|
contentType: "application/json",
|
|
220
220
|
requestType: "json",
|
|
221
221
|
body: serializers.UpdateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -266,7 +266,7 @@ class Voices {
|
|
|
266
266
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
267
267
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
|
|
268
268
|
method: "GET",
|
|
269
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
269
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
270
270
|
contentType: "application/json",
|
|
271
271
|
requestType: "json",
|
|
272
272
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -321,7 +321,7 @@ class Voices {
|
|
|
321
321
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
322
322
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/localize"),
|
|
323
323
|
method: "POST",
|
|
324
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
324
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
325
325
|
contentType: "application/json",
|
|
326
326
|
requestType: "json",
|
|
327
327
|
body: serializers.LocalizeVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -377,7 +377,7 @@ class Voices {
|
|
|
377
377
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
378
378
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/mix"),
|
|
379
379
|
method: "POST",
|
|
380
|
-
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
380
|
+
headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
381
381
|
contentType: "application/json",
|
|
382
382
|
requestType: "json",
|
|
383
383
|
body: serializers.MixVoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -464,7 +464,7 @@ class Voices {
|
|
|
464
464
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
465
465
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/voices/clone"),
|
|
466
466
|
method: "POST",
|
|
467
|
-
headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.
|
|
467
|
+
headers: Object.assign(Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.1.1", "User-Agent": "@cartesia/cartesia-js/2.1.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
|
|
468
468
|
requestType: "file",
|
|
469
469
|
duplex: _maybeEncodedRequest.duplex,
|
|
470
470
|
body: _maybeEncodedRequest.body,
|
|
@@ -6,5 +6,5 @@ import * as Cartesia from "../../../../api/index";
|
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
7
|
export declare const Emotion: core.serialization.Schema<serializers.Emotion.Raw, Cartesia.Emotion>;
|
|
8
8
|
export declare namespace Emotion {
|
|
9
|
-
type Raw = "anger:lowest" | "anger:low" | "anger
|
|
9
|
+
type Raw = "anger:lowest" | "anger:low" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "curiosity:low" | "curiosity:high" | "curiosity:highest";
|
|
10
10
|
}
|
|
@@ -31,12 +31,10 @@ const core = __importStar(require("../../../../core"));
|
|
|
31
31
|
exports.Emotion = core.serialization.enum_([
|
|
32
32
|
"anger:lowest",
|
|
33
33
|
"anger:low",
|
|
34
|
-
"anger",
|
|
35
34
|
"anger:high",
|
|
36
35
|
"anger:highest",
|
|
37
36
|
"positivity:lowest",
|
|
38
37
|
"positivity:low",
|
|
39
|
-
"positivity",
|
|
40
38
|
"positivity:high",
|
|
41
39
|
"positivity:highest",
|
|
42
40
|
"surprise:lowest",
|
|
@@ -44,9 +42,7 @@ exports.Emotion = core.serialization.enum_([
|
|
|
44
42
|
"surprise:highest",
|
|
45
43
|
"sadness:lowest",
|
|
46
44
|
"sadness:low",
|
|
47
|
-
"sadness",
|
|
48
45
|
"curiosity:low",
|
|
49
|
-
"curiosity",
|
|
50
46
|
"curiosity:high",
|
|
51
47
|
"curiosity:highest",
|
|
52
48
|
]);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.1.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.1";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -323,21 +323,18 @@ await client.tts.bytes({
|
|
|
323
323
|
|
|
324
324
|
```typescript
|
|
325
325
|
const response = await client.tts.sse({
|
|
326
|
-
modelId: "
|
|
327
|
-
transcript: "
|
|
326
|
+
modelId: "sonic-english",
|
|
327
|
+
transcript: "Hello, world!",
|
|
328
328
|
voice: {
|
|
329
329
|
mode: "id",
|
|
330
|
-
id: "
|
|
331
|
-
experimentalControls: {
|
|
332
|
-
speed: 1.1,
|
|
333
|
-
emotion: "anger:lowest",
|
|
334
|
-
},
|
|
330
|
+
id: "694f9389-aac1-45b6-b726-9d9369183238",
|
|
335
331
|
},
|
|
336
332
|
language: "en",
|
|
337
333
|
outputFormat: {
|
|
338
334
|
container: "raw",
|
|
335
|
+
sampleRate: 44100,
|
|
336
|
+
encoding: "pcm_f32le",
|
|
339
337
|
},
|
|
340
|
-
duration: 1.1,
|
|
341
338
|
});
|
|
342
339
|
for await (const item of response) {
|
|
343
340
|
console.log(item);
|
|
@@ -6,5 +6,5 @@ import * as Cartesia from "../../../../api/index";
|
|
|
6
6
|
import * as core from "../../../../core";
|
|
7
7
|
export declare const Emotion: core.serialization.Schema<serializers.Emotion.Raw, Cartesia.Emotion>;
|
|
8
8
|
export declare namespace Emotion {
|
|
9
|
-
type Raw = "anger:lowest" | "anger:low" | "anger
|
|
9
|
+
type Raw = "anger:lowest" | "anger:low" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "curiosity:low" | "curiosity:high" | "curiosity:highest";
|
|
10
10
|
}
|
|
@@ -31,12 +31,10 @@ const core = __importStar(require("../../../../core"));
|
|
|
31
31
|
exports.Emotion = core.serialization.enum_([
|
|
32
32
|
"anger:lowest",
|
|
33
33
|
"anger:low",
|
|
34
|
-
"anger",
|
|
35
34
|
"anger:high",
|
|
36
35
|
"anger:highest",
|
|
37
36
|
"positivity:lowest",
|
|
38
37
|
"positivity:low",
|
|
39
|
-
"positivity",
|
|
40
38
|
"positivity:high",
|
|
41
39
|
"positivity:highest",
|
|
42
40
|
"surprise:lowest",
|
|
@@ -44,9 +42,7 @@ exports.Emotion = core.serialization.enum_([
|
|
|
44
42
|
"surprise:highest",
|
|
45
43
|
"sadness:lowest",
|
|
46
44
|
"sadness:low",
|
|
47
|
-
"sadness",
|
|
48
45
|
"curiosity:low",
|
|
49
|
-
"curiosity",
|
|
50
46
|
"curiosity:high",
|
|
51
47
|
"curiosity:highest",
|
|
52
48
|
]);
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.1.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.1";
|
package/version.js
CHANGED