hume 0.8.1 → 0.8.3

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 (23) hide show
  1. package/.mock/definition/empathic-voice/chat.yml +3 -4
  2. package/README.md +17 -10
  3. package/api/resources/empathicVoice/resources/chat/client/Socket.d.ts +1 -1
  4. package/api/resources/empathicVoice/resources/chat/client/Socket.js +1 -1
  5. package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +2 -2
  6. package/api/resources/empathicVoice/resources/chats/client/Client.js +2 -2
  7. package/api/resources/empathicVoice/resources/configs/client/Client.js +9 -9
  8. package/api/resources/empathicVoice/resources/prompts/client/Client.js +9 -9
  9. package/api/resources/empathicVoice/resources/tools/client/Client.js +9 -9
  10. package/api/resources/expressionMeasurement/resources/batch/client/Client.js +6 -6
  11. package/dist/api/resources/empathicVoice/resources/chat/client/Socket.d.ts +1 -1
  12. package/dist/api/resources/empathicVoice/resources/chat/client/Socket.js +1 -1
  13. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +2 -2
  14. package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +2 -2
  15. package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +9 -9
  16. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +9 -9
  17. package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +9 -9
  18. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +6 -6
  19. package/dist/wrapper/fetchAccessToken.d.ts +5 -5
  20. package/dist/wrapper/fetchAccessToken.js +35 -13
  21. package/package.json +3 -2
  22. package/wrapper/fetchAccessToken.d.ts +5 -5
  23. package/wrapper/fetchAccessToken.js +35 -13
@@ -23,10 +23,9 @@ channel:
23
23
  `config_id`.
24
24
 
25
25
 
26
- Configs, as well as Prompts, Tools, and Language Models, are versioned.
27
- This versioning system supports iterative development, allowing you to
28
- progressively refine configurations and revert to previous versions if
29
- needed.
26
+ Configs, as well as Prompts and Tools, are versioned. This versioning
27
+ system supports iterative development, allowing you to progressively
28
+ refine configurations and revert to previous versions if needed.
30
29
 
31
30
 
32
31
  Include this parameter to apply a specific version of an EVI
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  <br>
10
10
  <div>
11
11
  <a href="https://www.npmjs.com/package/hume"><img src="https://img.shields.io/npm/v/hume">
12
- <a href="https://buildwithfern.com/"><img src="https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen">
12
+ <a href="https://buildwithfern.com/"><img src="https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen">
13
13
  </div>
14
14
  <br>
15
15
  </div>
@@ -41,9 +41,11 @@ const job = await hume.expressionMeasurement.batch.startInferenceJob({
41
41
  });
42
42
 
43
43
  console.log("Running...");
44
+
44
45
  await job.awaitCompletion();
45
46
 
46
47
  const predictions = await hume.expressionMeasurement.batch.getJobPredictions(job.jobId);
48
+
47
49
  console.log(predictions);
48
50
  ```
49
51
 
@@ -82,11 +84,13 @@ import { HumeClient } from "hume";
82
84
  const hume = new HumeClient({
83
85
  apiKey: "YOUR_API_KEY",
84
86
  });
87
+
85
88
  const socket = hume.expressionMeasurement.stream.connect({
86
89
  config: {
87
90
  language: {},
88
91
  },
89
92
  });
93
+
90
94
  for (const sample of samples) {
91
95
  const result = await socket.sendText({ text: sample });
92
96
  console.log(result);
@@ -105,16 +109,19 @@ const hume = new HumeClient({
105
109
  secretKey: "<>",
106
110
  });
107
111
 
108
- const socket = await hume.empathicVoice.chat.connect({
109
- async onMessage(message): Promise<void> {
110
- if (message.type === "audio_output") {
111
- const decoded = Buffer.from(message.data, "base64");
112
- // play decoded message
113
- }
114
- },
115
- });
112
+ const socket = hume.empathicVoice.chat.connect();
113
+
114
+ socket.on('message', (message) => {
115
+ if (message.type === "audio_output") {
116
+ const decoded = Buffer.from(message.data, "base64");
117
+ // play decoded message
118
+ }
119
+ })
120
+
121
+ // optional utility to wait for socket to be open
122
+ await socket.tillSocketOpen();
116
123
 
117
- await socket.sendTextInput("Hello, how are you?");
124
+ socket.sendUserInput("Hello, how are you?");
118
125
  ```
119
126
 
120
127
  ## Errors
