@cartesia/cartesia-js 2.2.5 → 2.2.7

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 (195) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +11 -6
  3. package/README.md +469 -144
  4. package/api/resources/apiStatus/client/Client.js +1 -1
  5. package/api/resources/auth/client/Client.d.ts +17 -0
  6. package/api/resources/auth/client/Client.js +18 -1
  7. package/api/resources/auth/types/TokenGrant.d.ts +3 -1
  8. package/api/resources/auth/types/TokenRequest.d.ts +2 -2
  9. package/api/resources/index.d.ts +1 -0
  10. package/api/resources/index.js +1 -0
  11. package/api/resources/infill/client/Client.js +1 -1
  12. package/api/resources/infill/client/requests/InfillBytesRequest.d.ts +3 -11
  13. package/api/resources/stt/client/Client.d.ts +43 -0
  14. package/api/resources/stt/client/Client.js +108 -0
  15. package/api/resources/stt/client/index.d.ts +1 -1
  16. package/api/resources/stt/client/index.js +15 -3
  17. package/api/resources/stt/client/requests/TranscriptionRequest.d.ts +147 -0
  18. package/api/resources/stt/client/requests/TranscriptionRequest.js +5 -0
  19. package/api/resources/stt/client/requests/index.d.ts +1 -0
  20. package/api/resources/stt/client/requests/index.js +2 -0
  21. package/api/resources/stt/index.d.ts +1 -0
  22. package/api/resources/stt/index.js +1 -0
  23. package/api/resources/stt/types/TimestampGranularity.d.ts +12 -0
  24. package/api/resources/stt/types/TimestampGranularity.js +9 -0
  25. package/api/resources/stt/types/TranscriptMessage.d.ts +1 -1
  26. package/api/resources/stt/types/TranscriptionResponse.d.ts +2 -2
  27. package/api/resources/stt/types/index.d.ts +1 -0
  28. package/api/resources/stt/types/index.js +1 -0
  29. package/api/resources/tts/client/Client.d.ts +7 -2
  30. package/api/resources/tts/client/Client.js +8 -8
  31. package/api/resources/tts/types/Controls.d.ts +1 -1
  32. package/api/resources/tts/types/Emotion.d.ts +2 -33
  33. package/api/resources/tts/types/Emotion.js +0 -28
  34. package/api/resources/tts/types/EmotionDeprecated.d.ts +38 -0
  35. package/api/resources/tts/types/EmotionDeprecated.js +33 -0
  36. package/api/resources/tts/types/GenerationConfig.d.ts +15 -0
  37. package/api/resources/tts/types/GenerationConfig.js +5 -0
  38. package/api/resources/tts/types/GenerationRequest.d.ts +5 -4
  39. package/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
  40. package/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
  41. package/api/resources/tts/types/SseOutputFormat.d.ts +10 -0
  42. package/api/resources/tts/types/SseOutputFormat.js +5 -0
  43. package/api/resources/tts/types/TtsRequest.d.ts +1 -0
  44. package/api/resources/tts/types/TtssseRequest.d.ts +27 -0
  45. package/api/resources/tts/types/TtssseRequest.js +5 -0
  46. package/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +1 -0
  47. package/api/resources/tts/types/WebSocketRequest.d.ts +2 -4
  48. package/api/resources/tts/types/WebSocketTtsRequest.d.ts +4 -1
  49. package/api/resources/tts/types/index.d.ts +5 -1
  50. package/api/resources/tts/types/index.js +5 -1
  51. package/api/resources/voiceChanger/client/Client.d.ts +9 -4
  52. package/api/resources/voiceChanger/client/Client.js +24 -20
  53. package/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +3 -8
  54. package/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +3 -8
  55. package/api/resources/voices/client/Client.js +8 -8
  56. package/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +6 -24
  57. package/api/resources/voices/types/LocalizeDialect.d.ts +4 -8
  58. package/core/fetcher/Fetcher.d.ts +2 -2
  59. package/core/fetcher/Fetcher.js +4 -3
  60. package/core/fetcher/getResponseBody.js +3 -3
  61. package/dist/Client.d.ts +3 -0
  62. package/dist/Client.js +11 -6
  63. package/dist/api/resources/apiStatus/client/Client.js +1 -1
  64. package/dist/api/resources/auth/client/Client.d.ts +17 -0
  65. package/dist/api/resources/auth/client/Client.js +18 -1
  66. package/dist/api/resources/auth/types/TokenGrant.d.ts +3 -1
  67. package/dist/api/resources/auth/types/TokenRequest.d.ts +2 -2
  68. package/dist/api/resources/index.d.ts +1 -0
  69. package/dist/api/resources/index.js +1 -0
  70. package/dist/api/resources/infill/client/Client.js +1 -1
  71. package/dist/api/resources/infill/client/requests/InfillBytesRequest.d.ts +3 -11
  72. package/dist/api/resources/stt/client/Client.d.ts +43 -0
  73. package/dist/api/resources/stt/client/Client.js +108 -0
  74. package/dist/api/resources/stt/client/index.d.ts +1 -1
  75. package/dist/api/resources/stt/client/index.js +15 -3
  76. package/dist/api/resources/stt/client/requests/TranscriptionRequest.d.ts +147 -0
  77. package/dist/api/resources/stt/client/requests/TranscriptionRequest.js +5 -0
  78. package/dist/api/resources/stt/client/requests/index.d.ts +1 -0
  79. package/dist/api/resources/stt/client/requests/index.js +2 -0
  80. package/dist/api/resources/stt/index.d.ts +1 -0
  81. package/dist/api/resources/stt/index.js +1 -0
  82. package/dist/api/resources/stt/types/TimestampGranularity.d.ts +12 -0
  83. package/dist/api/resources/stt/types/TimestampGranularity.js +9 -0
  84. package/dist/api/resources/stt/types/TranscriptMessage.d.ts +1 -1
  85. package/dist/api/resources/stt/types/TranscriptionResponse.d.ts +2 -2
  86. package/dist/api/resources/stt/types/index.d.ts +1 -0
  87. package/dist/api/resources/stt/types/index.js +1 -0
  88. package/dist/api/resources/tts/client/Client.d.ts +7 -2
  89. package/dist/api/resources/tts/client/Client.js +8 -8
  90. package/dist/api/resources/tts/types/Controls.d.ts +1 -1
  91. package/dist/api/resources/tts/types/Emotion.d.ts +2 -33
  92. package/dist/api/resources/tts/types/Emotion.js +0 -28
  93. package/dist/api/resources/tts/types/EmotionDeprecated.d.ts +38 -0
  94. package/dist/api/resources/tts/types/EmotionDeprecated.js +33 -0
  95. package/dist/api/resources/tts/types/GenerationConfig.d.ts +15 -0
  96. package/dist/api/resources/tts/types/GenerationConfig.js +5 -0
  97. package/dist/api/resources/tts/types/GenerationRequest.d.ts +5 -4
  98. package/dist/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
  99. package/dist/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
  100. package/dist/api/resources/tts/types/SseOutputFormat.d.ts +10 -0
  101. package/dist/api/resources/tts/types/SseOutputFormat.js +5 -0
  102. package/dist/api/resources/tts/types/TtsRequest.d.ts +1 -0
  103. package/dist/api/resources/tts/types/TtssseRequest.d.ts +27 -0
  104. package/dist/api/resources/tts/types/TtssseRequest.js +5 -0
  105. package/dist/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +1 -0
  106. package/dist/api/resources/tts/types/WebSocketRequest.d.ts +2 -4
  107. package/dist/api/resources/tts/types/WebSocketTtsRequest.d.ts +4 -1
  108. package/dist/api/resources/tts/types/index.d.ts +5 -1
  109. package/dist/api/resources/tts/types/index.js +5 -1
  110. package/dist/api/resources/voiceChanger/client/Client.d.ts +9 -4
  111. package/dist/api/resources/voiceChanger/client/Client.js +24 -20
  112. package/dist/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +3 -8
  113. package/dist/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +3 -8
  114. package/dist/api/resources/voices/client/Client.js +8 -8
  115. package/dist/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +6 -24
  116. package/dist/api/resources/voices/types/LocalizeDialect.d.ts +4 -8
  117. package/dist/core/fetcher/Fetcher.d.ts +2 -2
  118. package/dist/core/fetcher/Fetcher.js +4 -3
  119. package/dist/core/fetcher/getResponseBody.js +3 -3
  120. package/dist/index.d.ts +2 -0
  121. package/dist/index.js +8 -1
  122. package/dist/serialization/resources/auth/types/TokenGrant.d.ts +2 -1
  123. package/dist/serialization/resources/auth/types/TokenGrant.js +2 -1
  124. package/dist/serialization/resources/auth/types/TokenRequest.d.ts +1 -1
  125. package/dist/serialization/resources/auth/types/TokenRequest.js +1 -1
  126. package/dist/serialization/resources/stt/types/TimestampGranularity.d.ts +10 -0
  127. package/dist/serialization/resources/stt/types/TimestampGranularity.js +41 -0
  128. package/dist/serialization/resources/stt/types/index.d.ts +1 -0
  129. package/dist/serialization/resources/stt/types/index.js +1 -0
  130. package/dist/serialization/resources/tts/types/Controls.d.ts +2 -2
  131. package/dist/serialization/resources/tts/types/Controls.js +2 -2
  132. package/dist/serialization/resources/tts/types/Emotion.d.ts +1 -1
  133. package/dist/serialization/resources/tts/types/Emotion.js +1 -27
  134. package/dist/serialization/resources/tts/types/EmotionDeprecated.d.ts +10 -0
  135. package/dist/serialization/resources/tts/types/EmotionDeprecated.js +67 -0
  136. package/dist/serialization/resources/tts/types/GenerationConfig.d.ts +15 -0
  137. package/dist/serialization/resources/tts/types/GenerationConfig.js +46 -0
  138. package/dist/serialization/resources/tts/types/GenerationRequest.d.ts +3 -1
  139. package/dist/serialization/resources/tts/types/GenerationRequest.js +3 -1
  140. package/dist/serialization/resources/tts/types/SseOutputFormat.d.ts +15 -0
  141. package/dist/serialization/resources/tts/types/SseOutputFormat.js +46 -0
  142. package/dist/serialization/resources/tts/types/TtsRequest.d.ts +2 -0
  143. package/dist/serialization/resources/tts/types/TtsRequest.js +2 -0
  144. package/dist/serialization/resources/tts/types/TtssseRequest.d.ts +29 -0
  145. package/dist/serialization/resources/tts/types/TtssseRequest.js +60 -0
  146. package/dist/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +3 -1
  147. package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +3 -1
  148. package/dist/serialization/resources/tts/types/index.d.ts +5 -1
  149. package/dist/serialization/resources/tts/types/index.js +5 -1
  150. package/dist/version.d.ts +1 -1
  151. package/dist/version.js +1 -1
  152. package/dist/wrapper/StreamingSTTClient.d.ts +22 -2
  153. package/dist/wrapper/StreamingSTTClient.js +124 -1
  154. package/dist/wrapper/SttWebsocket.d.ts +8 -3
  155. package/dist/wrapper/SttWebsocket.js +24 -3
  156. package/dist/wrapper/Websocket.js +1 -1
  157. package/index.d.ts +2 -0
  158. package/index.js +8 -1
  159. package/package.json +1 -1
  160. package/reference.md +89 -1
  161. package/serialization/resources/auth/types/TokenGrant.d.ts +2 -1
  162. package/serialization/resources/auth/types/TokenGrant.js +2 -1
  163. package/serialization/resources/auth/types/TokenRequest.d.ts +1 -1
  164. package/serialization/resources/auth/types/TokenRequest.js +1 -1
  165. package/serialization/resources/stt/types/TimestampGranularity.d.ts +10 -0
  166. package/serialization/resources/stt/types/TimestampGranularity.js +41 -0
  167. package/serialization/resources/stt/types/index.d.ts +1 -0
  168. package/serialization/resources/stt/types/index.js +1 -0
  169. package/serialization/resources/tts/types/Controls.d.ts +2 -2
  170. package/serialization/resources/tts/types/Controls.js +2 -2
  171. package/serialization/resources/tts/types/Emotion.d.ts +1 -1
  172. package/serialization/resources/tts/types/Emotion.js +1 -27
  173. package/serialization/resources/tts/types/EmotionDeprecated.d.ts +10 -0
  174. package/serialization/resources/tts/types/EmotionDeprecated.js +67 -0
  175. package/serialization/resources/tts/types/GenerationConfig.d.ts +15 -0
  176. package/serialization/resources/tts/types/GenerationConfig.js +46 -0
  177. package/serialization/resources/tts/types/GenerationRequest.d.ts +3 -1
  178. package/serialization/resources/tts/types/GenerationRequest.js +3 -1
  179. package/serialization/resources/tts/types/SseOutputFormat.d.ts +15 -0
  180. package/serialization/resources/tts/types/SseOutputFormat.js +46 -0
  181. package/serialization/resources/tts/types/TtsRequest.d.ts +2 -0
  182. package/serialization/resources/tts/types/TtsRequest.js +2 -0
  183. package/serialization/resources/tts/types/TtssseRequest.d.ts +29 -0
  184. package/serialization/resources/tts/types/TtssseRequest.js +60 -0
  185. package/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +3 -1
  186. package/serialization/resources/tts/types/WebSocketTtsRequest.js +3 -1
  187. package/serialization/resources/tts/types/index.d.ts +5 -1
  188. package/serialization/resources/tts/types/index.js +5 -1
  189. package/version.d.ts +1 -1
  190. package/version.js +1 -1
  191. package/wrapper/StreamingSTTClient.d.ts +22 -2
  192. package/wrapper/StreamingSTTClient.js +124 -1
  193. package/wrapper/SttWebsocket.d.ts +8 -3
  194. package/wrapper/SttWebsocket.js +24 -3
  195. package/wrapper/Websocket.js +1 -1
