hume 0.14.2-beta.5 → 0.14.2-beta.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 (125) hide show
  1. package/.claude/settings.local.json +4 -1
  2. package/Client.d.ts +1 -0
  3. package/api/resources/empathicVoice/client/Client.d.ts +1 -0
  4. package/api/resources/empathicVoice/resources/chat/client/Client.d.ts +1 -1
  5. package/api/resources/empathicVoice/resources/chat/client/Client.js +3 -28
  6. package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +1 -0
  7. package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +12 -20
  8. package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +1 -0
  9. package/api/resources/empathicVoice/resources/chats/client/Client.js +9 -15
  10. package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +1 -0
  11. package/api/resources/empathicVoice/resources/configs/client/Client.js +29 -52
  12. package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +1 -0
  13. package/api/resources/empathicVoice/resources/prompts/client/Client.js +29 -52
  14. package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +1 -0
  15. package/api/resources/empathicVoice/resources/tools/client/Client.js +27 -46
  16. package/api/resources/expressionMeasurement/client/Client.d.ts +1 -0
  17. package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +1 -0
  18. package/api/resources/expressionMeasurement/resources/batch/client/Client.js +18 -30
  19. package/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.d.ts +1 -0
  20. package/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Socket.js +0 -4
  21. package/api/resources/tts/client/Client.d.ts +1 -0
  22. package/api/resources/tts/client/Client.js +16 -34
  23. package/api/resources/tts/index.d.ts +1 -1
  24. package/api/resources/tts/index.js +1 -1
  25. package/api/resources/tts/resources/index.d.ts +0 -1
  26. package/api/resources/tts/resources/index.js +0 -1
  27. package/api/resources/tts/resources/streamInput/client/Client.d.ts +4 -3
  28. package/api/resources/tts/resources/streamInput/client/Client.js +14 -15
  29. package/api/resources/tts/resources/streamInput/client/Socket.d.ts +1 -1
  30. package/api/resources/tts/resources/streamInput/client/Socket.js +0 -4
  31. package/api/resources/tts/resources/streamInput/index.d.ts +0 -1
  32. package/api/resources/tts/resources/streamInput/index.js +0 -1
  33. package/api/resources/tts/resources/streamInput/types/index.js +26 -14
  34. package/api/resources/tts/resources/voices/client/Client.d.ts +1 -0
  35. package/api/resources/tts/resources/voices/client/Client.js +10 -19
  36. package/api/resources/tts/types/index.d.ts +2 -2
  37. package/api/resources/tts/types/index.js +2 -2
  38. package/changes.md +843 -0
  39. package/comment_changes.txt +0 -0
  40. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +37 -0
  41. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
  42. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +37 -0
  43. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  44. package/core/file.d.ts +11 -0
  45. package/diff.txt +18143 -0
  46. package/dist/Client.d.ts +1 -0
  47. package/dist/api/resources/empathicVoice/client/Client.d.ts +1 -0
  48. package/dist/api/resources/empathicVoice/resources/chat/client/Client.d.ts +1 -1
  49. package/dist/api/resources/empathicVoice/resources/chat/client/Client.js +3 -28
  50. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +1 -0
  51. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +12 -20
  52. package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +1 -0
  53. package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +9 -15
  54. package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +1 -0
  55. package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +29 -52
  56. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +1 -0
  57. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +29 -52
  58. package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +1 -0
  59. package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +27 -46
  60. package/dist/api/resources/expressionMeasurement/client/Client.d.ts +1 -0
  61. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +1 -0
  62. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +18 -30
  63. package/dist/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.d.ts +1 -0
  64. package/dist/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Socket.js +0 -4
  65. package/dist/api/resources/tts/client/Client.d.ts +1 -0
  66. package/dist/api/resources/tts/client/Client.js +16 -34
  67. package/dist/api/resources/tts/index.d.ts +1 -1
  68. package/dist/api/resources/tts/index.js +1 -1
  69. package/dist/api/resources/tts/resources/index.d.ts +0 -1
  70. package/dist/api/resources/tts/resources/index.js +0 -1
  71. package/dist/api/resources/tts/resources/streamInput/client/Client.d.ts +4 -3
  72. package/dist/api/resources/tts/resources/streamInput/client/Client.js +14 -15
  73. package/dist/api/resources/tts/resources/streamInput/client/Socket.d.ts +1 -1
  74. package/dist/api/resources/tts/resources/streamInput/client/Socket.js +0 -4
  75. package/dist/api/resources/tts/resources/streamInput/index.d.ts +0 -1
  76. package/dist/api/resources/tts/resources/streamInput/index.js +0 -1
  77. package/dist/api/resources/tts/resources/streamInput/types/index.js +26 -14
  78. package/dist/api/resources/tts/resources/voices/client/Client.d.ts +1 -0
  79. package/dist/api/resources/tts/resources/voices/client/Client.js +10 -19
  80. package/dist/api/resources/tts/types/index.d.ts +2 -2
  81. package/dist/api/resources/tts/types/index.js +2 -2
  82. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +37 -0
  83. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
  84. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +37 -0
  85. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  86. package/dist/core/file.d.ts +11 -0
  87. package/dist/main.js +40944 -0
  88. package/dist/serialization/resources/tts/resources/index.d.ts +0 -1
  89. package/dist/serialization/resources/tts/resources/index.js +0 -1
  90. package/dist/serialization/resources/tts/resources/streamInput/client/socket/StreamInputSocketResponse.d.ts +3 -3
  91. package/dist/serialization/resources/tts/resources/streamInput/client/socket/StreamInputSocketResponse.js +2 -2
  92. package/dist/serialization/resources/tts/resources/streamInput/index.d.ts +0 -1
  93. package/dist/serialization/resources/tts/resources/streamInput/index.js +0 -1
  94. package/dist/serialization/resources/tts/resources/streamInput/types/SubscribeEvent.d.ts +4 -1
  95. package/dist/serialization/resources/tts/resources/streamInput/types/SubscribeEvent.js +55 -33
  96. package/dist/serialization/resources/tts/resources/streamInput/types/index.js +26 -14
  97. package/dist/serialization/resources/tts/types/index.d.ts +2 -2
  98. package/dist/serialization/resources/tts/types/index.js +2 -2
  99. package/dist/wrapper/HumeClient.d.ts +2 -2
  100. package/dist/wrapper/HumeClient.js +27 -25
  101. package/hume-v0.14.2-beta.6.tgz +0 -0
  102. package/hume-v0.14.2-beta.7.tgz +0 -0
  103. package/js_changes.txt +2610 -0
  104. package/main.js +40944 -0
  105. package/package.json +1 -1
  106. package/serialization/resources/tts/resources/index.d.ts +0 -1
  107. package/serialization/resources/tts/resources/index.js +0 -1
  108. package/serialization/resources/tts/resources/streamInput/client/socket/StreamInputSocketResponse.d.ts +3 -3
  109. package/serialization/resources/tts/resources/streamInput/client/socket/StreamInputSocketResponse.js +2 -2
  110. package/serialization/resources/tts/resources/streamInput/index.d.ts +0 -1
  111. package/serialization/resources/tts/resources/streamInput/index.js +0 -1
  112. package/serialization/resources/tts/resources/streamInput/types/SubscribeEvent.d.ts +4 -1
  113. package/serialization/resources/tts/resources/streamInput/types/SubscribeEvent.js +55 -33
  114. package/serialization/resources/tts/resources/streamInput/types/index.js +26 -14
  115. package/serialization/resources/tts/types/index.d.ts +2 -2
  116. package/serialization/resources/tts/types/index.js +2 -2
  117. package/tts-audio/tts-74f0e855-cd7e-46e7-9657-c9bdf4b60693.wav +0 -0
  118. package/tts-audio/tts-8d0d6c9c-f54d-4ffa-880a-556f3a77eb99.wav +0 -0
  119. package/tts-audio/tts-f2a1d9fa-8f28-4011-9c02-08364592d0a9.wav +0 -0
  120. package/wrapper/HumeClient.d.ts +2 -2
  121. package/wrapper/HumeClient.js +27 -25
  122. package/hume-v0.14.2-beta.2.tgz +0 -0
  123. package/hume-v0.14.2-beta.4.tgz +0 -0
  124. package/hume-v0.14.2-beta.5.tgz +0 -0
  125. package/hume-v0.14.2-beta1.tgz +0 -0
