@cartesia/cartesia-js 2.2.4 → 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 (219) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +11 -6
  3. package/README.md +539 -172
  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/SttEncoding.d.ts +6 -6
  24. package/api/resources/stt/types/SttEncoding.js +5 -0
  25. package/api/resources/stt/types/TimestampGranularity.d.ts +12 -0
  26. package/api/resources/stt/types/TimestampGranularity.js +9 -0
  27. package/api/resources/stt/types/TranscriptMessage.d.ts +4 -1
  28. package/api/resources/stt/types/TranscriptionResponse.d.ts +4 -1
  29. package/api/resources/stt/types/TranscriptionWord.d.ts +11 -0
  30. package/api/resources/stt/types/TranscriptionWord.js +5 -0
  31. package/api/resources/stt/types/index.d.ts +2 -0
  32. package/api/resources/stt/types/index.js +2 -0
  33. package/api/resources/tts/client/Client.d.ts +7 -2
  34. package/api/resources/tts/client/Client.js +8 -8
  35. package/api/resources/tts/types/Controls.d.ts +1 -1
  36. package/api/resources/tts/types/Emotion.d.ts +2 -33
  37. package/api/resources/tts/types/Emotion.js +0 -28
  38. package/api/resources/tts/types/EmotionDeprecated.d.ts +38 -0
  39. package/api/resources/tts/types/EmotionDeprecated.js +33 -0
  40. package/api/resources/tts/types/GenerationConfig.d.ts +15 -0
  41. package/api/resources/tts/types/GenerationConfig.js +5 -0
  42. package/api/resources/tts/types/GenerationRequest.d.ts +5 -4
  43. package/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
  44. package/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
  45. package/api/resources/tts/types/SseOutputFormat.d.ts +10 -0
  46. package/api/resources/tts/types/SseOutputFormat.js +5 -0
  47. package/api/resources/tts/types/TtsRequest.d.ts +1 -0
  48. package/api/resources/tts/types/TtssseRequest.d.ts +27 -0
  49. package/api/resources/tts/types/TtssseRequest.js +5 -0
  50. package/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +1 -0
  51. package/api/resources/tts/types/WebSocketRequest.d.ts +2 -4
  52. package/api/resources/tts/types/WebSocketTtsRequest.d.ts +4 -1
  53. package/api/resources/tts/types/index.d.ts +5 -1
  54. package/api/resources/tts/types/index.js +5 -1
  55. package/api/resources/voiceChanger/client/Client.d.ts +9 -4
  56. package/api/resources/voiceChanger/client/Client.js +24 -20
  57. package/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +3 -8
  58. package/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +3 -8
  59. package/api/resources/voices/client/Client.js +8 -8
  60. package/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +6 -24
  61. package/api/resources/voices/types/LocalizeDialect.d.ts +4 -8
  62. package/core/fetcher/Fetcher.d.ts +2 -2
  63. package/core/fetcher/Fetcher.js +4 -3
  64. package/core/fetcher/getResponseBody.js +3 -3
  65. package/dist/Client.d.ts +3 -0
  66. package/dist/Client.js +11 -6
  67. package/dist/api/resources/apiStatus/client/Client.js +1 -1
  68. package/dist/api/resources/auth/client/Client.d.ts +17 -0
  69. package/dist/api/resources/auth/client/Client.js +18 -1
  70. package/dist/api/resources/auth/types/TokenGrant.d.ts +3 -1
  71. package/dist/api/resources/auth/types/TokenRequest.d.ts +2 -2
  72. package/dist/api/resources/index.d.ts +1 -0
  73. package/dist/api/resources/index.js +1 -0
  74. package/dist/api/resources/infill/client/Client.js +1 -1
  75. package/dist/api/resources/infill/client/requests/InfillBytesRequest.d.ts +3 -11
  76. package/dist/api/resources/stt/client/Client.d.ts +43 -0
  77. package/dist/api/resources/stt/client/Client.js +108 -0
  78. package/dist/api/resources/stt/client/index.d.ts +1 -1
  79. package/dist/api/resources/stt/client/index.js +15 -3
  80. package/dist/api/resources/stt/client/requests/TranscriptionRequest.d.ts +147 -0
  81. package/dist/api/resources/stt/client/requests/TranscriptionRequest.js +5 -0
  82. package/dist/api/resources/stt/client/requests/index.d.ts +1 -0
  83. package/dist/api/resources/stt/client/requests/index.js +2 -0
  84. package/dist/api/resources/stt/index.d.ts +1 -0
  85. package/dist/api/resources/stt/index.js +1 -0
  86. package/dist/api/resources/stt/types/SttEncoding.d.ts +6 -6
  87. package/dist/api/resources/stt/types/SttEncoding.js +5 -0
  88. package/dist/api/resources/stt/types/TimestampGranularity.d.ts +12 -0
  89. package/dist/api/resources/stt/types/TimestampGranularity.js +9 -0
  90. package/dist/api/resources/stt/types/TranscriptMessage.d.ts +4 -1
  91. package/dist/api/resources/stt/types/TranscriptionResponse.d.ts +4 -1
  92. package/dist/api/resources/stt/types/TranscriptionWord.d.ts +11 -0
  93. package/dist/api/resources/stt/types/TranscriptionWord.js +5 -0
  94. package/dist/api/resources/stt/types/index.d.ts +2 -0
  95. package/dist/api/resources/stt/types/index.js +2 -0
  96. package/dist/api/resources/tts/client/Client.d.ts +7 -2
  97. package/dist/api/resources/tts/client/Client.js +8 -8
  98. package/dist/api/resources/tts/types/Controls.d.ts +1 -1
  99. package/dist/api/resources/tts/types/Emotion.d.ts +2 -33
  100. package/dist/api/resources/tts/types/Emotion.js +0 -28
  101. package/dist/api/resources/tts/types/EmotionDeprecated.d.ts +38 -0
  102. package/dist/api/resources/tts/types/EmotionDeprecated.js +33 -0
  103. package/dist/api/resources/tts/types/GenerationConfig.d.ts +15 -0
  104. package/dist/api/resources/tts/types/GenerationConfig.js +5 -0
  105. package/dist/api/resources/tts/types/GenerationRequest.d.ts +5 -4
  106. package/dist/api/resources/tts/types/Mp3OutputFormat.d.ts +1 -0
  107. package/dist/api/resources/tts/types/RawOutputFormat.d.ts +1 -0
  108. package/dist/api/resources/tts/types/SseOutputFormat.d.ts +10 -0
  109. package/dist/api/resources/tts/types/SseOutputFormat.js +5 -0
  110. package/dist/api/resources/tts/types/TtsRequest.d.ts +1 -0
  111. package/dist/api/resources/tts/types/TtssseRequest.d.ts +27 -0
  112. package/dist/api/resources/tts/types/TtssseRequest.js +5 -0
  113. package/dist/api/resources/tts/types/WebSocketRawOutputFormat.d.ts +1 -0
  114. package/dist/api/resources/tts/types/WebSocketRequest.d.ts +2 -4
  115. package/dist/api/resources/tts/types/WebSocketTtsRequest.d.ts +4 -1
  116. package/dist/api/resources/tts/types/index.d.ts +5 -1
  117. package/dist/api/resources/tts/types/index.js +5 -1
  118. package/dist/api/resources/voiceChanger/client/Client.d.ts +9 -4
  119. package/dist/api/resources/voiceChanger/client/Client.js +24 -20
  120. package/dist/api/resources/voiceChanger/client/requests/VoiceChangerBytesRequest.d.ts +3 -8
  121. package/dist/api/resources/voiceChanger/client/requests/VoiceChangerSseRequest.d.ts +3 -8
  122. package/dist/api/resources/voices/client/Client.js +8 -8
  123. package/dist/api/resources/voices/client/requests/CloneVoiceRequest.d.ts +6 -24
  124. package/dist/api/resources/voices/types/LocalizeDialect.d.ts +4 -8
  125. package/dist/core/fetcher/Fetcher.d.ts +2 -2
  126. package/dist/core/fetcher/Fetcher.js +4 -3
  127. package/dist/core/fetcher/getResponseBody.js +3 -3
  128. package/dist/index.d.ts +2 -0
  129. package/dist/index.js +8 -1
  130. package/dist/serialization/resources/auth/types/TokenGrant.d.ts +2 -1
  131. package/dist/serialization/resources/auth/types/TokenGrant.js +2 -1
  132. package/dist/serialization/resources/auth/types/TokenRequest.d.ts +1 -1
  133. package/dist/serialization/resources/auth/types/TokenRequest.js +1 -1
  134. package/dist/serialization/resources/stt/types/SttEncoding.d.ts +1 -1
  135. package/dist/serialization/resources/stt/types/SttEncoding.js +1 -1
  136. package/dist/serialization/resources/stt/types/TimestampGranularity.d.ts +10 -0
  137. package/dist/serialization/resources/stt/types/TimestampGranularity.js +41 -0
  138. package/dist/serialization/resources/stt/types/TranscriptMessage.d.ts +2 -0
  139. package/dist/serialization/resources/stt/types/TranscriptMessage.js +2 -0
  140. package/dist/serialization/resources/stt/types/TranscriptionResponse.d.ts +2 -0
  141. package/dist/serialization/resources/stt/types/TranscriptionResponse.js +2 -0
  142. package/dist/serialization/resources/stt/types/TranscriptionWord.d.ts +14 -0
  143. package/dist/serialization/resources/stt/types/TranscriptionWord.js +45 -0
  144. package/dist/serialization/resources/stt/types/index.d.ts +2 -0
  145. package/dist/serialization/resources/stt/types/index.js +2 -0
  146. package/dist/serialization/resources/tts/types/Controls.d.ts +2 -2
  147. package/dist/serialization/resources/tts/types/Controls.js +2 -2
  148. package/dist/serialization/resources/tts/types/Emotion.d.ts +1 -1
  149. package/dist/serialization/resources/tts/types/Emotion.js +1 -27
  150. package/dist/serialization/resources/tts/types/EmotionDeprecated.d.ts +10 -0
  151. package/dist/serialization/resources/tts/types/EmotionDeprecated.js +67 -0
  152. package/dist/serialization/resources/tts/types/GenerationConfig.d.ts +15 -0
  153. package/dist/serialization/resources/tts/types/GenerationConfig.js +46 -0
  154. package/dist/serialization/resources/tts/types/GenerationRequest.d.ts +3 -1
  155. package/dist/serialization/resources/tts/types/GenerationRequest.js +3 -1
  156. package/dist/serialization/resources/tts/types/SseOutputFormat.d.ts +15 -0
  157. package/dist/serialization/resources/tts/types/SseOutputFormat.js +46 -0
  158. package/dist/serialization/resources/tts/types/TtsRequest.d.ts +2 -0
  159. package/dist/serialization/resources/tts/types/TtsRequest.js +2 -0
  160. package/dist/serialization/resources/tts/types/TtssseRequest.d.ts +29 -0
  161. package/dist/serialization/resources/tts/types/TtssseRequest.js +60 -0
  162. package/dist/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +3 -1
  163. package/dist/serialization/resources/tts/types/WebSocketTtsRequest.js +3 -1
  164. package/dist/serialization/resources/tts/types/index.d.ts +5 -1
  165. package/dist/serialization/resources/tts/types/index.js +5 -1
  166. package/dist/version.d.ts +1 -1
  167. package/dist/version.js +1 -1
  168. package/dist/wrapper/StreamingSTTClient.d.ts +22 -2
  169. package/dist/wrapper/StreamingSTTClient.js +124 -1
  170. package/dist/wrapper/SttWebsocket.d.ts +8 -3
  171. package/dist/wrapper/SttWebsocket.js +24 -3
  172. package/dist/wrapper/Websocket.js +1 -1
  173. package/index.d.ts +2 -0
  174. package/index.js +8 -1
  175. package/package.json +1 -1
  176. package/reference.md +89 -1
  177. package/serialization/resources/auth/types/TokenGrant.d.ts +2 -1
  178. package/serialization/resources/auth/types/TokenGrant.js +2 -1
  179. package/serialization/resources/auth/types/TokenRequest.d.ts +1 -1
  180. package/serialization/resources/auth/types/TokenRequest.js +1 -1
  181. package/serialization/resources/stt/types/SttEncoding.d.ts +1 -1
  182. package/serialization/resources/stt/types/SttEncoding.js +1 -1
  183. package/serialization/resources/stt/types/TimestampGranularity.d.ts +10 -0
  184. package/serialization/resources/stt/types/TimestampGranularity.js +41 -0
  185. package/serialization/resources/stt/types/TranscriptMessage.d.ts +2 -0
  186. package/serialization/resources/stt/types/TranscriptMessage.js +2 -0
  187. package/serialization/resources/stt/types/TranscriptionResponse.d.ts +2 -0
  188. package/serialization/resources/stt/types/TranscriptionResponse.js +2 -0
  189. package/serialization/resources/stt/types/TranscriptionWord.d.ts +14 -0
  190. package/serialization/resources/stt/types/TranscriptionWord.js +45 -0
  191. package/serialization/resources/stt/types/index.d.ts +2 -0
  192. package/serialization/resources/stt/types/index.js +2 -0
  193. package/serialization/resources/tts/types/Controls.d.ts +2 -2
  194. package/serialization/resources/tts/types/Controls.js +2 -2
  195. package/serialization/resources/tts/types/Emotion.d.ts +1 -1
  196. package/serialization/resources/tts/types/Emotion.js +1 -27
  197. package/serialization/resources/tts/types/EmotionDeprecated.d.ts +10 -0
  198. package/serialization/resources/tts/types/EmotionDeprecated.js +67 -0
  199. package/serialization/resources/tts/types/GenerationConfig.d.ts +15 -0
  200. package/serialization/resources/tts/types/GenerationConfig.js +46 -0
  201. package/serialization/resources/tts/types/GenerationRequest.d.ts +3 -1
  202. package/serialization/resources/tts/types/GenerationRequest.js +3 -1
  203. package/serialization/resources/tts/types/SseOutputFormat.d.ts +15 -0
  204. package/serialization/resources/tts/types/SseOutputFormat.js +46 -0
  205. package/serialization/resources/tts/types/TtsRequest.d.ts +2 -0
  206. package/serialization/resources/tts/types/TtsRequest.js +2 -0
  207. package/serialization/resources/tts/types/TtssseRequest.d.ts +29 -0
  208. package/serialization/resources/tts/types/TtssseRequest.js +60 -0
  209. package/serialization/resources/tts/types/WebSocketTtsRequest.d.ts +3 -1
  210. package/serialization/resources/tts/types/WebSocketTtsRequest.js +3 -1
  211. package/serialization/resources/tts/types/index.d.ts +5 -1
  212. package/serialization/resources/tts/types/index.js +5 -1
  213. package/version.d.ts +1 -1
  214. package/version.js +1 -1
  215. package/wrapper/StreamingSTTClient.d.ts +22 -2
  216. package/wrapper/StreamingSTTClient.js +124 -1
  217. package/wrapper/SttWebsocket.d.ts +8 -3
  218. package/wrapper/SttWebsocket.js +24 -3
  219. package/wrapper/Websocket.js +1 -1