package/dist/index.js CHANGED
@@ -32,13 +32,20 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.CartesiaTimeoutError = exports.CartesiaError = exports.CartesiaEnvironment = exports.WebPlayer = exports.CartesiaClient = exports.Cartesia = void 0;
39
+ exports.CartesiaTimeoutError = exports.CartesiaError = exports.CartesiaEnvironment = exports.StreamingSTTClient = exports.SttWebsocket = exports.WebPlayer = exports.CartesiaClient = exports.Cartesia = void 0;
37
40
  exports.Cartesia = __importStar(require("./api"));
38
41
  var Client_1 = require("./wrapper/Client");
39
42
  Object.defineProperty(exports, "CartesiaClient", { enumerable: true, get: function () { return Client_1.CartesiaClient; } });
40
43
  var WebPlayer_1 = require("./wrapper/WebPlayer");
41
44
  Object.defineProperty(exports, "WebPlayer", { enumerable: true, get: function () { return WebPlayer_1.WebPlayer; } });
45
+ var SttWebsocket_1 = require("./wrapper/SttWebsocket");
46
+ Object.defineProperty(exports, "SttWebsocket", { enumerable: true, get: function () { return __importDefault(SttWebsocket_1).default; } });
47
+ var StreamingSTTClient_1 = require("./wrapper/StreamingSTTClient");
48
+ Object.defineProperty(exports, "StreamingSTTClient", { enumerable: true, get: function () { return StreamingSTTClient_1.StreamingSTTClient; } });
42
49
  var environments_1 = require("./environments");
