@cartesia/cartesia-js 2.2.2 → 2.2.4

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 (157) hide show
  1. package/README.md +58 -7
  2. package/api/resources/apiStatus/client/Client.js +1 -1
  3. package/api/resources/auth/client/Client.js +1 -1
  4. package/api/resources/index.d.ts +2 -0
  5. package/api/resources/index.js +3 -1
  6. package/api/resources/infill/client/Client.js +1 -1
  7. package/api/resources/stt/client/Client.d.ts +28 -0
  8. package/api/resources/stt/client/Client.js +58 -0
  9. package/api/resources/stt/client/index.d.ts +1 -0
  10. package/api/resources/stt/client/index.js +5 -0
  11. package/api/resources/stt/index.d.ts +1 -0
  12. package/api/resources/stt/index.js +17 -0
  13. package/api/resources/stt/types/DoneMessage.d.ts +10 -0
  14. package/api/resources/stt/types/DoneMessage.js +5 -0
  15. package/api/resources/stt/types/ErrorMessage.d.ts +9 -0
  16. package/api/resources/stt/types/ErrorMessage.js +5 -0
  17. package/api/resources/stt/types/FlushDoneMessage.d.ts +10 -0
  18. package/api/resources/stt/types/FlushDoneMessage.js +5 -0
  19. package/api/resources/stt/types/StreamingTranscriptionResponse.d.ts +22 -0
  20. package/api/resources/stt/types/StreamingTranscriptionResponse.js +5 -0
  21. package/api/resources/stt/types/SttEncoding.d.ts +15 -0
  22. package/api/resources/stt/types/SttEncoding.js +9 -0
  23. package/api/resources/stt/types/TranscriptMessage.d.ts +19 -0
  24. package/api/resources/stt/types/TranscriptMessage.js +5 -0
  25. package/api/resources/stt/types/TranscriptionResponse.d.ts +11 -0
  26. package/api/resources/stt/types/TranscriptionResponse.js +5 -0
  27. package/api/resources/stt/types/index.d.ts +7 -0
  28. package/api/resources/stt/types/index.js +23 -0
  29. package/api/resources/tts/types/GenerationRequest.d.ts +1 -8
  30. package/api/resources/tts/types/ModelSpeed.d.ts +16 -0
  31. package/api/resources/tts/types/ModelSpeed.js +11 -0
  32. package/api/resources/tts/types/TtsRequest.d.ts +1 -8
  33. package/api/resources/tts/types/WebSocketTtsRequest.d.ts +1 -1
  34. package/api/resources/tts/types/index.d.ts +1 -0
  35. package/api/resources/tts/types/index.js +1 -0
  36. package/api/resources/voices/client/Client.d.ts +2 -5
  37. package/api/resources/voices/client/Client.js +12 -15
  38. package/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +5 -8
  39. package/dist/api/resources/apiStatus/client/Client.js +1 -1
  40. package/dist/api/resources/auth/client/Client.js +1 -1
  41. package/dist/api/resources/index.d.ts +2 -0
  42. package/dist/api/resources/index.js +3 -1
  43. package/dist/api/resources/infill/client/Client.js +1 -1
  44. package/dist/api/resources/stt/client/Client.d.ts +28 -0
  45. package/dist/api/resources/stt/client/Client.js +58 -0
  46. package/dist/api/resources/stt/client/index.d.ts +1 -0
  47. package/dist/api/resources/stt/client/index.js +5 -0
  48. package/dist/api/resources/stt/index.d.ts +1 -0
  49. package/dist/api/resources/stt/index.js +17 -0
  50. package/dist/api/resources/stt/types/DoneMessage.d.ts +10 -0
  51. package/dist/api/resources/stt/types/DoneMessage.js +5 -0
  52. package/dist/api/resources/stt/types/ErrorMessage.d.ts +9 -0
  53. package/dist/api/resources/stt/types/ErrorMessage.js +5 -0
  54. package/dist/api/resources/stt/types/FlushDoneMessage.d.ts +10 -0
  55. package/dist/api/resources/stt/types/FlushDoneMessage.js +5 -0
  56. package/dist/api/resources/stt/types/StreamingTranscriptionResponse.d.ts +22 -0
  57. package/dist/api/resources/stt/types/StreamingTranscriptionResponse.js +5 -0
  58. package/dist/api/resources/stt/types/SttEncoding.d.ts +15 -0
  59. package/dist/api/resources/stt/types/SttEncoding.js +9 -0
  60. package/dist/api/resources/stt/types/TranscriptMessage.d.ts +19 -0
  61. package/dist/api/resources/stt/types/TranscriptMessage.js +5 -0
  62. package/dist/api/resources/stt/types/TranscriptionResponse.d.ts +11 -0
  63. package/dist/api/resources/stt/types/TranscriptionResponse.js +5 -0
  64. package/dist/api/resources/stt/types/index.d.ts +7 -0
  65. package/dist/api/resources/stt/types/index.js +23 -0
  66. package/dist/api/resources/tts/types/GenerationRequest.d.ts +1 -8
  67. package/dist/api/resources/tts/types/ModelSpeed.d.ts +16 -0
  68. package/dist/api/resources/tts/types/ModelSpeed.js +11 -0
  69. package/dist/api/resources/tts/types/TtsRequest.d.ts +1 -8
  70. package/dist/api/resources/tts/types/WebSocketTtsRequest.d.ts +1 -1
  71. package/dist/api/resources/tts/types/index.d.ts +1 -0
  72. package/dist/api/resources/tts/types/index.js +1 -0
  73. package/dist/api/resources/voices/client/Client.d.ts +2 -5
  74. package/dist/api/resources/voices/client/Client.js +12 -15
  75. package/dist/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +5 -8
  76. package/dist/serialization/resources/index.d.ts +2 -0
  77. package/dist/serialization/resources/index.js +3 -1
  78. package/dist/serialization/resources/stt/index.d.ts +1 -0
  79. package/dist/serialization/resources/stt/index.js +17 -0
  80. package/dist/serialization/resources/stt/types/DoneMessage.d.ts +12 -0
  81. package/dist/serialization/resources/stt/types/DoneMessage.js +43 -0
  82. package/dist/serialization/resources/stt/types/ErrorMessage.d.ts +13 -0
  83. package/dist/serialization/resources/stt/types/ErrorMessage.js +44 -0
  84. package/dist/serialization/resources/stt/types/FlushDoneMessage.d.ts +12 -0
  85. package/dist/serialization/resources/stt/types/FlushDoneMessage.js +43 -0
  86. package/dist/serialization/resources/stt/types/StreamingTranscriptionResponse.d.ts +26 -0
  87. package/dist/serialization/resources/stt/types/StreamingTranscriptionResponse.js +55 -0
  88. package/dist/serialization/resources/stt/types/SttEncoding.d.ts +10 -0
  89. package/dist/serialization/resources/stt/types/SttEncoding.js +41 -0
  90. package/dist/serialization/resources/stt/types/TranscriptMessage.d.ts +16 -0
  91. package/dist/serialization/resources/stt/types/TranscriptMessage.js +47 -0
  92. package/dist/serialization/resources/stt/types/TranscriptionResponse.d.ts +14 -0
  93. package/dist/serialization/resources/stt/types/TranscriptionResponse.js +45 -0
  94. package/dist/serialization/resources/stt/types/index.d.ts +7 -0
  95. package/dist/serialization/resources/stt/types/index.js +23 -0
  96. package/dist/serialization/resources/tts/types/GenerationRequest.d.ts +2 -1
  97. package/dist/serialization/resources/tts/types/GenerationRequest.js +2 -1
  98. package/dist/serialization/resources/tts/types/ModelSpeed.d.ts +10 -0
  99. package/dist/serialization/resources/tts/types/ModelSpeed.js +41 -0
  100. package/dist/serialization/resources/tts/types/TtsRequest.d.ts +2 -1
  101. package/dist/serialization/resources/tts/types/TtsRequest.js +2 -1
  102. package/dist/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +2 -1
  103. package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +2 -1
  104. package/dist/serialization/resources/tts/types/index.d.ts +1 -0
  105. package/dist/serialization/resources/tts/types/index.js +1 -0
  106. package/dist/version.d.ts +1 -1
  107. package/dist/version.js +1 -1
  108. package/dist/wrapper/Client.d.ts +3 -0
  109. package/dist/wrapper/Client.js +5 -0
  110. package/dist/wrapper/StreamingSTTClient.d.ts +6 -0
  111. package/dist/wrapper/StreamingSTTClient.js +17 -0
  112. package/dist/wrapper/SttWebsocket.d.ts +29 -0
  113. package/dist/wrapper/SttWebsocket.js +198 -0
  114. package/dist/wrapper/Websocket.d.ts +1 -1
  115. package/dist/wrapper/Websocket.js +24 -16
  116. package/package.json +1 -1
  117. package/reference.md +0 -1
  118. package/serialization/resources/index.d.ts +2 -0
  119. package/serialization/resources/index.js +3 -1
  120. package/serialization/resources/stt/index.d.ts +1 -0
  121. package/serialization/resources/stt/index.js +17 -0
  122. package/serialization/resources/stt/types/DoneMessage.d.ts +12 -0
  123. package/serialization/resources/stt/types/DoneMessage.js +43 -0
  124. package/serialization/resources/stt/types/ErrorMessage.d.ts +13 -0
  125. package/serialization/resources/stt/types/ErrorMessage.js +44 -0
  126. package/serialization/resources/stt/types/FlushDoneMessage.d.ts +12 -0
  127. package/serialization/resources/stt/types/FlushDoneMessage.js +43 -0
  128. package/serialization/resources/stt/types/StreamingTranscriptionResponse.d.ts +26 -0
  129. package/serialization/resources/stt/types/StreamingTranscriptionResponse.js +55 -0
  130. package/serialization/resources/stt/types/SttEncoding.d.ts +10 -0
  131. package/serialization/resources/stt/types/SttEncoding.js +41 -0
  132. package/serialization/resources/stt/types/TranscriptMessage.d.ts +16 -0
  133. package/serialization/resources/stt/types/TranscriptMessage.js +47 -0
  134. package/serialization/resources/stt/types/TranscriptionResponse.d.ts +14 -0
  135. package/serialization/resources/stt/types/TranscriptionResponse.js +45 -0
  136. package/serialization/resources/stt/types/index.d.ts +7 -0
  137. package/serialization/resources/stt/types/index.js +23 -0
  138. package/serialization/resources/tts/types/GenerationRequest.d.ts +2 -1
  139. package/serialization/resources/tts/types/GenerationRequest.js +2 -1
  140. package/serialization/resources/tts/types/ModelSpeed.d.ts +10 -0
  141. package/serialization/resources/tts/types/ModelSpeed.js +41 -0
  142. package/serialization/resources/tts/types/TtsRequest.d.ts +2 -1
  143. package/serialization/resources/tts/types/TtsRequest.js +2 -1
  144. package/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +2 -1
  145. package/serialization/resources/tts/types/WebSocketTtsRequest.js +2 -1
  146. package/serialization/resources/tts/types/index.d.ts +1 -0
  147. package/serialization/resources/tts/types/index.js +1 -0
  148. package/version.d.ts +1 -1
  149. package/version.js +1 -1
  150. package/wrapper/Client.d.ts +3 -0
  151. package/wrapper/Client.js +5 -0
  152. package/wrapper/StreamingSTTClient.d.ts +6 -0
  153. package/wrapper/StreamingSTTClient.js +17 -0
  154. package/wrapper/SttWebsocket.d.ts +29 -0
  155. package/wrapper/SttWebsocket.js +198 -0
  156. package/wrapper/Websocket.d.ts +1 -1
  157. package/wrapper/Websocket.js +24 -16
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ContextId"), exports);
18
18
  __exportStar(require("./FlushId"), exports);
