@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
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
2
5
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
6
  if (k2 === undefined) k2 = k;
4
7
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -41,13 +44,118 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
41
44
  step((generator = generator.apply(thisArg, _arguments || [])).next());
42
45
  });
43
46
  };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
44
50
  Object.defineProperty(exports, "__esModule", { value: true });
45
51
  exports.Stt = void 0;
52
+ const environments = __importStar(require("../../../../environments"));
46
53
  const core = __importStar(require("../../../../core"));
54
+ const serializers = __importStar(require("../../../../serialization/index"));
55
+ const url_join_1 = __importDefault(require("url-join"));
56
+ const errors = __importStar(require("../../../../errors/index"));
47
57
  class Stt {
48
58
  constructor(_options = {}) {
49
59
  this._options = _options;
50
60
  }
61
+ /**
62
+ * Transcribes audio files into text using Cartesia's Speech-to-Text API.
63
+ *
64
+ * Upload an audio file and receive a complete transcription response. Supports arbitrarily long audio files with automatic intelligent chunking for longer audio.
65
+ *
66
+ * **Supported audio formats:** flac, m4a, mp3, mp4, mpeg, mpga, oga, ogg, wav, webm
67
+ *
68
+ * **Response format:** Returns JSON with transcribed text, duration, and language. Include `timestamp_granularities: ["word"]` to get word-level timestamps.
69
+ *
70
+ * **Pricing:** Batch transcription is priced at **1 credit per 2 seconds** of audio processed.
71
+ *
72
+ * <Note>
73
+ * For migrating from the OpenAI SDK, see our [OpenAI Whisper to Cartesia Ink Migration Guide](/api-reference/stt/migrate-from-open-ai).
74
+ * </Note>
75
+ *
76
+ * @param {File | fs.ReadStream | Blob} file
77
+ * @param {Cartesia.TranscriptionRequest} request
78
+ * @param {Stt.RequestOptions} requestOptions - Request-specific configuration.
79
+ *
80
+ * @example
81
+ * await client.stt.transcribe(fs.createReadStream("/path/to/your/file"), {
82
+ * model: "ink-whisper",
83
+ * language: "en"
84
+ * })
85
+ *
86
+ * @example
87
+ * await client.stt.transcribe(fs.createReadStream("/path/to/your/file"), {
88
+ * model: "ink-whisper",
89
+ * language: "en",
90
+ * timestampGranularities: ["word"]
91
+ * })
92
+ */
93
+ transcribe(file, request, requestOptions) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ var _a, _b, _c, _d, _e, _f;
96
+ const _queryParams = {};
97
+ if (request.encoding != null) {
98
+ _queryParams["encoding"] = serializers.SttEncoding.jsonOrThrow(request.encoding, {
99
+ unrecognizedObjectKeys: "strip",
100
+ });
101
+ }
102
+ if (request.sampleRate != null) {
103
+ _queryParams["sample_rate"] = request.sampleRate.toString();
104
+ }
105
+ const _request = yield core.newFormData();
106
+ yield _request.appendFile("file", file);
107
+ _request.append("model", request.model);
108
+ if (request.language != null) {
109
+ _request.append("language", request.language);
110
+ }
111
+ if (request.timestampGranularities != null) {
112
+ for (const _item of request.timestampGranularities) {
113
+ _request.append("timestamp_granularities[]", serializers.TimestampGranularity.jsonOrThrow(_item, { unrecognizedObjectKeys: "strip" }));
114
+ }
115
+ }
116
+ const _maybeEncodedRequest = yield _request.getRequest();
117
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
118
+ 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, "/stt"),
119
+ method: "POST",
120
+ 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.7", "User-Agent": "@cartesia/cartesia-js/2.2.7", "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),
121
+ queryParameters: _queryParams,
122
+ requestType: "file",
123
+ duplex: _maybeEncodedRequest.duplex,
124
+ body: _maybeEncodedRequest.body,
125
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
126
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
127
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
128
+ });
129
+ if (_response.ok) {
130
+ return serializers.TranscriptionResponse.parseOrThrow(_response.body, {
131
+ unrecognizedObjectKeys: "passthrough",
132
+ allowUnrecognizedUnionMembers: true,
133
+ allowUnrecognizedEnumValues: true,
134
+ skipValidation: true,
135
+ breadcrumbsPrefix: ["response"],
136
+ });
137
+ }
138
+ if (_response.error.reason === "status-code") {
139
+ throw new errors.CartesiaError({
140
+ statusCode: _response.error.statusCode,
141
+ body: _response.error.body,
142
+ });
143
+ }
144
+ switch (_response.error.reason) {
145
+ case "non-json":
146
+ throw new errors.CartesiaError({
147
+ statusCode: _response.error.statusCode,
148
+ body: _response.error.rawBody,
149
+ });
150
+ case "timeout":
151
+ throw new errors.CartesiaTimeoutError("Timeout exceeded when calling POST /stt.");
152
+ case "unknown":
153
+ throw new errors.CartesiaError({
154
+ message: _response.error.errorMessage,
155
+ });
156
+ }
157
+ });
158
+ }
51
159
  _getCustomAuthorizationHeaders() {
52
160
  return __awaiter(this, void 0, void 0, function* () {
53
161
  const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
@@ -1 +1 @@
1
- export { Stt } from "./Client";
1
+ export * from "./requests";
@@ -1,5 +1,17 @@
1
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
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Stt = void 0;
4
- var Client_1 = require("./Client");
5
- Object.defineProperty(exports, "Stt", { enumerable: true, get: function () { return Client_1.Stt; } });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,147 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Cartesia from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * model: "ink-whisper",
9
+ * language: "en"
10
+ * }
11
+ *
12
+ * @example
13
+ * {
14
+ * model: "ink-whisper",
15
+ * language: "en",
16
+ * timestampGranularities: ["word"]
17
+ * }
18
+ */
19
+ export interface TranscriptionRequest {
20
+ /**
21
+ * The encoding format to process the audio as. If not specified, the audio file will be decoded automatically.
22
+ *
23
+ * **Supported formats:**
24
+ * - `pcm_s16le` - 16-bit signed integer PCM, little-endian (recommended for best performance)
25
+ * - `pcm_s32le` - 32-bit signed integer PCM, little-endian
26
+ * - `pcm_f16le` - 16-bit floating point PCM, little-endian
27
+ * - `pcm_f32le` - 32-bit floating point PCM, little-endian
28
+ * - `pcm_mulaw` - 8-bit μ-law encoded PCM
29
+ * - `pcm_alaw` - 8-bit A-law encoded PCM
30
+ */
31
+ encoding?: Cartesia.SttEncoding;
32
+ /**
33
+ * The sample rate of the audio in Hz.
34
+ */
35
+ sampleRate?: number;
36
+ /** ID of the model to use for transcription. Use `ink-whisper` for the latest Cartesia Whisper model. */
37
+ model: string;
38
+ /**
39
+ * The language of the input audio in ISO-639-1 format. Defaults to `en`.
40
+ *
41
+ * <Accordion title="Supported languages">
42
+ * - `en` (English)
43
+ * - `zh` (Chinese)
44
+ * - `de` (German)
45
+ * - `es` (Spanish)
46
+ * - `ru` (Russian)
47
+ * - `ko` (Korean)
48
+ * - `fr` (French)
49
+ * - `ja` (Japanese)
50
+ * - `pt` (Portuguese)
51
+ * - `tr` (Turkish)
52
+ * - `pl` (Polish)
53
+ * - `ca` (Catalan)
54
+ * - `nl` (Dutch)
55
+ * - `ar` (Arabic)
56
+ * - `sv` (Swedish)
57
+ * - `it` (Italian)
58
+ * - `id` (Indonesian)
59
+ * - `hi` (Hindi)
60
+ * - `fi` (Finnish)
61
+ * - `vi` (Vietnamese)
62
+ * - `he` (Hebrew)
63
+ * - `uk` (Ukrainian)
64
+ * - `el` (Greek)
65
+ * - `ms` (Malay)
66
+ * - `cs` (Czech)
67
+ * - `ro` (Romanian)
68
+ * - `da` (Danish)
69
+ * - `hu` (Hungarian)
70
+ * - `ta` (Tamil)
71
+ * - `no` (Norwegian)
72
+ * - `th` (Thai)
73
+ * - `ur` (Urdu)
74
+ * - `hr` (Croatian)
75
+ * - `bg` (Bulgarian)
76
+ * - `lt` (Lithuanian)
77
+ * - `la` (Latin)
78
+ * - `mi` (Maori)
79
+ * - `ml` (Malayalam)
80
+ * - `cy` (Welsh)
81
+ * - `sk` (Slovak)
82
+ * - `te` (Telugu)
83
+ * - `fa` (Persian)
84
+ * - `lv` (Latvian)
85
+ * - `bn` (Bengali)
86
+ * - `sr` (Serbian)
87
+ * - `az` (Azerbaijani)
88
+ * - `sl` (Slovenian)
89
+ * - `kn` (Kannada)
90
+ * - `et` (Estonian)
91
+ * - `mk` (Macedonian)
92
+ * - `br` (Breton)
93
+ * - `eu` (Basque)
94
+ * - `is` (Icelandic)
95
+ * - `hy` (Armenian)
96
+ * - `ne` (Nepali)
97
+ * - `mn` (Mongolian)
98
+ * - `bs` (Bosnian)
99
+ * - `kk` (Kazakh)
100
+ * - `sq` (Albanian)
101
+ * - `sw` (Swahili)
102
+ * - `gl` (Galician)
103
+ * - `mr` (Marathi)
104
+ * - `pa` (Punjabi)
105
+ * - `si` (Sinhala)
106
+ * - `km` (Khmer)
107
+ * - `sn` (Shona)
108
+ * - `yo` (Yoruba)
109
+ * - `so` (Somali)
110
+ * - `af` (Afrikaans)
111
+ * - `oc` (Occitan)
112
+ * - `ka` (Georgian)
113
+ * - `be` (Belarusian)
114
+ * - `tg` (Tajik)
115
+ * - `sd` (Sindhi)
116
+ * - `gu` (Gujarati)
117
+ * - `am` (Amharic)
118
+ * - `yi` (Yiddish)
119
+ * - `lo` (Lao)
120
+ * - `uz` (Uzbek)
121
+ * - `fo` (Faroese)
122
+ * - `ht` (Haitian Creole)
123
+ * - `ps` (Pashto)
124
+ * - `tk` (Turkmen)
125
+ * - `nn` (Nynorsk)
126
+ * - `mt` (Maltese)
127
+ * - `sa` (Sanskrit)
128
+ * - `lb` (Luxembourgish)
129
+ * - `my` (Myanmar)
130
+ * - `bo` (Tibetan)
131
+ * - `tl` (Tagalog)
132
+ * - `mg` (Malagasy)
133
+ * - `as` (Assamese)
134
+ * - `tt` (Tatar)
135
+ * - `haw` (Hawaiian)
136
+ * - `ln` (Lingala)
137
+ * - `ha` (Hausa)
138
+ * - `ba` (Bashkir)
139
+ * - `jw` (Javanese)
140
+ * - `su` (Sundanese)
141
+ * - `yue` (Cantonese)
142
+ * </Accordion>
143
+ */
144
+ language?: string;
145
+ /** The timestamp granularities to populate for this transcription. Currently only `word` level timestamps are supported. */
146
+ timestampGranularities?: Cartesia.TimestampGranularity[];
147
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { type TranscriptionRequest } from "./TranscriptionRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
1
  export * from "./types";
2
+ export * from "./client";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./types"), exports);
18
+ __exportStar(require("./client"), exports);
@@ -3,13 +3,13 @@
3
3
  */
4
4
  /**
5
5
  * The encoding format for audio data sent to the STT WebSocket.
6
- *
7
- * Currently supported:
8
- * - `pcm_s16le` - 16-bit signed integer PCM, little-endian
9
- *
10
- * Support for other formats will be added in the future.
11
6
  */
12
- export type SttEncoding = "pcm_s16le";
7
+ export type SttEncoding = "pcm_s16le" | "pcm_s32le" | "pcm_f16le" | "pcm_f32le" | "pcm_mulaw" | "pcm_alaw";
13
8
  export declare const SttEncoding: {
14
9
  readonly PcmS16Le: "pcm_s16le";
10
+ readonly PcmS32Le: "pcm_s32le";
11
+ readonly PcmF16Le: "pcm_f16le";
12
+ readonly PcmF32Le: "pcm_f32le";
13
+ readonly PcmMulaw: "pcm_mulaw";
14
+ readonly PcmAlaw: "pcm_alaw";
15
15
  };
@@ -6,4 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SttEncoding = void 0;
7
7
  exports.SttEncoding = {
8
8
  PcmS16Le: "pcm_s16le",
9
+ PcmS32Le: "pcm_s32le",
10
+ PcmF16Le: "pcm_f16le",
11
+ PcmF32Le: "pcm_f32le",
12
+ PcmMulaw: "pcm_mulaw",
13
+ PcmAlaw: "pcm_alaw",
9
14
  };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * The granularity of timestamps to include in the response.
6
+ *
7
+ * Currently only `word` level timestamps are supported, providing start and end times for each word.
8
+ */
9
+ export type TimestampGranularity = "word";
10
+ export declare const TimestampGranularity: {
11
+ readonly Word: "word";
12
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TimestampGranularity = void 0;
7
+ exports.TimestampGranularity = {
8
+ Word: "word",
9
+ };
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Cartesia from "../../../index";
4
5
  export interface TranscriptMessage {
5
6
  /** Unique identifier for this transcription session. */
6
7
  requestId: string;
@@ -14,6 +15,8 @@ export interface TranscriptMessage {
14
15
  isFinal: boolean;
15
16
  /** The duration of the audio transcribed so far, in seconds. */
16
17
  duration?: number;
17
- /** The detected or specified language of the input audio. */
18
+ /** The specified language of the input audio. */
18
19
  language?: string;
20
+ /** Word-level timestamps showing the start and end time of each word in seconds. Always included in streaming responses. */
21
+ words?: Cartesia.TranscriptionWord[];
19
22
  }
@@ -1,11 +1,14 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Cartesia from "../../../index";
4
5
  export interface TranscriptionResponse {
5
6
  /** The transcribed text. */
6
7
  text: string;
7
- /** The detected or specified language of the input audio. */
8
+ /** The specified language of the input audio. */
8
9
  language?: string;
9
10
  /** The duration of the input audio in seconds. */
10
11
  duration?: number;
12
+ /** Word-level timestamps showing the start and end time of each word. Only included when `[word]` is passed into `timestamp_granularities[]`. */
13
+ words?: Cartesia.TranscriptionWord[];
11
14
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface TranscriptionWord {
5
+ /** The transcribed word. */
6
+ word: string;
7
+ /** Start time of the word in seconds. */
8
+ start: number;
9
+ /** End time of the word in seconds. */
10
+ end: number;
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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);
@@ -4,9 +4,12 @@
4
4
  import * as environments from "../../../../environments";
5
5
  import * as core from "../../../../core";
6
6
  import * as Cartesia from "../../../index";
7
+ import * as stream from "stream";
7
8
  export declare namespace Tts {
8
9
  interface Options {
9
10
  environment?: core.Supplier<environments.CartesiaEnvironment | string>;
11
+ /** Specify a custom URL to connect the client to. */
12
+ baseUrl?: core.Supplier<string>;
10
13
  apiKey?: core.Supplier<string | undefined>;
11
14
  /** Override the Cartesia-Version header */
12
15
  cartesiaVersion?: "2024-06-10";
@@ -21,13 +24,15 @@ export declare namespace Tts {
21
24
  abortSignal?: AbortSignal;
22
25
  /** Override the Cartesia-Version header */
23
26
  cartesiaVersion?: "2024-06-10";
27
+ /** Additional headers to include in the request. */
28
+ headers?: Record<string, string>;
24
29
  }
25
30
  }
26
31
  export declare class Tts {
27
32
  protected readonly _options: Tts.Options;
28
33
  constructor(_options?: Tts.Options);
29
- bytes(request: Cartesia.TtsRequest, requestOptions?: Tts.RequestOptions): Promise<ArrayBuffer>;
30
- sse(request: Cartesia.TtsRequest, requestOptions?: Tts.RequestOptions): Promise<core.Stream<Cartesia.WebSocketResponse>>;
34
+ bytes(request: Cartesia.TtsRequest, requestOptions?: Tts.RequestOptions): Promise<stream.Readable>;
35
+ sse(request: Cartesia.TtssseRequest, requestOptions?: Tts.RequestOptions): Promise<core.Stream<Cartesia.WebSocketResponse>>;
31
36
  protected _getCustomAuthorizationHeaders(): Promise<{
32
37
  "X-API-Key": string | undefined;
33
38
  }>;
@@ -60,15 +60,15 @@ class Tts {
60
60
  }
61
61
  bytes(request, requestOptions) {
62
62
  return __awaiter(this, void 0, void 0, function* () {
63
- var _a, _b, _c, _d, _e;
63
+ var _a, _b, _c, _d, _e, _f;
64
64
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
65
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/tts/bytes"),
65
+ 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, "/tts/bytes"),
66
66
  method: "POST",
67
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.4-alpha0", "User-Agent": "@cartesia/cartesia-js/2.0.4-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
67
+ 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.7", "User-Agent": "@cartesia/cartesia-js/2.2.7", "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),
68
68
  contentType: "application/json",
69
69
  requestType: "json",
70
70
  body: serializers.TtsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
71
- responseType: "arraybuffer",
71
+ responseType: "streaming",
72
72
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
73
73
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
74
74
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -99,14 +99,14 @@ class Tts {
99
99
  }
100
100
  sse(request, requestOptions) {
101
101
  return __awaiter(this, void 0, void 0, function* () {
102
- var _a, _b, _c, _d, _e;
102
+ var _a, _b, _c, _d, _e, _f;
103
103
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
104
- url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CartesiaEnvironment.Production, "/tts/sse"),
104
+ 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, "/tts/sse"),
105
105
  method: "POST",
106
- headers: Object.assign({ "Cartesia-Version": (_e = (_c = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.cartesiaVersion) !== null && _c !== void 0 ? _c : (_d = this._options) === null || _d === void 0 ? void 0 : _d.cartesiaVersion) !== null && _e !== void 0 ? _e : "2024-06-10", "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@cartesia/cartesia-js", "X-Fern-SDK-Version": "2.0.4-alpha0", "User-Agent": "@cartesia/cartesia-js/2.0.4-alpha0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
106
+ 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.7", "User-Agent": "@cartesia/cartesia-js/2.2.7", "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),
107
107
  contentType: "application/json",
108
108
  requestType: "json",
109
- body: serializers.TtsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
109
+ body: serializers.TtssseRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
110
110
  responseType: "sse",
111
111
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
112
112
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -4,5 +4,5 @@
4
4
  import * as Cartesia from "../../../index";
5
5
  export interface Controls {
6
6
  speed: Cartesia.Speed;
7
- emotion: Cartesia.Emotion[];
7
+ emotion: Cartesia.EmotionDeprecated[];
8
8
  }
@@ -2,37 +2,6 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  /**
5
- * An array of emotion:level tags.
6
- *
7
- * Supported emotions are: anger, positivity, surprise, sadness, and curiosity.
8
- *
9
- * Supported levels are: lowest, low, (omit), high, highest.
5
+ * Guide the emotion of the generated speech.
10
6
  */
11
- export type Emotion = "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";
12
- export declare const Emotion: {
13
- readonly AngerLowest: "anger:lowest";
14
- readonly AngerLow: "anger:low";
15
- readonly Anger: "anger";
16
- readonly AngerHigh: "anger:high";
17
- readonly AngerHighest: "anger:highest";
18
- readonly PositivityLowest: "positivity:lowest";
19
- readonly PositivityLow: "positivity:low";
20
- readonly Positivity: "positivity";
21
- readonly PositivityHigh: "positivity:high";
22
- readonly PositivityHighest: "positivity:highest";
23
- readonly SurpriseLowest: "surprise:lowest";
24
- readonly SurpriseLow: "surprise:low";
25
- readonly Surprise: "surprise";
26
- readonly SurpriseHigh: "surprise:high";
27
- readonly SurpriseHighest: "surprise:highest";
28
- readonly SadnessLowest: "sadness:lowest";
29
- readonly SadnessLow: "sadness:low";
30
- readonly Sadness: "sadness";
31
- readonly SadnessHigh: "sadness:high";
32
- readonly SadnessHighest: "sadness:highest";
33
- readonly CuriosityLowest: "curiosity:lowest";
34
- readonly CuriosityLow: "curiosity:low";
35
- readonly Curiosity: "curiosity";
36
- readonly CuriosityHigh: "curiosity:high";
37
- readonly CuriosityHighest: "curiosity:highest";
38
- };
7
+ export type Emotion = string;
@@ -3,31 +3,3 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Emotion = void 0;
7
- exports.Emotion = {
8
- AngerLowest: "anger:lowest",
9
- AngerLow: "anger:low",
10
- Anger: "anger",
11
- AngerHigh: "anger:high",
12
- AngerHighest: "anger:highest",
13
- PositivityLowest: "positivity:lowest",
14
- PositivityLow: "positivity:low",
15
- Positivity: "positivity",
16
- PositivityHigh: "positivity:high",
17
- PositivityHighest: "positivity:highest",
18
- SurpriseLowest: "surprise:lowest",
19
- SurpriseLow: "surprise:low",
20
- Surprise: "surprise",
21
- SurpriseHigh: "surprise:high",
22
- SurpriseHighest: "surprise:highest",
23
- SadnessLowest: "sadness:lowest",
24
- SadnessLow: "sadness:low",
25
- Sadness: "sadness",
26
- SadnessHigh: "sadness:high",
27
- SadnessHighest: "sadness:highest",
28
- CuriosityLowest: "curiosity:lowest",
29
- CuriosityLow: "curiosity:low",
30
- Curiosity: "curiosity",
31
- CuriosityHigh: "curiosity:high",
32
- CuriosityHighest: "curiosity:highest",
33
- };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * An array of emotion:level tags.
6
+ *
7
+ * Supported emotions are: anger, positivity, surprise, sadness, and curiosity.
8
+ *
9
+ * Supported levels are: lowest, low, (omit), high, highest.
10
+ */
11
+ export type EmotionDeprecated = "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";
12
+ export declare const EmotionDeprecated: {
13
+ readonly AngerLowest: "anger:lowest";
14
+ readonly AngerLow: "anger:low";
15
+ readonly Anger: "anger";
16
+ readonly AngerHigh: "anger:high";
17
+ readonly AngerHighest: "anger:highest";
18
+ readonly PositivityLowest: "positivity:lowest";
19
+ readonly PositivityLow: "positivity:low";
20
+ readonly Positivity: "positivity";
21
+ readonly PositivityHigh: "positivity:high";
22
+ readonly PositivityHighest: "positivity:highest";
23
+ readonly SurpriseLowest: "surprise:lowest";
24
+ readonly SurpriseLow: "surprise:low";
25
+ readonly Surprise: "surprise";
26
+ readonly SurpriseHigh: "surprise:high";
27
+ readonly SurpriseHighest: "surprise:highest";
28
+ readonly SadnessLowest: "sadness:lowest";
29
+ readonly SadnessLow: "sadness:low";
30
+ readonly Sadness: "sadness";
31
+ readonly SadnessHigh: "sadness:high";
32
+ readonly SadnessHighest: "sadness:highest";
33
+ readonly CuriosityLowest: "curiosity:lowest";
34
+ readonly CuriosityLow: "curiosity:low";
35
+ readonly Curiosity: "curiosity";
36
+ readonly CuriosityHigh: "curiosity:high";
37
+ readonly CuriosityHighest: "curiosity:highest";
38
+ };