43
50
  Object.defineProperty(exports, "CartesiaEnvironment", { enumerable: true, get: function () { return environments_1.CartesiaEnvironment; } });
44
51
  var errors_1 = require("./errors");
@@ -7,6 +7,7 @@ import * as core from "../../../../core";
7
7
  export declare const TokenGrant: core.serialization.ObjectSchema<serializers.TokenGrant.Raw, Cartesia.TokenGrant>;
8
8
  export declare namespace TokenGrant {
9
9
  interface Raw {
10
- tts: boolean;
10
+ tts?: boolean | null;
11
+ stt?: boolean | null;
11
12
  }
12
13
  }
@@ -39,5 +39,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.TokenGrant = void 0;
40
40
  const core = __importStar(require("../../../../core"));
41
41
  exports.TokenGrant = core.serialization.object({
42
- tts: core.serialization.boolean(),
42
+ tts: core.serialization.boolean().optional(),
43
+ stt: core.serialization.boolean().optional(),
43
44
  });
@@ -8,7 +8,7 @@ import { TokenGrant } from "./TokenGrant";
8
8
  export declare const TokenRequest: core.serialization.ObjectSchema<serializers.TokenRequest.Raw, Cartesia.TokenRequest>;
9
9
  export declare namespace TokenRequest {
10
10
  interface Raw {
11
- grants: TokenGrant.Raw;
11
+ grants?: TokenGrant.Raw | null;
12
12
  expires_in?: number | null;
13
13
  }
14
14
  }