@@ -99,19 +99,16 @@ class Tts {
99
99
  }
100
100
  __synthesizeJson(request, requestOptions) {
101
101
  return __awaiter(this, void 0, void 0, function* () {
102
- var _a, _b, _c;
102
+ var _a, _b, _c, _d;
103
103
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
104
- const _response = yield core.fetcher({
105
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Prod).base, "v0/tts"),
104
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
105
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts"),
106
106
  method: "POST",
107
107
  headers: _headers,
108
108
  contentType: "application/json",
109
109
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
110
110
  requestType: "json",
111
- body: serializers.tts.PostedTts.jsonOrThrow(request, {
112
- unrecognizedObjectKeys: "strip",
113
- omitUndefined: true,
114
- }),
111
+ body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
115
112
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
116
113
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
117
114
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -122,7 +119,6 @@ class Tts {
122
119
  unrecognizedObjectKeys: "passthrough",
123
120
  allowUnrecognizedUnionMembers: true,
124
121
  allowUnrecognizedEnumValues: true,
125
- skipValidation: true,
126
122
  breadcrumbsPrefix: ["response"],
127
123
  }),
128
124
  rawResponse: _response.rawResponse,
@@ -135,7 +131,6 @@ class Tts {
135
131
  unrecognizedObjectKeys: "passthrough",
136
132
  allowUnrecognizedUnionMembers: true,
137
133
  allowUnrecognizedEnumValues: true,
138
- skipValidation: true,
139
134
  breadcrumbsPrefix: ["response"],
140
135
  }), _response.rawResponse);