package/reference.md CHANGED
@@ -75,6 +75,7 @@ Generates a new Access Token for the client. These tokens are short-lived and sh
75
75
  await client.auth.accessToken({
76
76
  grants: {
77
77
  tts: true,
78
+ stt: true,
78
79
  },
79
80
  expiresIn: 60,
80
81
  });
@@ -217,6 +218,93 @@ await client.infill.bytes(fs.createReadStream("/path/to/your/file"), fs.createRe
217
218
  </dl>
218
219
  </details>
219
220
 
221
+ ## Stt
222
+
223
+ <details><summary><code>client.stt.<a href="/src/api/resources/stt/client/Client.ts">transcribe</a>(file, { ...params }) -> Cartesia.TranscriptionResponse</code></summary>
224
+ <dl>
225
+ <dd>
226
+
227
+ #### 📝 Description
228
+
229
+ <dl>
230
+ <dd>
231
+
232
+ <dl>
233
+ <dd>
234
+
235
+ Transcribes audio files into text using Cartesia's Speech-to-Text API.
236
+
237
+ Upload an audio file and receive a complete transcription response. Supports arbitrarily long audio files with automatic intelligent chunking for longer audio.
238
+
239
+ **Supported audio formats:** flac, m4a, mp3, mp4, mpeg, mpga, oga, ogg, wav, webm
240
+
241
+ **Response format:** Returns JSON with transcribed text, duration, and language. Include `timestamp_granularities: ["word"]` to get word-level timestamps.
242
+
243
+ **Pricing:** Batch transcription is priced at **1 credit per 2 seconds** of audio processed.
244
+
245
+ <Note>
246
+ For migrating from the OpenAI SDK, see our [OpenAI Whisper to Cartesia Ink Migration Guide](/api-reference/stt/migrate-from-open-ai).
247
+ </Note>
248
+ </dd>
249
+ </dl>
250
+ </dd>
251
+ </dl>
252
+
253
+ #### 🔌 Usage
254
+
255
+ <dl>
256
+ <dd>
257
+
258
+ <dl>
259
+ <dd>
260
+
261
+ ```typescript
262
+ await client.stt.transcribe(fs.createReadStream("/path/to/your/file"), {
263
+ model: "ink-whisper",
264
+ language: "en",
265
+ });
266
+ ```
267
+
268
+ </dd>
269
+ </dl>
270
+ </dd>
271
+ </dl>
272
+
273
+ #### ⚙️ Parameters
274
+
275
+ <dl>
276
+ <dd>
277
+
278
+ <dl>
279
+ <dd>
280
+
281
+ **file:** `File | fs.ReadStream | Blob`
282
+
283
+ </dd>
284
+ </dl>
285
+
286
+ <dl>
287
+ <dd>
288
+
289
+ **request:** `Cartesia.TranscriptionRequest`
290
+
291
+ </dd>
292
+ </dl>
293
+
294
+ <dl>
295
+ <dd>
296
+
297
+ **requestOptions:** `Stt.RequestOptions`
298
+
299
+ </dd>
300
+ </dl>
301
+ </dd>
302
+ </dl>
303
+
304
+ </dd>
305
+ </dl>
306
+ </details>
307
+
220
308
  ## Tts
221
309
 
222
310
  <details><summary><code>client.tts.<a href="/src/api/resources/tts/client/Client.ts">bytes</a>({ ...params }) -> stream.Readable</code></summary>
@@ -325,7 +413,7 @@ for await (const item of response) {
325
413
  <dl>
326
414
  <dd>
327
415
 
328
- **request:** `Cartesia.TtsRequest`
416
+ **request:** `Cartesia.TtssseRequest`
329
417
 
330
418
  </dd>
331
419
  </dl>
@@ -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
  });