@@ -5,7 +5,7 @@ export declare namespace ChatSocket {
5
5
  socket: core.ReconnectingWebSocket;
6
6
  }
7
7
  type Response = Hume.empathicVoice.SubscribeEvent & {
8
- receivedAt: number;
8
+ receivedAt: Date;
9
9
  };
10
10
  type EventHandlers = {
11
11
  open?: () => void;
@@ -53,7 +53,7 @@ class ChatSocket {
53
53
  breadcrumbsPrefix: ["response"],
54
54
  });
55
55
  if (parsedResponse.ok) {
56
- (_b = (_a = this.eventHandlers).message) === null || _b === void 0 ? void 0 : _b.call(_a, Object.assign(Object.assign({}, parsedResponse.value), { receivedAt: Date.now() }));
56
+ (_b = (_a = this.eventHandlers).message) === null || _b === void 0 ? void 0 : _b.call(_a, Object.assign(Object.assign({}, parsedResponse.value), { receivedAt: new Date() }));
57
57
  }
58
58
  else {
59
59
  (_d = (_c = this.eventHandlers).error) === null || _d === void 0 ? void 0 : _d.call(_c, new Error(`Received unknown message type`));
@@ -75,7 +75,7 @@ class ChatGroups {
75
75
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
76
76
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/chat_groups"),
77
77
  method: "GET",
78
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
79
  contentType: "application/json",
80
80
  queryParameters: _queryParams,
81
81
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -136,7 +136,7 @@ class ChatGroups {
136
136
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
137
137
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/chat_groups/${encodeURIComponent(id)}/events`),
138
138
  method: "GET",
139
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
139
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
140
140
  contentType: "application/json",
141
141
  queryParameters: _queryParams,
142
142
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -72,7 +72,7 @@ class Chats {
72
72
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
73
73
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/chats"),
74
74
  method: "GET",
75
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
75
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
76
76
  contentType: "application/json",
77
77
  queryParameters: _queryParams,
78
78
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -133,7 +133,7 @@ class Chats {
133
133
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
134
134
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/chats/${encodeURIComponent(id)}`),
135
135
  method: "GET",
136
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
136
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
137
137
  contentType: "application/json",
138
138
  queryParameters: _queryParams,
139
139
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -75,7 +75,7 @@ class Configs {
75
75
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
76
76
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/configs"),
77
77
  method: "GET",
78
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
79
  contentType: "application/json",
80
80
  queryParameters: _queryParams,
81
81
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -126,7 +126,7 @@ class Configs {
126
126
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
127
127
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/configs"),
128
128
  method: "POST",
129
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
129
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
130
130
  contentType: "application/json",
131
131
  body: serializers.empathicVoice.PostedConfig.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
132
132
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -187,7 +187,7 @@ class Configs {
187
187
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
188
188
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
189
189
  method: "GET",
190
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
190
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
191
191
  contentType: "application/json",
192
192
  queryParameters: _queryParams,
193
193
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -237,7 +237,7 @@ class Configs {
237
237
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
238
238
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
239
239
  method: "POST",
240
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
240
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
241
241
  contentType: "application/json",
242
242
  body: serializers.empathicVoice.PostedConfigVersion.jsonOrThrow(request, {
243
243
  unrecognizedObjectKeys: "strip",
@@ -288,7 +288,7 @@ class Configs {
288
288
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
289
289
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
290
290
  method: "DELETE",
291
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
291
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
292
292
  contentType: "application/json",
293
293
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
294
294
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -334,7 +334,7 @@ class Configs {
334
334
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
335
335
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
336
336
  method: "PATCH",
337
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
337
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
338
338
  contentType: "application/json",
339
339
  body: serializers.empathicVoice.PostedConfigName.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
340
340
  responseType: "text",
@@ -380,7 +380,7 @@ class Configs {
380
380
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
381
381
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
382
382
  method: "GET",
383
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
383
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
384
384
  contentType: "application/json",
385
385
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
386
386
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -429,7 +429,7 @@ class Configs {
429
429
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
430
430
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
431
431
  method: "DELETE",
432
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
432
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
433
433
  contentType: "application/json",
434
434
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
435
435
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -474,7 +474,7 @@ class Configs {
474
474
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
475
475
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
476
476
  method: "PATCH",
477
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
477
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
478
478
  contentType: "application/json",
479
479
  body: serializers.empathicVoice.PostedConfigVersionDescription.jsonOrThrow(request, {
480
480
  unrecognizedObjectKeys: "strip",
@@ -75,7 +75,7 @@ class Prompts {
75
75
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
76
76
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/prompts"),
77
77
  method: "GET",
78
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
79
  contentType: "application/json",
80
80
  queryParameters: _queryParams,
81
81
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -127,7 +127,7 @@ class Prompts {
127
127
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
128
128
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/prompts"),
129
129
  method: "POST",
130
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
130
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
131
131
  contentType: "application/json",
132
132
  body: serializers.empathicVoice.PostedPrompt.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
133
133
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -188,7 +188,7 @@ class Prompts {
188
188
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
189
189
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
190
190
  method: "GET",
191
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
191
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
192
192
  contentType: "application/json",
193
193
  queryParameters: _queryParams,
194
194
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -240,7 +240,7 @@ class Prompts {
240
240
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
241
241
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
242
242
  method: "POST",
243
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
243
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
244
244
  contentType: "application/json",
245
245
  body: serializers.empathicVoice.PostedPromptVersion.jsonOrThrow(request, {
246
246
  unrecognizedObjectKeys: "strip",
@@ -291,7 +291,7 @@ class Prompts {
291
291
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
292
292
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
293
293
  method: "DELETE",
294
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
294
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
295
295
  contentType: "application/json",
296
296
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
297
297
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -337,7 +337,7 @@ class Prompts {
337
337
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
338
338
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
339
339
  method: "PATCH",
340
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
340
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
341
341
  contentType: "application/json",
342
342
  body: serializers.empathicVoice.PostedPromptName.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
343
343
  responseType: "text",
@@ -383,7 +383,7 @@ class Prompts {
383
383
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
384
384
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
385
385
  method: "GET",
386
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
386
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
387
387
  contentType: "application/json",
388
388
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
389
389
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -432,7 +432,7 @@ class Prompts {
432
432
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
433
433
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
434
434
  method: "DELETE",
435
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
435
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
436
436
  contentType: "application/json",
437
437
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
438
438
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -477,7 +477,7 @@ class Prompts {
477
477
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
478
478
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
479
479
  method: "PATCH",
480
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
480
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
481
481
  contentType: "application/json",
482
482
  body: serializers.empathicVoice.PostedPromptVersionDescription.jsonOrThrow(request, {
483
483
  unrecognizedObjectKeys: "strip",
@@ -78,7 +78,7 @@ class Tools {
78
78
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
79
79
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/tools"),
80
80
  method: "GET",
81
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
81
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
82
82
  contentType: "application/json",
83
83
  queryParameters: _queryParams,
84
84
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -133,7 +133,7 @@ class Tools {
133
133
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
134
134
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/tools"),
135
135
  method: "POST",
136
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
136
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
137
137
  contentType: "application/json",
138
138
  body: serializers.empathicVoice.PostedUserDefinedTool.jsonOrThrow(request, {
139
139
  unrecognizedObjectKeys: "strip",
@@ -196,7 +196,7 @@ class Tools {
196
196
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
197
197
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
198
198
  method: "GET",
199
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
199
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
200
200
  contentType: "application/json",
201
201
  queryParameters: _queryParams,
202
202
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -251,7 +251,7 @@ class Tools {
251
251
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
252
252
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
253
253
  method: "POST",
254
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
254
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
255
255
  contentType: "application/json",
256
256
  body: serializers.empathicVoice.PostedUserDefinedToolVersion.jsonOrThrow(request, {
257
257
  unrecognizedObjectKeys: "strip",
@@ -302,7 +302,7 @@ class Tools {
302
302
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
303
303
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
304
304
  method: "DELETE",
305
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
305
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
306
306
  contentType: "application/json",
307
307
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
308
308
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -348,7 +348,7 @@ class Tools {
348
348
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
349
349
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
350
350
  method: "PATCH",
351
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
351
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
352
352
  contentType: "application/json",
353
353
  body: serializers.empathicVoice.PostedUserDefinedToolName.jsonOrThrow(request, {
354
354
  unrecognizedObjectKeys: "strip",
@@ -396,7 +396,7 @@ class Tools {
396
396
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
397
397
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
398
398
  method: "GET",
399
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
399
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
400
400
  contentType: "application/json",
401
401
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
402
402
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -445,7 +445,7 @@ class Tools {
445
445
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
446
446
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
447
447
  method: "DELETE",
448
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
448
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
449
449
  contentType: "application/json",
450
450
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
451
451
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -492,7 +492,7 @@ class Tools {
492
492
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
493
493
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
494
494
  method: "PATCH",
495
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
495
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
496
496
  contentType: "application/json",
497
497
  body: serializers.empathicVoice.PostedUserDefinedToolVersionDescription.jsonOrThrow(request, {
498
498
  unrecognizedObjectKeys: "strip",
@@ -96,7 +96,7 @@ class Batch {
96
96
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
97
97
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/batch/jobs"),
98
98
  method: "GET",
99
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
99
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
100
100
  contentType: "application/json",
101
101
  queryParameters: _queryParams,
102
102
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -150,7 +150,7 @@ class Batch {
150
150
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
151
151
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/batch/jobs"),
152
152
  method: "POST",
153
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
153
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
154
154
  contentType: "application/json",
155
155
  body: serializers.expressionMeasurement.InferenceBaseRequest.jsonOrThrow(request, {
156
156
  unrecognizedObjectKeys: "strip",
@@ -203,7 +203,7 @@ class Batch {
203
203
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
204
204
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/batch/jobs/${encodeURIComponent(id)}`),
205
205
  method: "GET",
206
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
206
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
207
207
  contentType: "application/json",
208
208
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
209
209
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -253,7 +253,7 @@ class Batch {
253
253
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
254
254
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/batch/jobs/${encodeURIComponent(id)}/predictions`),
255
255
  method: "GET",
256
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
256
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
257
257
  contentType: "application/json",
258
258
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
259
259
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -297,7 +297,7 @@ class Batch {
297
297
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
298
298
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/batch/jobs/${encodeURIComponent(id)}/artifacts`),
299
299
  method: "GET",
300
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
300
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
301
301
  contentType: "application/json",
302
302
  responseType: "streaming",
303
303
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -352,7 +352,7 @@ class Batch {
352
352
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
353
353
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/batch/jobs"),
354
354
  method: "POST",
355
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), (yield _maybeEncodedRequest.getHeaders())),
355
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), (yield _maybeEncodedRequest.getHeaders())),
356
356
  body: yield _maybeEncodedRequest.getBody(),
357
357
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
358
358
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -5,7 +5,7 @@ export declare namespace ChatSocket {
5
5
  socket: core.ReconnectingWebSocket;
6
6
  }
7
7
  type Response = Hume.empathicVoice.SubscribeEvent & {
8
- receivedAt: number;
8
+ receivedAt: Date;
9
9
  };
10
10
  type EventHandlers = {
11
11
  open?: () => void;
@@ -53,7 +53,7 @@ class ChatSocket {
53
53
  breadcrumbsPrefix: ["response"],
54
54
  });
55
55
  if (parsedResponse.ok) {
56
- (_b = (_a = this.eventHandlers).message) === null || _b === void 0 ? void 0 : _b.call(_a, Object.assign(Object.assign({}, parsedResponse.value), { receivedAt: Date.now() }));
56
+ (_b = (_a = this.eventHandlers).message) === null || _b === void 0 ? void 0 : _b.call(_a, Object.assign(Object.assign({}, parsedResponse.value), { receivedAt: new Date() }));
57
57
  }
58
58
  else {
59
59
  (_d = (_c = this.eventHandlers).error) === null || _d === void 0 ? void 0 : _d.call(_c, new Error(`Received unknown message type`));
@@ -75,7 +75,7 @@ class ChatGroups {
75
75
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
76
76
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/chat_groups"),
77
77
  method: "GET",
78
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
79
  contentType: "application/json",
80
80
  queryParameters: _queryParams,
81
81
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -136,7 +136,7 @@ class ChatGroups {
136
136
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
137
137
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/chat_groups/${encodeURIComponent(id)}/events`),
138
138
  method: "GET",
139
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
139
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
140
140
  contentType: "application/json",
141
141
  queryParameters: _queryParams,
142
142
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -72,7 +72,7 @@ class Chats {
72
72
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
73
73
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/chats"),
74
74
  method: "GET",
75
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
75
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
76
76
  contentType: "application/json",
77
77
  queryParameters: _queryParams,
78
78
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -133,7 +133,7 @@ class Chats {
133
133
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
134
134
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/chats/${encodeURIComponent(id)}`),
135
135
  method: "GET",
136
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
136
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
137
137
  contentType: "application/json",
138
138
  queryParameters: _queryParams,
139
139
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -75,7 +75,7 @@ class Configs {
75
75
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
76
76
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/configs"),
77
77
  method: "GET",
78
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
79
  contentType: "application/json",
80
80
  queryParameters: _queryParams,
81
81
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -126,7 +126,7 @@ class Configs {
126
126
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
127
127
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/configs"),
128
128
  method: "POST",
129
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
129
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
130
130
  contentType: "application/json",
131
131
  body: serializers.empathicVoice.PostedConfig.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
132
132
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -187,7 +187,7 @@ class Configs {
187
187
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
188
188
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
189
189
  method: "GET",
190
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
190
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
191
191
  contentType: "application/json",
192
192
  queryParameters: _queryParams,
193
193
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -237,7 +237,7 @@ class Configs {
237
237
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
238
238
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
239
239
  method: "POST",
240
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
240
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
241
241
  contentType: "application/json",
242
242
  body: serializers.empathicVoice.PostedConfigVersion.jsonOrThrow(request, {
243
243
  unrecognizedObjectKeys: "strip",
@@ -288,7 +288,7 @@ class Configs {
288
288
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
289
289
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
290
290
  method: "DELETE",
291
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
291
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
292
292
  contentType: "application/json",
293
293
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
294
294
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -334,7 +334,7 @@ class Configs {
334
334
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
335
335
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
336
336
  method: "PATCH",
337
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
337
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
338
338
  contentType: "application/json",
339
339
  body: serializers.empathicVoice.PostedConfigName.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
340
340
  responseType: "text",
@@ -380,7 +380,7 @@ class Configs {
380
380
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
381
381
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
382
382
  method: "GET",
383
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
383
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
384
384
  contentType: "application/json",
385
385
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
386
386
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -429,7 +429,7 @@ class Configs {
429
429
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
430
430
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
431
431
  method: "DELETE",
432
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
432
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
433
433
  contentType: "application/json",
434
434
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
435
435
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -474,7 +474,7 @@ class Configs {
474
474
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
475
475
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
476
476
  method: "PATCH",
477
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
477
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
478
478
  contentType: "application/json",
479
479
  body: serializers.empathicVoice.PostedConfigVersionDescription.jsonOrThrow(request, {
480
480
  unrecognizedObjectKeys: "strip",
@@ -75,7 +75,7 @@ class Prompts {
75
75
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
76
76
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/prompts"),
77
77
  method: "GET",
78
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
78
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
79
79
  contentType: "application/json",
80
80
  queryParameters: _queryParams,
81
81
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -127,7 +127,7 @@ class Prompts {
127
127
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
128
128
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/prompts"),
129
129
  method: "POST",
130
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
130
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
131
131
  contentType: "application/json",
132
132
  body: serializers.empathicVoice.PostedPrompt.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
133
133
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -188,7 +188,7 @@ class Prompts {
188
188
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
189
189
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
190
190
  method: "GET",
191
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
191
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
192
192
  contentType: "application/json",
193
193
  queryParameters: _queryParams,
194
194
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -240,7 +240,7 @@ class Prompts {
240
240
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
241
241
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
242
242
  method: "POST",
243
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
243
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
244
244
  contentType: "application/json",
245
245
  body: serializers.empathicVoice.PostedPromptVersion.jsonOrThrow(request, {
246
246
  unrecognizedObjectKeys: "strip",
@@ -291,7 +291,7 @@ class Prompts {
291
291
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
292
292
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
293
293
  method: "DELETE",
294
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
294
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
295
295
  contentType: "application/json",
296
296
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
297
297
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -337,7 +337,7 @@ class Prompts {
337
337
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
338
338
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
339
339
  method: "PATCH",
340
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
340
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
341
341
  contentType: "application/json",
342
342
  body: serializers.empathicVoice.PostedPromptName.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
343
343
  responseType: "text",
@@ -383,7 +383,7 @@ class Prompts {
383
383
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
384
384
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
385
385
  method: "GET",
386
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
386
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
387
387
  contentType: "application/json",
388
388
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
389
389
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -432,7 +432,7 @@ class Prompts {
432
432
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
433
433
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
434
434
  method: "DELETE",
435
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
435
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
436
436
  contentType: "application/json",
437
437
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
438
438
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -477,7 +477,7 @@ class Prompts {
477
477
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
478
478
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
479
479
  method: "PATCH",
480
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
480
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
481
481
  contentType: "application/json",
482
482
  body: serializers.empathicVoice.PostedPromptVersionDescription.jsonOrThrow(request, {
483
483
  unrecognizedObjectKeys: "strip",
@@ -78,7 +78,7 @@ class Tools {
78
78
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
79
79
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/tools"),
80
80
  method: "GET",
81
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
81
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
82
82
  contentType: "application/json",
83
83
  queryParameters: _queryParams,
84
84
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -133,7 +133,7 @@ class Tools {
133
133
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
134
134
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/tools"),
135
135
  method: "POST",
136
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
136
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
137
137
  contentType: "application/json",
138
138
  body: serializers.empathicVoice.PostedUserDefinedTool.jsonOrThrow(request, {
139
139
  unrecognizedObjectKeys: "strip",
@@ -196,7 +196,7 @@ class Tools {
196
196
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
197
197
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
198
198
  method: "GET",
199
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
199
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
200
200
  contentType: "application/json",
201
201
  queryParameters: _queryParams,
202
202
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -251,7 +251,7 @@ class Tools {
251
251
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
252
252
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
253
253
  method: "POST",
254
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
254
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
255
255
  contentType: "application/json",
256
256
  body: serializers.empathicVoice.PostedUserDefinedToolVersion.jsonOrThrow(request, {
257
257
  unrecognizedObjectKeys: "strip",
@@ -302,7 +302,7 @@ class Tools {
302
302
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
303
303
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
304
304
  method: "DELETE",
305
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
305
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
306
306
  contentType: "application/json",
307
307
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
308
308
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -348,7 +348,7 @@ class Tools {
348
348
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
349
349
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
350
350
  method: "PATCH",
351
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
351
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
352
352
  contentType: "application/json",
353
353
  body: serializers.empathicVoice.PostedUserDefinedToolName.jsonOrThrow(request, {
354
354
  unrecognizedObjectKeys: "strip",
@@ -396,7 +396,7 @@ class Tools {
396
396
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
397
397
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
398
398
  method: "GET",
399
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
399
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
400
400
  contentType: "application/json",
401
401
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
402
402
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -445,7 +445,7 @@ class Tools {
445
445
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
446
446
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
447
447
  method: "DELETE",
448
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
448
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
449
449
  contentType: "application/json",
450
450
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
451
451
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -492,7 +492,7 @@ class Tools {
492
492
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
493
493
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
494
494
  method: "PATCH",
495
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
495
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
496
496
  contentType: "application/json",
497
497
  body: serializers.empathicVoice.PostedUserDefinedToolVersionDescription.jsonOrThrow(request, {
498
498
  unrecognizedObjectKeys: "strip",
@@ -96,7 +96,7 @@ class Batch {
96
96
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
97
97
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/batch/jobs"),
98
98
  method: "GET",
99
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
99
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
100
100
  contentType: "application/json",
101
101
  queryParameters: _queryParams,
102
102
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -150,7 +150,7 @@ class Batch {
150
150
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
151
151
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/batch/jobs"),
152
152
  method: "POST",
153
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
153
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
154
154
  contentType: "application/json",
155
155
  body: serializers.expressionMeasurement.InferenceBaseRequest.jsonOrThrow(request, {
156
156
  unrecognizedObjectKeys: "strip",
@@ -203,7 +203,7 @@ class Batch {
203
203
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
204
204
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/batch/jobs/${encodeURIComponent(id)}`),
205
205
  method: "GET",
206
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
206
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
207
207
  contentType: "application/json",
208
208
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
209
209
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -253,7 +253,7 @@ class Batch {
253
253
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
254
254
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/batch/jobs/${encodeURIComponent(id)}/predictions`),
255
255
  method: "GET",
256
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
256
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
257
257
  contentType: "application/json",
258
258
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
259
259
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -297,7 +297,7 @@ class Batch {
297
297
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
298
298
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/batch/jobs/${encodeURIComponent(id)}/artifacts`),
299
299
  method: "GET",
300
- headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
300
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
301
301
  contentType: "application/json",
302
302
  responseType: "streaming",
303
303
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -352,7 +352,7 @@ class Batch {
352
352
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
353
353
  url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/batch/jobs"),
354
354
  method: "POST",
355
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.7.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), (yield _maybeEncodedRequest.getHeaders())),
355
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), (yield _maybeEncodedRequest.getHeaders())),
356
356
  body: yield _maybeEncodedRequest.getBody(),
357
357
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
358
358
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
@@ -2,9 +2,8 @@
2
2
  * Fetches a new access token from the Hume API using the provided API key and Secret key.
3
3
  *
4
4
  * @param args - The arguments for the request.
5
- * @returns Promise that resolves to the new access token.
5
+ * @returns Promise that resolves to the new access token or null.
6
6
  * @throws If the base64 encoding fails.
7
- * @throws If the network request fails.
8
7
  * @example
9
8
  * ```typescript
10
9
  * async function getToken() {
@@ -12,12 +11,13 @@
12
11
  * apiKey: 'test',
13
12
  * secretKey: 'test',
14
13
  * });
14
+ *
15
15
  * console.log(accessToken); // Outputs the access token
16
16
  * }
17
17
  * ```
18
18
  */
19
- export declare const fetchAccessToken: (args: {
19
+ export declare const fetchAccessToken: ({ apiKey, secretKey, host, }: {
20
20
  apiKey: string;
21
21
  secretKey: string;
22
- host?: string;
23
- }) => Promise<string>;
22
+ host?: string | undefined;
23
+ }) => Promise<string | null>;
@@ -11,13 +11,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.fetchAccessToken = void 0;
13
13
  const base64Encode_1 = require("./base64Encode");
14
+ const zod_1 = require("zod");
14
15
  /**
15
16
  * Fetches a new access token from the Hume API using the provided API key and Secret key.
16
17
  *
17
18
  * @param args - The arguments for the request.
18
- * @returns Promise that resolves to the new access token.
19
+ * @returns Promise that resolves to the new access token or null.
19
20
  * @throws If the base64 encoding fails.
20
- * @throws If the network request fails.
21
21
  * @example
22
22
  * ```typescript
23
23
  * async function getToken() {
@@ -25,27 +25,49 @@ const base64Encode_1 = require("./base64Encode");
25
25
  * apiKey: 'test',
26
26
  * secretKey: 'test',
27
27
  * });
28
+ *
28
29
  * console.log(accessToken); // Outputs the access token
29
30
  * }
30
31
  * ```
31
32
  */
32
- const fetchAccessToken = (args) => __awaiter(void 0, void 0, void 0, function* () {
33
- const { apiKey, secretKey, host = 'api.hume.ai' } = args;
33
+ const fetchAccessToken = ({ apiKey, secretKey, host = "api.hume.ai", }) => __awaiter(void 0, void 0, void 0, function* () {
34
34
  const authString = `${apiKey}:${secretKey}`;
35
35
  const encoded = (0, base64Encode_1.base64Encode)(authString);
36
- const res = yield fetch(`https://${host}/oauth2-cc/token`, {
37
- method: 'POST',
36
+ const response = yield fetch(`https://${host}/oauth2-cc/token`, {
37
+ method: "POST",
38
38
  headers: {
39
- 'Content-Type': 'application/x-www-form-urlencoded',
39
+ "Content-Type": "application/x-www-form-urlencoded",
40
40
  Authorization: `Basic ${encoded}`,
41
41
  },
42
42
  body: new URLSearchParams({
43
- grant_type: 'client_credentials',
43
+ grant_type: "client_credentials",
44
44
  }).toString(),
45
- cache: 'no-cache',
46
- });
47
- const data = (yield res.json());
48
- const accessToken = String(data['access_token']);
49
- return accessToken;
45
+ cache: "no-cache",
46
+ })
47
+ .then((res) => {
48
+ // if reading response as json fails, return empty object
49
+ // this can happen when request returns XML due to server error
50
+ return res
51
+ .json()
52
+ .then((d) => d)
53
+ .catch(() => ({}));
54
+ })
55
+ .then((data) => {
56
+ // extract access_token value from received object
57
+ return zod_1.z
58
+ .object({
59
+ access_token: zod_1.z.string(),
60
+ })
61
+ .transform((data) => {
62
+ return data.access_token;
63
+ })
64
+ .safeParse(data);
65
+ }).catch(() => ({
66
+ success: false
67
+ }));
68
+ if (!response.success) {
69
+ return null;
70
+ }
71
+ return response.data;
50
72
  });
51
73
  exports.fetchAccessToken = fetchAccessToken;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hume",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "private": false,
5
5
  "repository": "https://github.com/HumeAI/hume-typescript-sdk",
6
6
  "main": "./index.js",
@@ -19,7 +19,8 @@
19
19
  "qs": "6.11.2",
20
20
  "form-data-encoder": "^4.0.2",
21
21
  "ws": "^8.14.2",
22
- "uuid": "9.0.1"
22
+ "uuid": "9.0.1",
23
+ "zod": "^3.23.8"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@types/url-join": "4.0.1",
@@ -2,9 +2,8 @@
2
2
  * Fetches a new access token from the Hume API using the provided API key and Secret key.
3
3
  *
4
4
  * @param args - The arguments for the request.
5
- * @returns Promise that resolves to the new access token.
5
+ * @returns Promise that resolves to the new access token or null.
6
6
  * @throws If the base64 encoding fails.
7
- * @throws If the network request fails.
8
7
  * @example
9
8
  * ```typescript
10
9
  * async function getToken() {
@@ -12,12 +11,13 @@
12
11
  * apiKey: 'test',
13
12
  * secretKey: 'test',
14
13
  * });
14
+ *
15
15
  * console.log(accessToken); // Outputs the access token
16
16
  * }
17
17
  * ```
18
18
  */
19
- export declare const fetchAccessToken: (args: {
19
+ export declare const fetchAccessToken: ({ apiKey, secretKey, host, }: {
20
20
  apiKey: string;
21
21
  secretKey: string;
22
- host?: string;
23
- }) => Promise<string>;
22
+ host?: string | undefined;
23
+ }) => Promise<string | null>;
@@ -11,13 +11,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.fetchAccessToken = void 0;
13
13
  const base64Encode_1 = require("./base64Encode");
14
+ const zod_1 = require("zod");
14
15
  /**
15
16
  * Fetches a new access token from the Hume API using the provided API key and Secret key.
16
17
  *
17
18
  * @param args - The arguments for the request.
18
- * @returns Promise that resolves to the new access token.
19
+ * @returns Promise that resolves to the new access token or null.
19
20
  * @throws If the base64 encoding fails.
20
- * @throws If the network request fails.
21
21
  * @example
22
22
  * ```typescript
23
23
  * async function getToken() {
@@ -25,27 +25,49 @@ const base64Encode_1 = require("./base64Encode");
25
25
  * apiKey: 'test',
26
26
  * secretKey: 'test',
27
27
  * });
28
+ *
28
29
  * console.log(accessToken); // Outputs the access token
29
30
  * }
30
31
  * ```
31
32
  */
32
- const fetchAccessToken = (args) => __awaiter(void 0, void 0, void 0, function* () {
33
- const { apiKey, secretKey, host = 'api.hume.ai' } = args;
33
+ const fetchAccessToken = ({ apiKey, secretKey, host = "api.hume.ai", }) => __awaiter(void 0, void 0, void 0, function* () {
34
34
  const authString = `${apiKey}:${secretKey}`;
35
35
  const encoded = (0, base64Encode_1.base64Encode)(authString);
36
- const res = yield fetch(`https://${host}/oauth2-cc/token`, {
37
- method: 'POST',
36
+ const response = yield fetch(`https://${host}/oauth2-cc/token`, {
37
+ method: "POST",
38
38
  headers: {
39
- 'Content-Type': 'application/x-www-form-urlencoded',
39
+ "Content-Type": "application/x-www-form-urlencoded",
40
40
  Authorization: `Basic ${encoded}`,
41
41
  },
42
42
  body: new URLSearchParams({
43
- grant_type: 'client_credentials',
43
+ grant_type: "client_credentials",
44
44
  }).toString(),
45
- cache: 'no-cache',
46
- });
47
- const data = (yield res.json());
48
- const accessToken = String(data['access_token']);
49
- return accessToken;
45
+ cache: "no-cache",
46
+ })
47
+ .then((res) => {
48
+ // if reading response as json fails, return empty object
49
+ // this can happen when request returns XML due to server error
50
+ return res
51
+ .json()
52
+ .then((d) => d)
53
+ .catch(() => ({}));
54
+ })
55
+ .then((data) => {
56
+ // extract access_token value from received object
57
+ return zod_1.z
58
+ .object({
59
+ access_token: zod_1.z.string(),
60
+ })
61
+ .transform((data) => {
62
+ return data.access_token;
63
+ })
64
+ .safeParse(data);
65
+ }).catch(() => ({
66
+ success: false
67
+ }));
68
+ if (!response.success) {
69
+ return null;
70
+ }
71
+ return response.data;
50
72
  });
51
73
  exports.fetchAccessToken = fetchAccessToken;