141
136
  default:
@@ -174,19 +169,16 @@ class Tts {
174
169
  }
175
170
  __synthesizeFile(request, requestOptions) {
176
171
  return __awaiter(this, void 0, void 0, function* () {
177
- var _a, _b, _c;
172
+ var _a, _b, _c, _d;
178
173
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
179
- const _response = yield core.fetcher({
180
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Prod).base, "v0/tts/file"),
174
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
175
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/file"),
181
176
  method: "POST",
182
177
  headers: _headers,
183
178
  contentType: "application/json",
184
179
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
185
180
  requestType: "json",
186
- body: serializers.tts.PostedTts.jsonOrThrow(request, {
187
- unrecognizedObjectKeys: "strip",
188
- omitUndefined: true,
189
- }),
181
+ body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
190
182
  responseType: "binary-response",
191
183
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
192
184
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -202,7 +194,6 @@ class Tts {
202
194
  unrecognizedObjectKeys: "passthrough",
203
195
  allowUnrecognizedUnionMembers: true,
204
196
  allowUnrecognizedEnumValues: true,
205
- skipValidation: true,
206
197
  breadcrumbsPrefix: ["response"],
207
198
  }), _response.rawResponse);
208
199
  default:
@@ -239,19 +230,16 @@ class Tts {
239
230
  }
240
231
  __synthesizeFileStreaming(request, requestOptions) {
241
232
  return __awaiter(this, void 0, void 0, function* () {
242
- var _a, _b, _c;
233
+ var _a, _b, _c, _d;
243
234
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
244
- const _response = yield core.fetcher({
245
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Prod).base, "v0/tts/stream/file"),
235
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
236
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/stream/file"),
246
237
  method: "POST",
247
238
  headers: _headers,
248
239
  contentType: "application/json",
249
240
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
250
241
  requestType: "json",
251
- body: serializers.tts.PostedTts.jsonOrThrow(request, {
252
- unrecognizedObjectKeys: "strip",
253
- omitUndefined: true,
254
- }),
242
+ body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
255
243
  responseType: "binary-response",
256
244
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
257
245
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -267,7 +255,6 @@ class Tts {
267
255
  unrecognizedObjectKeys: "passthrough",
268
256
  allowUnrecognizedUnionMembers: true,
269
257
  allowUnrecognizedEnumValues: true,
270
- skipValidation: true,
271
258
  breadcrumbsPrefix: ["response"],
272
259
  }), _response.rawResponse);
273
260
  default:
@@ -305,19 +292,16 @@ class Tts {
305
292
  }
306
293
  __synthesizeJsonStreaming(request, requestOptions) {
307
294
  return __awaiter(this, void 0, void 0, function* () {
308
- var _a, _b, _c;
295
+ var _a, _b, _c, _d;
309
296
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
310
- const _response = yield core.fetcher({
311
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Prod).base, "v0/tts/stream/json"),
297
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
298
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/stream/json"),
312
299
  method: "POST",
313
300
  headers: _headers,
314
301
  contentType: "application/json",
315
302
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
316
303
  requestType: "json",
317
- body: serializers.tts.PostedTts.jsonOrThrow(request, {
318
- unrecognizedObjectKeys: "strip",
319
- omitUndefined: true,
320
- }),
304
+ body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
321
305
  responseType: "sse",
322
306
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
323
307
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -332,7 +316,6 @@ class Tts {
332
316
  unrecognizedObjectKeys: "passthrough",
333
317
  allowUnrecognizedUnionMembers: true,
334
318
  allowUnrecognizedEnumValues: true,
335
- skipValidation: true,
336
319
  breadcrumbsPrefix: ["response"],
337
320
  });
338
321
  }),
@@ -352,7 +335,6 @@ class Tts {
352
335
  unrecognizedObjectKeys: "passthrough",
353
336
  allowUnrecognizedUnionMembers: true,
354
337
  allowUnrecognizedEnumValues: true,
355
- skipValidation: true,
356
338
  breadcrumbsPrefix: ["response"],
357
339
  }), _response.rawResponse);