@@ -6,5 +6,5 @@ import * as Cartesia from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
7
  export declare const SttEncoding: core.serialization.Schema<serializers.SttEncoding.Raw, Cartesia.SttEncoding>;
8
8
  export declare namespace SttEncoding {
9
- type Raw = "pcm_s16le";
9
+ type Raw = "pcm_s16le" | "pcm_s32le" | "pcm_f16le" | "pcm_f32le" | "pcm_mulaw" | "pcm_alaw";
10
10
  }
@@ -38,4 +38,4 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.SttEncoding = void 0;
40
40
  const core = __importStar(require("../../../../core"));
41
- exports.SttEncoding = core.serialization.enum_(["pcm_s16le"]);
41
+ exports.SttEncoding = core.serialization.enum_(["pcm_s16le", "pcm_s32le", "pcm_f16le", "pcm_f32le", "pcm_mulaw", "pcm_alaw"]);
@@ -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"]);
@@ -4,6 +4,7 @@
4
4
  import * as serializers from "../../../index";
5
5
  import * as Cartesia from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
+ import { TranscriptionWord } from "./TranscriptionWord";
7
8
  export declare const TranscriptMessage: core.serialization.ObjectSchema<serializers.TranscriptMessage.Raw, Cartesia.TranscriptMessage>;