@@ -40,6 +40,6 @@ exports.TokenRequest = void 0;
40
40
  const core = __importStar(require("../../../../core"));
41
41
  const TokenGrant_1 = require("./TokenGrant");
42
42
  exports.TokenRequest = core.serialization.object({
43
- grants: TokenGrant_1.TokenGrant,
43
+ grants: TokenGrant_1.TokenGrant.optional(),
44
44
  expiresIn: core.serialization.property("expires_in", core.serialization.number().optional()),
45
45
  });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index";
5
+ import * as Cartesia from "../../../../api/index";
6
+ import * as core from "../../../../core";
7
+ export declare const TimestampGranularity: core.serialization.Schema<serializers.TimestampGranularity.Raw, Cartesia.TimestampGranularity>;
8
+ export declare namespace TimestampGranularity {
9
+ type Raw = "word";
10
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.TimestampGranularity = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.TimestampGranularity = core.serialization.enum_(["word"]);
@@ -1,3 +1,4 @@
1
+ export * from "./TimestampGranularity";
1
2
  export * from "./TranscriptionWord";
2
3
  export * from "./TranscriptionResponse";
3
4
  export * from "./StreamingTranscriptionResponse";
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./TimestampGranularity"), exports);
17
18
  __exportStar(require("./TranscriptionWord"), exports);
18
19
  __exportStar(require("./TranscriptionResponse"), exports);
19
20
  __exportStar(require("./StreamingTranscriptionResponse"), exports);
@@ -5,11 +5,11 @@ import * as serializers from "../../../index";
5
5
  import * as Cartesia from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
7
  import { Speed } from "./Speed";
8
- import { Emotion } from "./Emotion";
8
+ import { EmotionDeprecated } from "./EmotionDeprecated";
9
9
  export declare const Controls: core.serialization.ObjectSchema<serializers.Controls.Raw, Cartesia.Controls>;
10
10
  export declare namespace Controls {
11
11
  interface Raw {
12
12
  speed: Speed.Raw;
13
- emotion: Emotion.Raw[];
13
+ emotion: EmotionDeprecated.Raw[];
14
14
  }
15
15
  }
@@ -39,8 +39,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Controls = void 0;
40
40
  const core = __importStar(require("../../../../core"));
41
41
  const Speed_1 = require("./Speed");
42
- const Emotion_1 = require("./Emotion");
42
+ const EmotionDeprecated_1 = require("./EmotionDeprecated");
43
43
  exports.Controls = core.serialization.object({
44
44
  speed: Speed_1.Speed,
45
- emotion: core.serialization.list(Emotion_1.Emotion),
45
+ emotion: core.serialization.list(EmotionDeprecated_1.EmotionDeprecated),
46
46
  });
@@ -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:low" | "surprise" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness" | "sadness:high" | "sadness:highest" | "curiosity:lowest" | "curiosity:low" | "curiosity" | "curiosity:high" | "curiosity:highest";
9
+ type Raw = string;
10
10
  }