358
340
  default:
@@ -1,4 +1,4 @@
1
- export * from "./resources/index.js";
2
1
  export * from "./types/index.js";
3
2
  export * from "./errors/index.js";
3
+ export * from "./resources/index.js";
4
4
  export * from "./client/index.js";
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./resources/index.js"), exports);
18
17
  __exportStar(require("./types/index.js"), exports);
19
18
  __exportStar(require("./errors/index.js"), exports);
19
+ __exportStar(require("./resources/index.js"), exports);
20
20
  __exportStar(require("./client/index.js"), exports);
@@ -1,4 +1,3 @@
1
1
  export * as streamInput from "./streamInput/index.js";
2
- export * from "./streamInput/types/index.js";
3
2
  export * as voices from "./voices/index.js";
4
3
  export * from "./voices/client/requests/index.js";
@@ -38,6 +38,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.voices = exports.streamInput = void 0;
40
40
  exports.streamInput = __importStar(require("./streamInput/index.js"));
41
- __exportStar(require("./streamInput/types/index.js"), exports);
42
41
  exports.voices = __importStar(require("./voices/index.js"));
43
42
  __exportStar(require("./voices/client/requests/index.js"), exports);
@@ -13,16 +13,17 @@ export declare namespace StreamInput {
13
13
  apiKey?: core.Supplier<string | undefined>;
14
14
  /** Additional headers to include in requests. */
15
15
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
16
+ fetcher?: core.FetchFunction;
16
17
  }
