@cartesia/cartesia-js 2.1.0-alpha0 → 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.
Files changed (35) hide show
  1. package/README.md +15 -4
  2. package/api/resources/apiStatus/client/Client.js +1 -1
  3. package/api/resources/datasets/client/Client.js +4 -4
  4. package/api/resources/tts/types/Controls.d.ts +1 -1
  5. package/api/resources/tts/types/Emotion.d.ts +1 -5
  6. package/api/resources/tts/types/Emotion.js +0 -4
  7. package/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
  8. package/api/resources/voices/client/Client.js +8 -8
  9. package/api/resources/voices/types/LocalizeDialect.d.ts +2 -6
  10. package/dist/api/resources/apiStatus/client/Client.js +1 -1
  11. package/dist/api/resources/datasets/client/Client.js +4 -4
  12. package/dist/api/resources/tts/types/Controls.d.ts +1 -1
  13. package/dist/api/resources/tts/types/Emotion.d.ts +1 -5
  14. package/dist/api/resources/tts/types/Emotion.js +0 -4
  15. package/dist/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
  16. package/dist/api/resources/voices/client/Client.js +8 -8
  17. package/dist/api/resources/voices/types/LocalizeDialect.d.ts +2 -6
  18. package/dist/serialization/resources/tts/types/Controls.d.ts +1 -1
  19. package/dist/serialization/resources/tts/types/Controls.js +1 -1
  20. package/dist/serialization/resources/tts/types/Emotion.d.ts +1 -1
  21. package/dist/serialization/resources/tts/types/Emotion.js +0 -4
  22. package/dist/serialization/resources/voices/types/LocalizeDialect.d.ts +1 -1
  23. package/dist/serialization/resources/voices/types/LocalizeDialect.js +1 -1
  24. package/dist/version.d.ts +1 -1
  25. package/dist/version.js +1 -1
  26. package/package.json +1 -1
  27. package/reference.md +5 -8
  28. package/serialization/resources/tts/types/Controls.d.ts +1 -1
  29. package/serialization/resources/tts/types/Controls.js +1 -1
  30. package/serialization/resources/tts/types/Emotion.d.ts +1 -1
  31. package/serialization/resources/tts/types/Emotion.js +0 -4
  32. package/serialization/resources/voices/types/LocalizeDialect.d.ts +1 -1
  33. package/serialization/resources/voices/types/LocalizeDialect.js +1 -1
  34. package/version.d.ts +1 -1
  35. package/version.js +1 -1
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](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
  [![npm shield](https://img.shields.io/npm/v/@cartesia/cartesia-js)](https://www.npmjs.com/package/@cartesia/cartesia-js)
5
+ [![Discord](https://badgen.net/badge/black/Cartesia/icon?icon=discord&label)](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
- const client = new CartesiaClient({ apiKey: "YOUR_API_KEY_HEADER" });
28
- await client.tts.bytes({
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: "raw",
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: "your-api-key",
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
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,
@@ -4,5 +4,5 @@
4
4
  import * as Cartesia from "../../../index";
5
5
  export interface Controls {
6
6
  speed: Cartesia.Speed;
7
- emotion: Cartesia.Emotion;
7
+ emotion: Cartesia.Emotion[];
8
8
  }
@@ -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" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness" | "curiosity:low" | "curiosity" | "curiosity:high" | "curiosity:highest";
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
  };
@@ -3,5 +3,6 @@
3
3
  */
4
4
  export interface Mp3OutputFormat {
5
5
  sampleRate: number;
6
+ /** The bit rate of the audio in bits per second. Supported bit rates are 32000, 64000, 96000, 128000, 192000. */
6
7
  bitRate: number;
7
8
  }
@@ -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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
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,
@@ -3,14 +3,10 @@
3
3
  */
4
4
  import * as Cartesia from "../../../index";
5
5
  /**
6
- * The dialect to localize to.
6
+ * The dialect to localize to. Only supported for English (`en`).
7
7
  */
8
8
  export declare type LocalizeDialect =
9
9
  /**
10
10
  * Only available when language is set to English (`en`).
11
11
  * */
12
- Cartesia.LocalizeEnglishDialect
13
- /**
14
- * The standard dialect for the language.
15
- * */
16
- | "st";
12
+ Cartesia.LocalizeEnglishDialect;
@@ -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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
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,
@@ -4,5 +4,5 @@
4
4
  import * as Cartesia from "../../../index";
5
5
  export interface Controls {
6
6
  speed: Cartesia.Speed;
7
- emotion: Cartesia.Emotion;
7
+ emotion: Cartesia.Emotion[];
8
8
  }
@@ -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" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness" | "curiosity:low" | "curiosity" | "curiosity:high" | "curiosity:highest";
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
  };
@@ -3,5 +3,6 @@
3
3
  */
4
4
  export interface Mp3OutputFormat {
5
5
  sampleRate: number;
6
+ /** The bit rate of the audio in bits per second. Supported bit rates are 32000, 64000, 96000, 128000, 192000. */
6
7
  bitRate: number;
7
8
  }
@@ -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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
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.0-alpha0", "User-Agent": "@cartesia/cartesia-js/2.1.0-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
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,
@@ -3,14 +3,10 @@
3
3
  */
4
4
  import * as Cartesia from "../../../index";
5
5
  /**
6
- * The dialect to localize to.
6
+ * The dialect to localize to. Only supported for English (`en`).
7
7
  */
8
8
  export declare type LocalizeDialect =
9
9
  /**
10
10
  * Only available when language is set to English (`en`).
11
11
  * */
12
- Cartesia.LocalizeEnglishDialect
13
- /**
14
- * The standard dialect for the language.
15
- * */
16
- | "st";
12
+ Cartesia.LocalizeEnglishDialect;
@@ -10,6 +10,6 @@ export declare const Controls: core.serialization.ObjectSchema<serializers.Contr
10
10
  export declare namespace Controls {
11
11
  interface Raw {
12
12
  speed: Speed.Raw;
13
- emotion: Emotion.Raw;
13
+ emotion: Emotion.Raw[];
14
14
  }
15
15
  }
@@ -32,5 +32,5 @@ const Speed_1 = require("./Speed");
32
32
  const Emotion_1 = require("./Emotion");
33
33
  exports.Controls = core.serialization.object({
34
34
  speed: Speed_1.Speed,
35
- emotion: Emotion_1.Emotion,
35
+ emotion: core.serialization.list(Emotion_1.Emotion),
36
36
  });
@@ -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" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness" | "curiosity:low" | "curiosity" | "curiosity:high" | "curiosity:highest";
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
  ]);
@@ -7,5 +7,5 @@ import * as core from "../../../../core";
7
7
  import { LocalizeEnglishDialect } from "./LocalizeEnglishDialect";
8
8
  export declare const LocalizeDialect: core.serialization.Schema<serializers.LocalizeDialect.Raw, Cartesia.LocalizeDialect>;
9
9
  export declare namespace LocalizeDialect {
10
- type Raw = LocalizeEnglishDialect.Raw | "st";
10
+ type Raw = LocalizeEnglishDialect.Raw;
11
11
  }
@@ -29,4 +29,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.LocalizeDialect = void 0;
30
30
  const core = __importStar(require("../../../../core"));
31
31
  const LocalizeEnglishDialect_1 = require("./LocalizeEnglishDialect");
32
- exports.LocalizeDialect = core.serialization.undiscriminatedUnion([LocalizeEnglishDialect_1.LocalizeEnglishDialect, core.serialization.stringLiteral("st")]);
32
+ exports.LocalizeDialect = core.serialization.undiscriminatedUnion([LocalizeEnglishDialect_1.LocalizeEnglishDialect]);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.1.0-alpha0";
1
+ export declare const SDK_VERSION = "2.1.1";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.1.0-alpha0";
4
+ exports.SDK_VERSION = "2.1.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartesia/cartesia-js",
3
- "version": "2.1.0-alpha0",
3
+ "version": "2.1.1",
4
4
  "private": false,
5
5
  "repository": "https://github.com/cartesia-ai/cartesia-js",
6
6
  "main": "./index.js",
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: "string",
327
- transcript: "string",
326
+ modelId: "sonic-english",
327
+ transcript: "Hello, world!",
328
328
  voice: {
329
329
  mode: "id",
330
- id: "string",
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);
@@ -10,6 +10,6 @@ export declare const Controls: core.serialization.ObjectSchema<serializers.Contr
10
10
  export declare namespace Controls {
11
11
  interface Raw {
12
12
  speed: Speed.Raw;
13
- emotion: Emotion.Raw;
13
+ emotion: Emotion.Raw[];
14
14
  }
15
15
  }
@@ -32,5 +32,5 @@ const Speed_1 = require("./Speed");
32
32
  const Emotion_1 = require("./Emotion");
33
33
  exports.Controls = core.serialization.object({
34
34
  speed: Speed_1.Speed,
35
- emotion: Emotion_1.Emotion,
35
+ emotion: core.serialization.list(Emotion_1.Emotion),
36
36
  });
@@ -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" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness" | "curiosity:low" | "curiosity" | "curiosity:high" | "curiosity:highest";
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
  ]);
@@ -7,5 +7,5 @@ import * as core from "../../../../core";
7
7
  import { LocalizeEnglishDialect } from "./LocalizeEnglishDialect";
8
8
  export declare const LocalizeDialect: core.serialization.Schema<serializers.LocalizeDialect.Raw, Cartesia.LocalizeDialect>;
9
9
  export declare namespace LocalizeDialect {
10
- type Raw = LocalizeEnglishDialect.Raw | "st";
10
+ type Raw = LocalizeEnglishDialect.Raw;
11
11
  }
@@ -29,4 +29,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.LocalizeDialect = void 0;
30
30
  const core = __importStar(require("../../../../core"));
31
31
  const LocalizeEnglishDialect_1 = require("./LocalizeEnglishDialect");
32
- exports.LocalizeDialect = core.serialization.undiscriminatedUnion([LocalizeEnglishDialect_1.LocalizeEnglishDialect, core.serialization.stringLiteral("st")]);
32
+ exports.LocalizeDialect = core.serialization.undiscriminatedUnion([LocalizeEnglishDialect_1.LocalizeEnglishDialect]);
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.1.0-alpha0";
1
+ export declare const SDK_VERSION = "2.1.1";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.1.0-alpha0";
4
+ exports.SDK_VERSION = "2.1.1";