@@ -38,30 +38,4 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.Emotion = void 0;
40
40
  const core = __importStar(require("../../../../core"));
41
- exports.Emotion = core.serialization.enum_([
42
- "anger:lowest",
43
- "anger:low",
44
- "anger",
45
- "anger:high",
46
- "anger:highest",
47
- "positivity:lowest",
48
- "positivity:low",
49
- "positivity",
50
- "positivity:high",
51
- "positivity:highest",
52
- "surprise:lowest",
53
- "surprise:low",
54
- "surprise",
55
- "surprise:high",
56
- "surprise:highest",
57
- "sadness:lowest",
58
- "sadness:low",
59
- "sadness",
60
- "sadness:high",
61
- "sadness:highest",
62
- "curiosity:lowest",
63
- "curiosity:low",
64
- "curiosity",
65
- "curiosity:high",
66
- "curiosity:highest",
67
- ]);
41
+ exports.Emotion = core.serialization.string();
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index";
5
+ import * as Cartesia from "../../../../api/index";
6
+ import * as core from "../../../../core";
7
+ export declare const EmotionDeprecated: core.serialization.Schema<serializers.EmotionDeprecated.Raw, Cartesia.EmotionDeprecated>;
8
+ export declare namespace EmotionDeprecated {
9
+ type Raw = "anger:lowest" | "anger:low" | "anger" | "anger:high" | "anger:highest" | "positivity:lowest" | "positivity:low" | "positivity" | "positivity:high" | "positivity:highest" | "surprise:lowest" | "surprise:low" | "surprise" | "surprise:high" | "surprise:highest" | "sadness:lowest" | "sadness:low" | "sadness" | "sadness:high" | "sadness:highest" | "curiosity:lowest" | "curiosity:low" | "curiosity" | "curiosity:high" | "curiosity:highest";
10
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.EmotionDeprecated = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.EmotionDeprecated = core.serialization.enum_([
42
+ "anger:lowest",
43
+ "anger:low",
44
+ "anger",
45
+ "anger:high",
46
+ "anger:highest",
47
+ "positivity:lowest",
48
+ "positivity:low",
49
+ "positivity",
50
+ "positivity:high",
51
+ "positivity:highest",
52
+ "surprise:lowest",
53
+ "surprise:low",
54
+ "surprise",
55
+ "surprise:high",
56
+ "surprise:highest",
57
+ "sadness:lowest",
58
+ "sadness:low",
59
+ "sadness",
60
+ "sadness:high",
61
+ "sadness:highest",
62
+ "curiosity:lowest",
63
+ "curiosity:low",
64
+ "curiosity",
65
+ "curiosity:high",
66
+ "curiosity:highest",
67
+ ]);
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index";
5
+ import * as Cartesia from "../../../../api/index";
6
+ import * as core from "../../../../core";
7
+ import { Emotion } from "./Emotion";
8
+ export declare const GenerationConfig: core.serialization.ObjectSchema<serializers.GenerationConfig.Raw, Cartesia.GenerationConfig>;
9
+ export declare namespace GenerationConfig {
10
+ interface Raw {
11
+ volume?: number | null;
12
+ speed?: number | null;
13
+ emotion?: Emotion.Raw | null;
14
+ }
15
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.GenerationConfig = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ const Emotion_1 = require("./Emotion");
42
+ exports.GenerationConfig = core.serialization.object({
43
+ volume: core.serialization.number().optional(),
44
+ speed: core.serialization.number().optional(),
45
+ emotion: Emotion_1.Emotion.optional(),
46
+ });
@@ -7,6 +7,7 @@ import * as core from "../../../../core";
7
7
  import { TtsRequestVoiceSpecifier } from "./TtsRequestVoiceSpecifier";
8
8
  import { SupportedLanguage } from "./SupportedLanguage";
9
9
  import { WebSocketRawOutputFormat } from "./WebSocketRawOutputFormat";
10
+ import { GenerationConfig } from "./GenerationConfig";
10
11
  import { ModelSpeed } from "./ModelSpeed";
11
12
  import { ContextId } from "./ContextId";
12
13
  export declare const GenerationRequest: core.serialization.ObjectSchema<serializers.GenerationRequest.Raw, Cartesia.GenerationRequest>;
@@ -17,6 +18,7 @@ export declare namespace GenerationRequest {
17
18
  voice: TtsRequestVoiceSpecifier.Raw;
18
19
  language?: SupportedLanguage.Raw | null;
19
20
  output_format: WebSocketRawOutputFormat.Raw;
21
+ generation_config?: GenerationConfig.Raw | null;
20
22
  duration?: number | null;
21
23
  speed?: ModelSpeed.Raw | null;
22
24
  context_id?: ContextId.Raw | null;
@@ -25,6 +27,6 @@ export declare namespace GenerationRequest {
25
27
  flush?: boolean | null;
26
28
  add_timestamps?: boolean | null;
27
29
  add_phoneme_timestamps?: boolean | null;
28
- use_original_timestamps?: boolean | null;
30
+ use_normalized_timestamps?: boolean | null;
29
31
  }
30
32
  }
@@ -41,6 +41,7 @@ const core = __importStar(require("../../../../core"));
41
41
  const TtsRequestVoiceSpecifier_1 = require("./TtsRequestVoiceSpecifier");
42
42
  const SupportedLanguage_1 = require("./SupportedLanguage");
43
43
  const WebSocketRawOutputFormat_1 = require("./WebSocketRawOutputFormat");
44
+ const GenerationConfig_1 = require("./GenerationConfig");
44
45
  const ModelSpeed_1 = require("./ModelSpeed");
45
46
  const ContextId_1 = require("./ContextId");
46
47
  exports.GenerationRequest = core.serialization.object({
@@ -49,6 +50,7 @@ exports.GenerationRequest = core.serialization.object({
49
50
  voice: TtsRequestVoiceSpecifier_1.TtsRequestVoiceSpecifier,
50
51
  language: SupportedLanguage_1.SupportedLanguage.optional(),
51
52
  outputFormat: core.serialization.property("output_format", WebSocketRawOutputFormat_1.WebSocketRawOutputFormat),
53
+ generationConfig: core.serialization.property("generation_config", GenerationConfig_1.GenerationConfig.optional()),
52
54
  duration: core.serialization.number().optional(),
53
55
  speed: ModelSpeed_1.ModelSpeed.optional(),
54
56
  contextId: core.serialization.property("context_id", ContextId_1.ContextId.optional()),
@@ -57,5 +59,5 @@ exports.GenerationRequest = core.serialization.object({
57
59
  flush: core.serialization.boolean().optional(),
58
60
  addTimestamps: core.serialization.property("add_timestamps", core.serialization.boolean().optional()),
59
61
  addPhonemeTimestamps: core.serialization.property("add_phoneme_timestamps", core.serialization.boolean().optional()),
60
- useOriginalTimestamps: core.serialization.property("use_original_timestamps", core.serialization.boolean().optional()),
62
+ useNormalizedTimestamps: core.serialization.property("use_normalized_timestamps", core.serialization.boolean().optional()),
61
63
  });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index";
5
+ import * as Cartesia from "../../../../api/index";
6
+ import * as core from "../../../../core";
7
+ import { RawEncoding } from "./RawEncoding";
8
+ export declare const SseOutputFormat: core.serialization.ObjectSchema<serializers.SseOutputFormat.Raw, Cartesia.SseOutputFormat>;
9
+ export declare namespace SseOutputFormat {
10
+ interface Raw {
11
+ container: "raw";
12
+ encoding: RawEncoding.Raw;
13
+ sample_rate: number;
14
+ }
15
+ }
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.SseOutputFormat = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ const RawEncoding_1 = require("./RawEncoding");
42
+ exports.SseOutputFormat = core.serialization.object({
43
+ container: core.serialization.stringLiteral("raw"),
44
+ encoding: RawEncoding_1.RawEncoding,
45
+ sampleRate: core.serialization.property("sample_rate", core.serialization.number()),
46
+ });
@@ -7,6 +7,7 @@ import * as core from "../../../../core";
7
7
  import { TtsRequestVoiceSpecifier } from "./TtsRequestVoiceSpecifier";
8
8
  import { SupportedLanguage } from "./SupportedLanguage";
9
9
  import { OutputFormat } from "./OutputFormat";
10
+ import { GenerationConfig } from "./GenerationConfig";
10
11
  import { ModelSpeed } from "./ModelSpeed";
11
12
  export declare const TtsRequest: core.serialization.ObjectSchema<serializers.TtsRequest.Raw, Cartesia.TtsRequest>;
12
13
  export declare namespace TtsRequest {
@@ -16,6 +17,7 @@ export declare namespace TtsRequest {
16
17
  voice: TtsRequestVoiceSpecifier.Raw;
17
18
  language?: SupportedLanguage.Raw | null;
18
19
  output_format: OutputFormat.Raw;
20
+ generation_config?: GenerationConfig.Raw | null;
19
21
  duration?: number | null;
20
22
  speed?: ModelSpeed.Raw | null;
21
23
  }
@@ -41,6 +41,7 @@ const core = __importStar(require("../../../../core"));
41
41
  const TtsRequestVoiceSpecifier_1 = require("./TtsRequestVoiceSpecifier");
42
42
  const SupportedLanguage_1 = require("./SupportedLanguage");
43
43
  const OutputFormat_1 = require("./OutputFormat");
44
+ const GenerationConfig_1 = require("./GenerationConfig");
44
45
  const ModelSpeed_1 = require("./ModelSpeed");
45
46
  exports.TtsRequest = core.serialization.object({
46
47
  modelId: core.serialization.property("model_id", core.serialization.string()),
@@ -48,6 +49,7 @@ exports.TtsRequest = core.serialization.object({
48
49
  voice: TtsRequestVoiceSpecifier_1.TtsRequestVoiceSpecifier,
49
50
  language: SupportedLanguage_1.SupportedLanguage.optional(),
50
51
  outputFormat: core.serialization.property("output_format", OutputFormat_1.OutputFormat),
52
+ generationConfig: core.serialization.property("generation_config", GenerationConfig_1.GenerationConfig.optional()),
51
53
  duration: core.serialization.number().optional(),
52
54
  speed: ModelSpeed_1.ModelSpeed.optional(),
53
55
  });
@@ -0,0 +1,29 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index";
5
+ import * as Cartesia from "../../../../api/index";
6
+ import * as core from "../../../../core";
7
+ import { TtsRequestVoiceSpecifier } from "./TtsRequestVoiceSpecifier";
8
+ import { SupportedLanguage } from "./SupportedLanguage";
9
+ import { SseOutputFormat } from "./SseOutputFormat";
10
+ import { GenerationConfig } from "./GenerationConfig";
11
+ import { ModelSpeed } from "./ModelSpeed";
12
+ import { ContextId } from "./ContextId";
13
+ export declare const TtssseRequest: core.serialization.ObjectSchema<serializers.TtssseRequest.Raw, Cartesia.TtssseRequest>;
14
+ export declare namespace TtssseRequest {
15
+ interface Raw {
16
+ model_id: string;
17
+ transcript: string;
18
+ voice: TtsRequestVoiceSpecifier.Raw;
19
+ language?: SupportedLanguage.Raw | null;
20
+ output_format: SseOutputFormat.Raw;
21
+ generation_config?: GenerationConfig.Raw | null;
22
+ duration?: number | null;
23
+ speed?: ModelSpeed.Raw | null;
24
+ add_timestamps?: boolean | null;
25
+ add_phoneme_timestamps?: boolean | null;
26
+ use_normalized_timestamps?: boolean | null;
27
+ context_id?: ContextId.Raw | null;
28
+ }
29
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.TtssseRequest = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ const TtsRequestVoiceSpecifier_1 = require("./TtsRequestVoiceSpecifier");
42
+ const SupportedLanguage_1 = require("./SupportedLanguage");
43
+ const SseOutputFormat_1 = require("./SseOutputFormat");
44
+ const GenerationConfig_1 = require("./GenerationConfig");
45
+ const ModelSpeed_1 = require("./ModelSpeed");
46
+ const ContextId_1 = require("./ContextId");
47
+ exports.TtssseRequest = core.serialization.object({
48
+ modelId: core.serialization.property("model_id", core.serialization.string()),
49
+ transcript: core.serialization.string(),
50
+ voice: TtsRequestVoiceSpecifier_1.TtsRequestVoiceSpecifier,
51
+ language: SupportedLanguage_1.SupportedLanguage.optional(),
52
+ outputFormat: core.serialization.property("output_format", SseOutputFormat_1.SseOutputFormat),
53
+ generationConfig: core.serialization.property("generation_config", GenerationConfig_1.GenerationConfig.optional()),
54
+ duration: core.serialization.number().optional(),
55
+ speed: ModelSpeed_1.ModelSpeed.optional(),
56
+ addTimestamps: core.serialization.property("add_timestamps", core.serialization.boolean().optional()),
57
+ addPhonemeTimestamps: core.serialization.property("add_phoneme_timestamps", core.serialization.boolean().optional()),
58
+ useNormalizedTimestamps: core.serialization.property("use_normalized_timestamps", core.serialization.boolean().optional()),
59
+ contextId: core.serialization.property("context_id", ContextId_1.ContextId.optional()),
60
+ });
@@ -5,6 +5,7 @@ import * as serializers from "../../../index";
5
5
  import * as Cartesia from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
7
  import { OutputFormat } from "./OutputFormat";
8
+ import { GenerationConfig } from "./GenerationConfig";
8
9
  import { TtsRequestVoiceSpecifier } from "./TtsRequestVoiceSpecifier";
9
10
  import { ModelSpeed } from "./ModelSpeed";
10
11
  export declare const WebSocketTtsRequest: core.serialization.ObjectSchema<serializers.WebSocketTtsRequest.Raw, Cartesia.WebSocketTtsRequest>;
@@ -12,13 +13,14 @@ export declare namespace WebSocketTtsRequest {
12
13
  interface Raw {
13
14
  model_id: string;
14
15
  output_format?: OutputFormat.Raw | null;
16
+ generation_config?: GenerationConfig.Raw | null;
15
17
  transcript?: string | null;
16
18
  voice: TtsRequestVoiceSpecifier.Raw;
17
19
  duration?: number | null;
18
20
  language?: string | null;
19
21
  add_timestamps?: boolean | null;
20
22
  add_phoneme_timestamps?: boolean | null;
21
- use_original_timestamps?: boolean | null;
23
+ use_normalized_timestamps?: boolean | null;
22
24
  continue?: boolean | null;
23
25
  context_id?: string | null;
24
26
  max_buffer_delay_ms?: number | null;
@@ -39,18 +39,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.WebSocketTtsRequest = void 0;
40
40
  const core = __importStar(require("../../../../core"));
41
41
  const OutputFormat_1 = require("./OutputFormat");
42
+ const GenerationConfig_1 = require("./GenerationConfig");
42
43
  const TtsRequestVoiceSpecifier_1 = require("./TtsRequestVoiceSpecifier");
43
44
  const ModelSpeed_1 = require("./ModelSpeed");
44
45
  exports.WebSocketTtsRequest = core.serialization.object({
45
46
  modelId: core.serialization.property("model_id", core.serialization.string()),
46
47
  outputFormat: core.serialization.property("output_format", OutputFormat_1.OutputFormat.optional()),
48
+ generationConfig: core.serialization.property("generation_config", GenerationConfig_1.GenerationConfig.optional()),
47
49
  transcript: core.serialization.string().optional(),
48
50
  voice: TtsRequestVoiceSpecifier_1.TtsRequestVoiceSpecifier,
49
51
  duration: core.serialization.number().optional(),
50
52
  language: core.serialization.string().optional(),
51
53
  addTimestamps: core.serialization.property("add_timestamps", core.serialization.boolean().optional()),
52
54
  addPhonemeTimestamps: core.serialization.property("add_phoneme_timestamps", core.serialization.boolean().optional()),
53
- useOriginalTimestamps: core.serialization.property("use_original_timestamps", core.serialization.boolean().optional()),
55
+ useNormalizedTimestamps: core.serialization.property("use_normalized_timestamps", core.serialization.boolean().optional()),
54
56
  continue: core.serialization.boolean().optional(),
55
57
  contextId: core.serialization.property("context_id", core.serialization.string().optional()),
56
58
  maxBufferDelayMs: core.serialization.property("max_buffer_delay_ms", core.serialization.number().optional()),