19
+ __exportStar(require("./ModelSpeed"), exports);
19
20
  __exportStar(require("./WebSocketBaseResponse"), exports);
20
21
  __exportStar(require("./WebSocketResponse"), exports);
21
22
  __exportStar(require("./WebSocketErrorResponse"), exports);
@@ -55,8 +55,7 @@ export declare class Voices {
55
55
  * name: "A high-stability cloned voice",
56
56
  * description: "Copied from Cartesia docs",
57
57
  * mode: "stability",
58
- * language: "en",
59
- * enhance: true
58
+ * language: "en"
60
59
  * })
61
60
  *
62
61
  * @example
@@ -64,9 +63,7 @@ export declare class Voices {
64
63
  * name: "A high-similarity cloned voice",
65
64
  * description: "Copied from Cartesia docs",
66
65
  * mode: "similarity",
67
- * language: "en",
68
- * transcript: "A transcript of the words spoken in the audio clip.",
69
- * enhance: false
66
+ * language: "en"
70
67
  * })
71
68
  */
72
69
  clone(clip: File | fs.ReadStream | Blob, request: Cartesia.CloneVoiceRequest, requestOptions?: Voices.RequestOptions): Promise<Cartesia.VoiceMetadata>;
@@ -70,7 +70,7 @@ class Voices {
70
70
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
71
71
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/"),
72
72
  method: "GET",
73
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
73
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.4", "User-Agent": "@cartesia/cartesia-js/2.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
74
74
  contentType: "application/json",
75
75
  requestType: "json",
76
76
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -123,8 +123,7 @@ class Voices {
123
123
  * name: "A high-stability cloned voice",
124
124
  * description: "Copied from Cartesia docs",
125
125
  * mode: "stability",
126
- * language: "en",
127
- * enhance: true
126
+ * language: "en"
128
127
  * })