17
18
  interface ConnectArgs {
18
19
  accessToken?: string | undefined;
19
20
  contextGenerationId?: string | undefined;
20
- formatType: Hume.tts.AudioFormatType;
21
+ formatType?: Hume.tts.AudioFormatType | undefined;
21
22
  includeTimestampTypes?: Hume.tts.TimestampType | undefined;
22
23
  instantMode?: boolean | undefined;
23
24
  noBinary?: boolean | undefined;
24
25
  stripHeaders?: boolean | undefined;
25
- version: Hume.tts.OctaveVersion;
26
+ version?: Hume.tts.OctaveVersion | undefined;
26
27
  apiKey?: string | undefined;
27
28
  /** Arbitrary headers to send with the websocket connect request. */
28
29
  headers?: Record<string, string>;
@@ -35,7 +36,7 @@ export declare namespace StreamInput {
35
36
  export declare class StreamInput {
36
37
  protected readonly _options: StreamInput.Options;
37
38
  constructor(_options?: StreamInput.Options);
38
- connect(args: StreamInput.ConnectArgs): Promise<StreamInputSocket>;
39
+ connect(args?: StreamInput.ConnectArgs): Promise<StreamInputSocket>;
39
40
  protected _getCustomAuthorizationHeaders(): Promise<{
40
41
  "X-Hume-Api-Key": string | undefined;
41
42
  }>;
@@ -55,8 +55,8 @@ class StreamInput {
55
55
  constructor(_options = {}) {
56
56
  this._options = _options;
57
57
  }
58
- connect(args) {
59
- return __awaiter(this, void 0, void 0, function* () {
58
+ connect() {
59
+ return __awaiter(this, arguments, void 0, function* (args = {}) {
60
60
  var _a, _b;
61
61
  const { accessToken, contextGenerationId, formatType, includeTimestampTypes, instantMode, noBinary, stripHeaders, version, apiKey, headers, debug, reconnectAttempts, } = args;
62
62
  const _queryParams = {};
@@ -66,19 +66,17 @@ class StreamInput {
66
66
  if (contextGenerationId != null) {
67
67
  _queryParams["context_generation_id"] = contextGenerationId;
68
68
  }
69
- _queryParams["format_type"] = serializers.tts.AudioFormatType.jsonOrThrow(formatType, {
70
- unrecognizedObjectKeys: "strip",
71
- omitUndefined: true,
72
- });
69
+ if (formatType != null) {
70
+ _queryParams["format_type"] = serializers.tts.AudioFormatType.jsonOrThrow(formatType, {
71
+ unrecognizedObjectKeys: "strip",
72
+ });
73
+ }
73
74
  if (includeTimestampTypes != null) {
74
75
  if (Array.isArray(includeTimestampTypes)) {
75
- _queryParams["include_timestamp_types"] = includeTimestampTypes.map((item) => serializers.tts.TimestampType.jsonOrThrow(item, {
76
- unrecognizedObjectKeys: "strip",
77
- omitUndefined: true,
78
- }));
76
+ _queryParams["include_timestamp_types"] = includeTimestampTypes.map((item) => serializers.tts.TimestampType.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" }));
79
77
  }
80
78
  else {
81
- _queryParams["include_timestamp_types"] = serializers.tts.TimestampType.jsonOrThrow(includeTimestampTypes, { unrecognizedObjectKeys: "strip", omitUndefined: true });
79
+ _queryParams["include_timestamp_types"] = serializers.tts.TimestampType.jsonOrThrow(includeTimestampTypes, { unrecognizedObjectKeys: "strip" });
82
80
  }
83
81
  }
84
82
  if (instantMode != null) {
@@ -90,10 +88,11 @@ class StreamInput {
90
88
  if (stripHeaders != null) {
91
89
  _queryParams["strip_headers"] = stripHeaders.toString();
92
90
  }
93
- _queryParams["version"] = serializers.tts.OctaveVersion.jsonOrThrow(version, {
94
- unrecognizedObjectKeys: "strip",
95
- omitUndefined: true,
96
- });
91
+ if (version != null) {
92
+ _queryParams["version"] = serializers.tts.OctaveVersion.jsonOrThrow(version, {
93
+ unrecognizedObjectKeys: "strip",
94
+ });
95
+ }
97
96
  if (apiKey != null) {
98
97
  _queryParams["api_key"] = apiKey;
99
98
  }
@@ -7,7 +7,7 @@ export declare namespace StreamInputSocket {
7
7
  interface Args {
8
8
  socket: core.ReconnectingWebSocket;
9
9
  }
10
- type Response = Hume.tts.SubscribeEvent;
10
+ type Response = Hume.tts.TtsOutput;
11
11
  type EventHandlers = {
12
12
  open?: () => void;
13
13
  message?: (message: Response) => void;
@@ -64,8 +64,6 @@ class StreamInputSocket {
64
64
  unrecognizedObjectKeys: "passthrough",
65
65
  allowUnrecognizedUnionMembers: true,
66
66
  allowUnrecognizedEnumValues: true,
67
- skipValidation: true,
68
- omitUndefined: true,
69
67
  });
70
68
  if (parsedResponse.ok) {
71
69
  (_b = (_a = this.eventHandlers).message) === null || _b === void 0 ? void 0 : _b.call(_a, parsedResponse.value);
@@ -112,8 +110,6 @@ class StreamInputSocket {
112
110
  unrecognizedObjectKeys: "passthrough",
113
111
  allowUnrecognizedUnionMembers: true,
114
112
  allowUnrecognizedEnumValues: true,
115
- skipValidation: true,
116
- omitUndefined: true,
117
113
  });
118
114
  this.socket.send(JSON.stringify(jsonPayload));
119
115
  }
@@ -1,2 +1 @@
1
- export * from "./types/index.js";
2
1
  export * from "./client/index.js";
@@ -14,5 +14,4 @@ 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("./types/index.js"), exports);
18
17
  __exportStar(require("./client/index.js"), exports);
@@ -1,17 +1,29 @@
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
+ var __createBinding =
3
+ (this && this.__createBinding) ||
4
+ (Object.create
5
+ ? 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 = {
10
+ enumerable: true,
11
+ get: function () {
12
+ return m[k];
13
+ },
14
+ };
15
+ }
16
+ Object.defineProperty(o, k2, desc);
17
+ }
18
+ : function (o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ });
22
+ var __exportStar =
23
+ (this && this.__exportStar) ||
24
+ function (m, exports) {
25
+ for (var p in m)
26
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
16
28
  Object.defineProperty(exports, "__esModule", { value: true });
17
29
  __exportStar(require("./SubscribeEvent.js"), exports);
@@ -12,6 +12,7 @@ export declare namespace Voices {
12
12
  apiKey?: core.Supplier<string | undefined>;
13
13
  /** Additional headers to include in requests. */
14
14
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
+ fetcher?: core.FetchFunction;
15
16
  }
16
17
  interface RequestOptions {
17
18
  /** The maximum time to wait for a response in seconds. */
@@ -72,12 +72,11 @@ class Voices {
72
72
  list(request, requestOptions) {
73
73
  return __awaiter(this, void 0, void 0, function* () {
74
74
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
75
- var _a, _b, _c;
75
+ var _a, _b, _c, _d;
76
76
  const { provider, pageNumber, pageSize, ascendingOrder } = request;
77
77
  const _queryParams = {};
78
78
  _queryParams["provider"] = serializers.tts.VoiceProvider.jsonOrThrow(provider, {
79
79
  unrecognizedObjectKeys: "strip",
80
- omitUndefined: true,
81
80
  });
82
81
  if (pageNumber != null) {
83
82
  _queryParams["page_number"] = pageNumber.toString();
@@ -89,8 +88,8 @@ class Voices {
89
88
  _queryParams["ascending_order"] = ascendingOrder.toString();
90
89
  }
91
90
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
92
- const _response = yield core.fetcher({
93
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Prod)
91
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
92
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod)
94
93
  .base, "v0/tts/voices"),
95
94
  method: "GET",
96
95
  headers: _headers,
@@ -105,7 +104,6 @@ class Voices {
105
104
  unrecognizedObjectKeys: "passthrough",
106
105
  allowUnrecognizedUnionMembers: true,
107
106
  allowUnrecognizedEnumValues: true,
108
- skipValidation: true,
109
107
  breadcrumbsPrefix: ["response"],
110
108
  }),
111
109
  rawResponse: _response.rawResponse,
@@ -118,7 +116,6 @@ class Voices {
118
116
  unrecognizedObjectKeys: "passthrough",
119
117
  allowUnrecognizedUnionMembers: true,
120
118
  allowUnrecognizedEnumValues: true,
121
- skipValidation: true,
122
119
  breadcrumbsPrefix: ["response"],
123
120
  }), _response.rawResponse);
124
121
  default:
@@ -180,19 +177,16 @@ class Voices {
180
177
  }
181
178
  __create(request, requestOptions) {
182
179
  return __awaiter(this, void 0, void 0, function* () {
183
- var _a, _b, _c;
180
+ var _a, _b, _c, _d;
184
181
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
185
- const _response = yield core.fetcher({
186
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Prod).base, "v0/tts/voices"),
182
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
183
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/voices"),
187
184
  method: "POST",
188
185
  headers: _headers,
189
186
  contentType: "application/json",
190
187
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
191
188
  requestType: "json",
192
- body: serializers.tts.PostedVoice.jsonOrThrow(request, {
193
- unrecognizedObjectKeys: "strip",
194
- omitUndefined: true,
195
- }),
189
+ body: serializers.tts.PostedVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
196
190
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
197
191
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
198
192
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -203,7 +197,6 @@ class Voices {
203
197
  unrecognizedObjectKeys: "passthrough",
204
198
  allowUnrecognizedUnionMembers: true,
205
199
  allowUnrecognizedEnumValues: true,
206
- skipValidation: true,
207
200
  breadcrumbsPrefix: ["response"],
208
201
  }),
209
202
  rawResponse: _response.rawResponse,
@@ -216,7 +209,6 @@ class Voices {
216
209
  unrecognizedObjectKeys: "passthrough",
217
210
  allowUnrecognizedUnionMembers: true,
218
211
  allowUnrecognizedEnumValues: true,
219
- skipValidation: true,
220
212
  breadcrumbsPrefix: ["response"],
221
213
  }), _response.rawResponse);
222
214
  default:
@@ -262,13 +254,13 @@ class Voices {
262
254
  }
263
255
  __delete(request, requestOptions) {
264
256
  return __awaiter(this, void 0, void 0, function* () {
265
- var _a, _b, _c;
257
+ var _a, _b, _c, _d;
266
258
  const { name } = request;
267
259
  const _queryParams = {};
268
260
  _queryParams["name"] = name;
269
261
  let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
270
- const _response = yield core.fetcher({
271
- url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Prod).base, "v0/tts/voices"),
262
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
263
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/voices"),
272
264
  method: "DELETE",
273
265
  headers: _headers,
274
266
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
@@ -286,7 +278,6 @@ class Voices {
286
278
  unrecognizedObjectKeys: "passthrough",
287
279
  allowUnrecognizedUnionMembers: true,
288
280
  allowUnrecognizedEnumValues: true,
289
- skipValidation: true,
290
281
  breadcrumbsPrefix: ["response"],
291
282
  }), _response.rawResponse);
292
283
  default:
@@ -1,4 +1,3 @@
1
- export * from "./TtsOutput.js";
2
1
  export * from "./AudioFormatType.js";
3
2
  export * from "./PublishTts.js";
4
3
  export * from "./MillisecondInterval.js";
@@ -11,6 +10,8 @@ export * from "./PostedUtteranceVoiceWithName.js";
11
10
  export * from "./VoiceProvider.js";
12
11
  export * from "./PostedUtteranceVoice.js";
13
12
  export * from "./OctaveVersion.js";
13
+ export * from "./TtsOutput.js";
14
+ export * from "./Snippet.js";
14
15
  export * from "./PostedContextWithGenerationId.js";
15
16
  export * from "./PostedContextWithUtterances.js";
16
17
  export * from "./AudioEncoding.js";
@@ -23,7 +24,6 @@ export * from "./PostedTts.js";
23
24
  export * from "./ReturnTts.js";
24
25
  export * from "./ReturnVoice.js";
25
26
  export * from "./FormatPcm.js";
26
- export * from "./Snippet.js";
27
27
  export * from "./PostedUtterance.js";
28
28
  export * from "./ValidationErrorLocItem.js";
29
29
  export * from "./ValidationError.js";
@@ -14,7 +14,6 @@ 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("./TtsOutput.js"), exports);
18
17
  __exportStar(require("./AudioFormatType.js"), exports);
19
18
  __exportStar(require("./PublishTts.js"), exports);
20
19
  __exportStar(require("./MillisecondInterval.js"), exports);
@@ -27,6 +26,8 @@ __exportStar(require("./PostedUtteranceVoiceWithName.js"), exports);
27
26
  __exportStar(require("./VoiceProvider.js"), exports);
28
27
  __exportStar(require("./PostedUtteranceVoice.js"), exports);
29
28
  __exportStar(require("./OctaveVersion.js"), exports);
29
+ __exportStar(require("./TtsOutput.js"), exports);
30
+ __exportStar(require("./Snippet.js"), exports);
30
31
  __exportStar(require("./PostedContextWithGenerationId.js"), exports);
31
32
  __exportStar(require("./PostedContextWithUtterances.js"), exports);
32
33
  __exportStar(require("./AudioEncoding.js"), exports);
@@ -39,7 +40,6 @@ __exportStar(require("./PostedTts.js"), exports);
39
40
  __exportStar(require("./ReturnTts.js"), exports);
40
41
  __exportStar(require("./ReturnVoice.js"), exports);
41
42
  __exportStar(require("./FormatPcm.js"), exports);
42
- __exportStar(require("./Snippet.js"), exports);
43
43
  __exportStar(require("./PostedUtterance.js"), exports);
44
44
  __exportStar(require("./ValidationErrorLocItem.js"), exports);
45
45
  __exportStar(require("./ValidationError.js"), exports);