8
9
  export declare namespace TranscriptMessage {
9
10
  interface Raw {
@@ -12,5 +13,6 @@ export declare namespace TranscriptMessage {
12
13
  is_final: boolean;
13
14
  duration?: number | null;
14
15
  language?: string | null;
16
+ words?: TranscriptionWord.Raw[] | null;
15
17
  }
16
18
  }
@@ -38,10 +38,12 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.TranscriptMessage = void 0;
40
40
  const core = __importStar(require("../../../../core"));
41
+ const TranscriptionWord_1 = require("./TranscriptionWord");
41
42
  exports.TranscriptMessage = core.serialization.object({
42
43
  requestId: core.serialization.property("request_id", core.serialization.string()),
43
44
  text: core.serialization.string(),
44
45
  isFinal: core.serialization.property("is_final", core.serialization.boolean()),
45
46
  duration: core.serialization.number().optional(),
46
47
  language: core.serialization.string().optional(),
48
+ words: core.serialization.list(TranscriptionWord_1.TranscriptionWord).optional(),
47
49
  });
@@ -4,11 +4,13 @@
4
4
  import * as serializers from "../../../index";
5
5
  import * as Cartesia from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
+ import { TranscriptionWord } from "./TranscriptionWord";
7
8
  export declare const TranscriptionResponse: core.serialization.ObjectSchema<serializers.TranscriptionResponse.Raw, Cartesia.TranscriptionResponse>;
8
9
  export declare namespace TranscriptionResponse {
9
10
  interface Raw {
10
11
  text: string;
11
12
  language?: string | null;
12
13
  duration?: number | null;
14
+ words?: TranscriptionWord.Raw[] | null;
13
15
  }
14
16
  }
@@ -38,8 +38,10 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.TranscriptionResponse = void 0;
40
40
  const core = __importStar(require("../../../../core"));
41
+ const TranscriptionWord_1 = require("./TranscriptionWord");
41
42
  exports.TranscriptionResponse = core.serialization.object({
42
43
  text: core.serialization.string(),
43
44
  language: core.serialization.string().optional(),
44
45
  duration: core.serialization.number().optional(),
46
+ words: core.serialization.list(TranscriptionWord_1.TranscriptionWord).optional(),
45
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 TranscriptionWord: core.serialization.ObjectSchema<serializers.TranscriptionWord.Raw, Cartesia.TranscriptionWord>;
8
+ export declare namespace TranscriptionWord {
9
+ interface Raw {
10
+ word: string;
11
+ start: number;
12
+ end: number;
13
+ }
14
+ }
@@ -0,0 +1,45 @@
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.TranscriptionWord = void 0;
40
+ const core = __importStar(require("../../../../core"));
41
+ exports.TranscriptionWord = core.serialization.object({
42
+ word: core.serialization.string(),
43
+ start: core.serialization.number(),
44
+ end: core.serialization.number(),
45
+ });
@@ -1,3 +1,5 @@
1
+ export * from "./TimestampGranularity";
2
+ export * from "./TranscriptionWord";
1
3
  export * from "./TranscriptionResponse";
2
4
  export * from "./StreamingTranscriptionResponse";
3
5
  export * from "./TranscriptMessage";
@@ -14,6 +14,8 @@ 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);
18
+ __exportStar(require("./TranscriptionWord"), exports);
17
19
  __exportStar(require("./TranscriptionResponse"), exports);
18
20
  __exportStar(require("./StreamingTranscriptionResponse"), exports);
19
21
  __exportStar(require("./TranscriptMessage"), 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
+ }