129
128
  *
130
129
  * @example
@@ -132,9 +131,7 @@ class Voices {
132
131
  * name: "A high-similarity cloned voice",
133
132
  * description: "Copied from Cartesia docs",
134
133
  * mode: "similarity",
135
- * language: "en",
136
- * transcript: "A transcript of the words spoken in the audio clip.",
137
- * enhance: false
134
+ * language: "en"
138
135
  * })
139
136
  */
140
137
  clone(clip, request, requestOptions) {
@@ -151,14 +148,14 @@ class Voices {
151
148
  if (request.enhance != null) {
152
149
  _request.append("enhance", request.enhance.toString());
153
150
  }
154
- if (request.transcript != null) {
155
- _request.append("transcript", request.transcript);
151
+ if (request.baseVoiceId != null) {
152
+ _request.append("base_voice_id", serializers.VoiceId.jsonOrThrow(request.baseVoiceId, { unrecognizedObjectKeys: "strip" }));
156
153
  }
157
154
  const _maybeEncodedRequest = yield _request.getRequest();
158
155
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
159
156
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/clone"),
160
157
  method: "POST",
161
- headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
158
+ headers: Object.assign(Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.4", "User-Agent": "@cartesia/cartesia-js/2.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
162
159
  requestType: "file",
163
160
  duplex: _maybeEncodedRequest.duplex,
164
161
  body: _maybeEncodedRequest.body,
@@ -209,7 +206,7 @@ class Voices {
209
206
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
210
207
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
211
208
  method: "DELETE",
212
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
209
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.4", "User-Agent": "@cartesia/cartesia-js/2.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
213
210
  contentType: "application/json",
214
211
  requestType: "json",
215
212
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -257,7 +254,7 @@ class Voices {
257
254
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
258
255
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
259
256
  method: "PATCH",
260
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
257
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.4", "User-Agent": "@cartesia/cartesia-js/2.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
261
258
  contentType: "application/json",
262
259
  requestType: "json",
263
260
  body: serializers.UpdateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -308,7 +305,7 @@ class Voices {
308
305
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
309
306
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, `/voices/${encodeURIComponent(serializers.VoiceId.jsonOrThrow(id))}`),
310
307
  method: "GET",
311
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
308
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.4", "User-Agent": "@cartesia/cartesia-js/2.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
312
309
  contentType: "application/json",
313
310
  requestType: "json",
314
311
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -367,7 +364,7 @@ class Voices {
367
364
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
368
365
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/localize"),
369
366
  method: "POST",
370
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
367
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.4", "User-Agent": "@cartesia/cartesia-js/2.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
371
368
  contentType: "application/json",
372
369
  requestType: "json",
373
370
  body: serializers.LocalizeVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -426,7 +423,7 @@ class Voices {
426
423
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
427
424
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/mix"),
428
425
  method: "POST",
429
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
426
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.4", "User-Agent": "@cartesia/cartesia-js/2.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
430
427
  contentType: "application/json",
431
428
  requestType: "json",
432
429
  body: serializers.MixVoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -485,7 +482,7 @@ class Voices {
485
482
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
486
483
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CartesiaEnvironment.Production, "/voices/"),
487
484
  method: "POST",
488
- headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.2", "User-Agent": "@cartesia/cartesia-js/2.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
485
+ headers: Object.assign(Object.assign({ "Cartesia-Version": (_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.cartesiaVersion) !== null && _f !== void 0 ? _f : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.2.4", "User-Agent": "@cartesia/cartesia-js/2.2.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
489
486
  contentType: "application/json",
490
487
  requestType: "json",
491
488
  body: serializers.CreateVoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -8,8 +8,7 @@ import * as Cartesia from "../../../../index";
8
8
  * name: "A high-stability cloned voice",
9
9
  * description: "Copied from Cartesia docs",
10
10
  * mode: "stability",
11
- * language: "en",
12
- * enhance: true
11
+ * language: "en"
13
12
  * }
14
13
  *
15
14
  * @example
@@ -17,9 +16,7 @@ import * as Cartesia from "../../../../index";
17
16
  * name: "A high-similarity cloned voice",
18
17
  * description: "Copied from Cartesia docs",
19
18
  * mode: "similarity",
20
- * language: "en",
21
- * transcript: "A transcript of the words spoken in the audio clip.",
22
- * enhance: false
19
+ * language: "en"
23
20
  * }
24
21
  */
25
22
  export interface CloneVoiceRequest {
@@ -44,13 +41,13 @@ export interface CloneVoiceRequest {
44
41
  */
45
42
  mode: Cartesia.CloneMode;
46
43
  /**
47
- * Whether to enhance the clip to improve its quality before cloning. Useful if the clip has background noise.
44
+ * Whether to apply AI enhancements to the clip to reduce background noise. This leads to cleaner generated speech at the cost of reduced similarity to the source clip.
48
45
  *
49
46
  */
50
47
  enhance?: boolean;
51
48
  /**
52
- * Optional transcript of the words spoken in the audio clip. Only used for similarity mode.
49
+ * Optional base voice ID that the cloned voice is derived from.
53
50
  *
54
51
  */
55
- transcript?: string;
52
+ baseVoiceId?: Cartesia.VoiceId;
56
53
  }
@@ -4,6 +4,8 @@ export * as auth from "./auth";
4
4
  export * from "./auth/types";
5
5
  export * as embedding from "./embedding";
6
6
  export * from "./embedding/types";
7
+ export * as stt from "./stt";
8
+ export * from "./stt/types";
7
9
  export * as tts from "./tts";
8
10
  export * from "./tts/types";
9
11
  export * as voiceChanger from "./voiceChanger";
@@ -36,13 +36,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.voices = exports.voiceChanger = exports.tts = exports.embedding = exports.auth = exports.apiStatus = void 0;
39
+ exports.voices = exports.voiceChanger = exports.tts = exports.stt = exports.embedding = exports.auth = exports.apiStatus = void 0;
40
40
  exports.apiStatus = __importStar(require("./apiStatus"));
41
41
  __exportStar(require("./apiStatus/types"), exports);
42
42
  exports.auth = __importStar(require("./auth"));
43
43
  __exportStar(require("./auth/types"), exports);
44
44
  exports.embedding = __importStar(require("./embedding"));
45
45
  __exportStar(require("./embedding/types"), exports);
46
+ exports.stt = __importStar(require("./stt"));
47
+ __exportStar(require("./stt/types"), exports);
46
48
  exports.tts = __importStar(require("./tts"));
47
49
  __exportStar(require("./tts/types"), exports);
48
50
  exports.voiceChanger = __importStar(require("./voiceChanger"));
@@ -0,0 +1 @@
1
+ export * from "./types";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,12 @@
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 DoneMessage: core.serialization.ObjectSchema<serializers.DoneMessage.Raw, Cartesia.DoneMessage>;
8
+ export declare namespace DoneMessage {
9
+ interface Raw {
10
+ request_id: string;
11
+ }
12
+ }
@@ -0,0 +1,43 @@
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.DoneMessage = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.DoneMessage = core.serialization.object({
42
+ requestId: core.serialization.property("request_id", core.serialization.string()),
43
+ });
@@ -0,0 +1,13 @@
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 ErrorMessage: core.serialization.ObjectSchema<serializers.ErrorMessage.Raw, Cartesia.ErrorMessage>;
8
+ export declare namespace ErrorMessage {
9
+ interface Raw {
10
+ request_id?: string | null;
11
+ message: string;
12
+ }
13
+ }
@@ -0,0 +1,44 @@
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.ErrorMessage = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.ErrorMessage = core.serialization.object({
42
+ requestId: core.serialization.property("request_id", core.serialization.string().optional()),
43
+ message: core.serialization.string(),
44
+ });
@@ -0,0 +1,12 @@
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 FlushDoneMessage: core.serialization.ObjectSchema<serializers.FlushDoneMessage.Raw, Cartesia.FlushDoneMessage>;
8
+ export declare namespace FlushDoneMessage {
9
+ interface Raw {
10
+ request_id: string;
11
+ }
12
+ }
@@ -0,0 +1,43 @@
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.FlushDoneMessage = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.FlushDoneMessage = core.serialization.object({
42
+ requestId: core.serialization.property("request_id", core.serialization.string()),
43
+ });
@@ -0,0 +1,26 @@
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 { TranscriptMessage } from "./TranscriptMessage";
8
+ import { FlushDoneMessage } from "./FlushDoneMessage";
9
+ import { DoneMessage } from "./DoneMessage";
10
+ import { ErrorMessage } from "./ErrorMessage";
11
+ export declare const StreamingTranscriptionResponse: core.serialization.Schema<serializers.StreamingTranscriptionResponse.Raw, Cartesia.StreamingTranscriptionResponse>;
12
+ export declare namespace StreamingTranscriptionResponse {
13
+ type Raw = StreamingTranscriptionResponse.Transcript | StreamingTranscriptionResponse.FlushDone | StreamingTranscriptionResponse.Done | StreamingTranscriptionResponse.Error;
14
+ interface Transcript extends TranscriptMessage.Raw {
15
+ type: "transcript";
16
+ }
17
+ interface FlushDone extends FlushDoneMessage.Raw {
18
+ type: "flush_done";
19
+ }
20
+ interface Done extends DoneMessage.Raw {
21
+ type: "done";
22
+ }
23
+ interface Error extends ErrorMessage.Raw {
24
+ type: "error";
25
+ }
26
+ }
@@ -0,0 +1,55 @@
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.StreamingTranscriptionResponse = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ const TranscriptMessage_1 = require("./TranscriptMessage");
42
+ const FlushDoneMessage_1 = require("./FlushDoneMessage");
43
+ const DoneMessage_1 = require("./DoneMessage");
44
+ const ErrorMessage_1 = require("./ErrorMessage");
45
+ exports.StreamingTranscriptionResponse = core.serialization
46
+ .union("type", {
47
+ transcript: TranscriptMessage_1.TranscriptMessage,
48
+ flush_done: FlushDoneMessage_1.FlushDoneMessage,
49
+ done: DoneMessage_1.DoneMessage,
50
+ error: ErrorMessage_1.ErrorMessage,
51
+ })
52
+ .transform({
53
+ transform: (value) => value,
54
+ untransform: (value) => value,
55
+ });
@@ -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 SttEncoding: core.serialization.Schema<serializers.SttEncoding.Raw, Cartesia.SttEncoding>;
8
+ export declare namespace SttEncoding {
9
+ type Raw = "pcm_s16le";
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.SttEncoding = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.SttEncoding = core.serialization.enum_(["pcm_s16le"]);
@@ -0,0 +1,16 @@
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 TranscriptMessage: core.serialization.ObjectSchema<serializers.TranscriptMessage.Raw, Cartesia.TranscriptMessage>;
8
+ export declare namespace TranscriptMessage {
9
+ interface Raw {
10
+ request_id: string;
11
+ text: string;
12
+ is_final: boolean;
13
+ duration?: number | null;
14
+ language?: string | null;
15
+ }
16
+ }
@@ -0,0 +1,47 @@
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.TranscriptMessage = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.TranscriptMessage = core.serialization.object({
42
+ requestId: core.serialization.property("request_id", core.serialization.string()),
43
+ text: core.serialization.string(),
44
+ isFinal: core.serialization.property("is_final", core.serialization.boolean()),
45
+ duration: core.serialization.number().optional(),
46
+ language: core.serialization.string().optional(),
47
+ });
@@ -0,0 +1,14 @@
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 TranscriptionResponse: core.serialization.ObjectSchema<serializers.TranscriptionResponse.Raw, Cartesia.TranscriptionResponse>;
8
+ export declare namespace TranscriptionResponse {
9
+ interface Raw {
10
+ text: string;
11
+ language?: string | null;
12
+ duration?: number | null;
13
+ }
14
+ }