hume 0.9.18 → 0.10.0
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.
- package/.mock/definition/empathic-voice/chat.yml +16 -16
- package/.mock/definition/empathic-voice/chatGroups.yml +6 -0
- package/.mock/definition/empathic-voice/configs.yml +6 -0
- package/.mock/definition/empathic-voice/customVoices.yml +3 -0
- package/.mock/definition/empathic-voice/tools.yml +3 -0
- package/.mock/definition/expression-measurement/stream/stream.yml +206 -206
- package/.mock/definition/tts/voices.yml +4 -2
- package/.mock/fern.config.json +1 -1
- package/api/resources/empathicVoice/resources/chat/types/index.d.ts +1 -1
- package/api/resources/empathicVoice/resources/chat/types/index.js +1 -1
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +2 -2
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +139 -115
- package/api/resources/empathicVoice/resources/chats/client/Client.js +3 -3
- package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +2 -2
- package/api/resources/empathicVoice/resources/configs/client/Client.js +144 -120
- package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +1 -1
- package/api/resources/empathicVoice/resources/customVoices/client/Client.js +72 -60
- package/api/resources/empathicVoice/resources/prompts/client/Client.js +9 -9
- package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +1 -1
- package/api/resources/empathicVoice/resources/tools/client/Client.js +75 -63
- package/api/resources/expressionMeasurement/resources/batch/client/Client.js +6 -6
- package/api/resources/expressionMeasurement/resources/stream/resources/stream/types/index.d.ts +4 -4
- package/api/resources/expressionMeasurement/resources/stream/resources/stream/types/index.js +4 -4
- package/api/resources/tts/client/Client.js +4 -4
- package/api/resources/tts/resources/voices/client/Client.d.ts +1 -1
- package/api/resources/tts/resources/voices/client/Client.js +72 -60
- package/dist/api/resources/empathicVoice/resources/chat/types/index.d.ts +1 -1
- package/dist/api/resources/empathicVoice/resources/chat/types/index.js +1 -1
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +2 -2
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +139 -115
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +3 -3
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +2 -2
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +144 -120
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +1 -1
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +72 -60
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +9 -9
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +1 -1
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +75 -63
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +6 -6
- package/dist/api/resources/expressionMeasurement/resources/stream/resources/stream/types/index.d.ts +4 -4
- package/dist/api/resources/expressionMeasurement/resources/stream/resources/stream/types/index.js +4 -4
- package/dist/api/resources/tts/client/Client.js +4 -4
- package/dist/api/resources/tts/resources/voices/client/Client.d.ts +1 -1
- package/dist/api/resources/tts/resources/voices/client/Client.js +72 -60
- package/dist/serialization/resources/empathicVoice/resources/chat/types/index.d.ts +1 -1
- package/dist/serialization/resources/empathicVoice/resources/chat/types/index.js +1 -1
- package/dist/serialization/resources/expressionMeasurement/resources/stream/resources/stream/types/index.d.ts +4 -4
- package/dist/serialization/resources/expressionMeasurement/resources/stream/resources/stream/types/index.js +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +91 -14
- package/serialization/resources/empathicVoice/resources/chat/types/index.d.ts +1 -1
- package/serialization/resources/empathicVoice/resources/chat/types/index.js +1 -1
- package/serialization/resources/expressionMeasurement/resources/stream/resources/stream/types/index.d.ts +4 -4
- package/serialization/resources/expressionMeasurement/resources/stream/resources/stream/types/index.js +4 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -77,69 +77,81 @@ class Configs {
|
|
|
77
77
|
*/
|
|
78
78
|
listConfigs() {
|
|
79
79
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (_response.ok) {
|
|
107
|
-
return serializers.empathicVoice.ReturnPagedConfigs.parseOrThrow(_response.body, {
|
|
108
|
-
unrecognizedObjectKeys: "passthrough",
|
|
109
|
-
allowUnrecognizedUnionMembers: true,
|
|
110
|
-
allowUnrecognizedEnumValues: true,
|
|
111
|
-
breadcrumbsPrefix: ["response"],
|
|
80
|
+
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
var _a, _b, _c;
|
|
82
|
+
const { pageNumber, pageSize, restrictToMostRecent, name } = request;
|
|
83
|
+
const _queryParams = {};
|
|
84
|
+
if (pageNumber != null) {
|
|
85
|
+
_queryParams["page_number"] = pageNumber.toString();
|
|
86
|
+
}
|
|
87
|
+
if (pageSize != null) {
|
|
88
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
89
|
+
}
|
|
90
|
+
if (restrictToMostRecent != null) {
|
|
91
|
+
_queryParams["restrict_to_most_recent"] = restrictToMostRecent.toString();
|
|
92
|
+
}
|
|
93
|
+
if (name != null) {
|
|
94
|
+
_queryParams["name"] = name;
|
|
95
|
+
}
|
|
96
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
97
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, "v0/evi/configs"),
|
|
98
|
+
method: "GET",
|
|
99
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
100
|
+
contentType: "application/json",
|
|
101
|
+
queryParameters: _queryParams,
|
|
102
|
+
requestType: "json",
|
|
103
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
104
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
105
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
112
106
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
107
|
+
if (_response.ok) {
|
|
108
|
+
return serializers.empathicVoice.ReturnPagedConfigs.parseOrThrow(_response.body, {
|
|
109
|
+
unrecognizedObjectKeys: "passthrough",
|
|
110
|
+
allowUnrecognizedUnionMembers: true,
|
|
111
|
+
allowUnrecognizedEnumValues: true,
|
|
112
|
+
breadcrumbsPrefix: ["response"],
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (_response.error.reason === "status-code") {
|
|
116
|
+
switch (_response.error.statusCode) {
|
|
117
|
+
case 400:
|
|
118
|
+
throw new Hume.empathicVoice.BadRequestError(serializers.empathicVoice.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
119
|
+
unrecognizedObjectKeys: "passthrough",
|
|
120
|
+
allowUnrecognizedUnionMembers: true,
|
|
121
|
+
allowUnrecognizedEnumValues: true,
|
|
122
|
+
breadcrumbsPrefix: ["response"],
|
|
123
|
+
}));
|
|
124
|
+
default:
|
|
125
|
+
throw new errors.HumeError({
|
|
126
|
+
statusCode: _response.error.statusCode,
|
|
127
|
+
body: _response.error.body,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
switch (_response.error.reason) {
|
|
132
|
+
case "non-json":
|
|
124
133
|
throw new errors.HumeError({
|
|
125
134
|
statusCode: _response.error.statusCode,
|
|
126
|
-
body: _response.error.
|
|
135
|
+
body: _response.error.rawBody,
|
|
136
|
+
});
|
|
137
|
+
case "timeout":
|
|
138
|
+
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/configs.");
|
|
139
|
+
case "unknown":
|
|
140
|
+
throw new errors.HumeError({
|
|
141
|
+
message: _response.error.errorMessage,
|
|
127
142
|
});
|
|
128
143
|
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
message: _response.error.errorMessage,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
144
|
+
});
|
|
145
|
+
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 1;
|
|
146
|
+
return new core.Pageable({
|
|
147
|
+
response: yield list(request),
|
|
148
|
+
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.configsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
149
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.configsPage) !== null && _a !== void 0 ? _a : []; },
|
|
150
|
+
loadPage: (_response) => {
|
|
151
|
+
_offset += 1;
|
|
152
|
+
return list(core.setObjectProperty(request, "pageNumber", _offset));
|
|
153
|
+
},
|
|
154
|
+
});
|
|
143
155
|
});
|
|
144
156
|
}
|
|
145
157
|
/**
|
|
@@ -191,7 +203,7 @@ class Configs {
|
|
|
191
203
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
192
204
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, "v0/evi/configs"),
|
|
193
205
|
method: "POST",
|
|
194
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
206
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
195
207
|
contentType: "application/json",
|
|
196
208
|
requestType: "json",
|
|
197
209
|
body: serializers.empathicVoice.PostedConfig.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -254,66 +266,78 @@ class Configs {
|
|
|
254
266
|
*/
|
|
255
267
|
listConfigVersions(id_1) {
|
|
256
268
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
if (_response.ok) {
|
|
281
|
-
return serializers.empathicVoice.ReturnPagedConfigs.parseOrThrow(_response.body, {
|
|
282
|
-
unrecognizedObjectKeys: "passthrough",
|
|
283
|
-
allowUnrecognizedUnionMembers: true,
|
|
284
|
-
allowUnrecognizedEnumValues: true,
|
|
285
|
-
breadcrumbsPrefix: ["response"],
|
|
269
|
+
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
270
|
+
var _a, _b, _c;
|
|
271
|
+
const { pageNumber, pageSize, restrictToMostRecent } = request;
|
|
272
|
+
const _queryParams = {};
|
|
273
|
+
if (pageNumber != null) {
|
|
274
|
+
_queryParams["page_number"] = pageNumber.toString();
|
|
275
|
+
}
|
|
276
|
+
if (pageSize != null) {
|
|
277
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
278
|
+
}
|
|
279
|
+
if (restrictToMostRecent != null) {
|
|
280
|
+
_queryParams["restrict_to_most_recent"] = restrictToMostRecent.toString();
|
|
281
|
+
}
|
|
282
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
283
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
|
|
284
|
+
method: "GET",
|
|
285
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
286
|
+
contentType: "application/json",
|
|
287
|
+
queryParameters: _queryParams,
|
|
288
|
+
requestType: "json",
|
|
289
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
290
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
291
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
286
292
|
});
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
293
|
+
if (_response.ok) {
|
|
294
|
+
return serializers.empathicVoice.ReturnPagedConfigs.parseOrThrow(_response.body, {
|
|
295
|
+
unrecognizedObjectKeys: "passthrough",
|
|
296
|
+
allowUnrecognizedUnionMembers: true,
|
|
297
|
+
allowUnrecognizedEnumValues: true,
|
|
298
|
+
breadcrumbsPrefix: ["response"],
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
if (_response.error.reason === "status-code") {
|
|
302
|
+
switch (_response.error.statusCode) {
|
|
303
|
+
case 400:
|
|
304
|
+
throw new Hume.empathicVoice.BadRequestError(serializers.empathicVoice.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
305
|
+
unrecognizedObjectKeys: "passthrough",
|
|
306
|
+
allowUnrecognizedUnionMembers: true,
|
|
307
|
+
allowUnrecognizedEnumValues: true,
|
|
308
|
+
breadcrumbsPrefix: ["response"],
|
|
309
|
+
}));
|
|
310
|
+
default:
|
|
311
|
+
throw new errors.HumeError({
|
|
312
|
+
statusCode: _response.error.statusCode,
|
|
313
|
+
body: _response.error.body,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
switch (_response.error.reason) {
|
|
318
|
+
case "non-json":
|
|
298
319
|
throw new errors.HumeError({
|
|
299
320
|
statusCode: _response.error.statusCode,
|
|
300
|
-
body: _response.error.
|
|
321
|
+
body: _response.error.rawBody,
|
|
322
|
+
});
|
|
323
|
+
case "timeout":
|
|
324
|
+
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/configs/{id}.");
|
|
325
|
+
case "unknown":
|
|
326
|
+
throw new errors.HumeError({
|
|
327
|
+
message: _response.error.errorMessage,
|
|
301
328
|
});
|
|
302
329
|
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
message: _response.error.errorMessage,
|
|
315
|
-
});
|
|
316
|
-
}
|
|
330
|
+
});
|
|
331
|
+
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 1;
|
|
332
|
+
return new core.Pageable({
|
|
333
|
+
response: yield list(request),
|
|
334
|
+
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.configsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
335
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.configsPage) !== null && _a !== void 0 ? _a : []; },
|
|
336
|
+
loadPage: (_response) => {
|
|
337
|
+
_offset += 1;
|
|
338
|
+
return list(core.setObjectProperty(request, "pageNumber", _offset));
|
|
339
|
+
},
|
|
340
|
+
});
|
|
317
341
|
});
|
|
318
342
|
}
|
|
319
343
|
/**
|
|
@@ -369,7 +393,7 @@ class Configs {
|
|
|
369
393
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
370
394
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
|
|
371
395
|
method: "POST",
|
|
372
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
396
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
373
397
|
contentType: "application/json",
|
|
374
398
|
requestType: "json",
|
|
375
399
|
body: serializers.empathicVoice.PostedConfigVersion.jsonOrThrow(request, {
|
|
@@ -437,7 +461,7 @@ class Configs {
|
|
|
437
461
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
438
462
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
|
|
439
463
|
method: "DELETE",
|
|
440
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
464
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
441
465
|
contentType: "application/json",
|
|
442
466
|
requestType: "json",
|
|
443
467
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -500,7 +524,7 @@ class Configs {
|
|
|
500
524
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
501
525
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}`),
|
|
502
526
|
method: "PATCH",
|
|
503
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
527
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
504
528
|
contentType: "application/json",
|
|
505
529
|
requestType: "json",
|
|
506
530
|
body: serializers.empathicVoice.PostedConfigName.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -567,7 +591,7 @@ class Configs {
|
|
|
567
591
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
568
592
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
569
593
|
method: "GET",
|
|
570
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
594
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
571
595
|
contentType: "application/json",
|
|
572
596
|
requestType: "json",
|
|
573
597
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -637,7 +661,7 @@ class Configs {
|
|
|
637
661
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
638
662
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
639
663
|
method: "DELETE",
|
|
640
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
664
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
641
665
|
contentType: "application/json",
|
|
642
666
|
requestType: "json",
|
|
643
667
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -705,7 +729,7 @@ class Configs {
|
|
|
705
729
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
706
730
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/configs/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
707
731
|
method: "PATCH",
|
|
708
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
732
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
709
733
|
contentType: "application/json",
|
|
710
734
|
requestType: "json",
|
|
711
735
|
body: serializers.empathicVoice.PostedConfigVersionDescription.jsonOrThrow(request, {
|
|
@@ -39,7 +39,7 @@ export declare class CustomVoices {
|
|
|
39
39
|
* @example
|
|
40
40
|
* await client.empathicVoice.customVoices.listCustomVoices()
|
|
41
41
|
*/
|
|
42
|
-
listCustomVoices(request?: Hume.empathicVoice.CustomVoicesListCustomVoicesRequest, requestOptions?: CustomVoices.RequestOptions): Promise<Hume.empathicVoice.
|
|
42
|
+
listCustomVoices(request?: Hume.empathicVoice.CustomVoicesListCustomVoicesRequest, requestOptions?: CustomVoices.RequestOptions): Promise<core.Page<Hume.empathicVoice.ReturnCustomVoice>>;
|
|
43
43
|
/**
|
|
44
44
|
* Creates a **Custom Voice** that can be added to an [EVI configuration](/reference/empathic-voice-interface-evi/configs/create-config).
|
|
45
45
|
*
|
|
@@ -74,66 +74,78 @@ class CustomVoices {
|
|
|
74
74
|
*/
|
|
75
75
|
listCustomVoices() {
|
|
76
76
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (_response.ok) {
|
|
101
|
-
return serializers.empathicVoice.ReturnPagedCustomVoices.parseOrThrow(_response.body, {
|
|
102
|
-
unrecognizedObjectKeys: "passthrough",
|
|
103
|
-
allowUnrecognizedUnionMembers: true,
|
|
104
|
-
allowUnrecognizedEnumValues: true,
|
|
105
|
-
breadcrumbsPrefix: ["response"],
|
|
77
|
+
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
var _a, _b, _c;
|
|
79
|
+
const { pageNumber, pageSize, name } = request;
|
|
80
|
+
const _queryParams = {};
|
|
81
|
+
if (pageNumber != null) {
|
|
82
|
+
_queryParams["page_number"] = pageNumber.toString();
|
|
83
|
+
}
|
|
84
|
+
if (pageSize != null) {
|
|
85
|
+
_queryParams["page_size"] = pageSize.toString();
|
|
86
|
+
}
|
|
87
|
+
if (name != null) {
|
|
88
|
+
_queryParams["name"] = name;
|
|
89
|
+
}
|
|
90
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
91
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, "v0/evi/custom_voices"),
|
|
92
|
+
method: "GET",
|
|
93
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
94
|
+
contentType: "application/json",
|
|
95
|
+
queryParameters: _queryParams,
|
|
96
|
+
requestType: "json",
|
|
97
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
98
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
99
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
106
100
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
101
|
+
if (_response.ok) {
|
|
102
|
+
return serializers.empathicVoice.ReturnPagedCustomVoices.parseOrThrow(_response.body, {
|
|
103
|
+
unrecognizedObjectKeys: "passthrough",
|
|
104
|
+
allowUnrecognizedUnionMembers: true,
|
|
105
|
+
allowUnrecognizedEnumValues: true,
|
|
106
|
+
breadcrumbsPrefix: ["response"],
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (_response.error.reason === "status-code") {
|
|
110
|
+
switch (_response.error.statusCode) {
|
|
111
|
+
case 400:
|
|
112
|
+
throw new Hume.empathicVoice.BadRequestError(serializers.empathicVoice.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
113
|
+
unrecognizedObjectKeys: "passthrough",
|
|
114
|
+
allowUnrecognizedUnionMembers: true,
|
|
115
|
+
allowUnrecognizedEnumValues: true,
|
|
116
|
+
breadcrumbsPrefix: ["response"],
|
|
117
|
+
}));
|
|
118
|
+
default:
|
|
119
|
+
throw new errors.HumeError({
|
|
120
|
+
statusCode: _response.error.statusCode,
|
|
121
|
+
body: _response.error.body,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
switch (_response.error.reason) {
|
|
126
|
+
case "non-json":
|
|
118
127
|
throw new errors.HumeError({
|
|
119
128
|
statusCode: _response.error.statusCode,
|
|
120
|
-
body: _response.error.
|
|
129
|
+
body: _response.error.rawBody,
|
|
130
|
+
});
|
|
131
|
+
case "timeout":
|
|
132
|
+
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/custom_voices.");
|
|
133
|
+
case "unknown":
|
|
134
|
+
throw new errors.HumeError({
|
|
135
|
+
message: _response.error.errorMessage,
|
|
121
136
|
});
|
|
122
137
|
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
message: _response.error.errorMessage,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
138
|
+
});
|
|
139
|
+
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 1;
|
|
140
|
+
return new core.Pageable({
|
|
141
|
+
response: yield list(request),
|
|
142
|
+
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.customVoicesPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
143
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.customVoicesPage) !== null && _a !== void 0 ? _a : []; },
|
|
144
|
+
loadPage: (_response) => {
|
|
145
|
+
_offset += 1;
|
|
146
|
+
return list(core.setObjectProperty(request, "pageNumber", _offset));
|
|
147
|
+
},
|
|
148
|
+
});
|
|
137
149
|
});
|
|
138
150
|
}
|
|
139
151
|
/**
|
|
@@ -159,7 +171,7 @@ class CustomVoices {
|
|
|
159
171
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
160
172
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, "v0/evi/custom_voices"),
|
|
161
173
|
method: "POST",
|
|
162
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
174
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
163
175
|
contentType: "application/json",
|
|
164
176
|
requestType: "json",
|
|
165
177
|
body: serializers.empathicVoice.PostedCustomVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -225,7 +237,7 @@ class CustomVoices {
|
|
|
225
237
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
226
238
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/custom_voices/${encodeURIComponent(id)}`),
|
|
227
239
|
method: "GET",
|
|
228
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
240
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
229
241
|
contentType: "application/json",
|
|
230
242
|
requestType: "json",
|
|
231
243
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -295,7 +307,7 @@ class CustomVoices {
|
|
|
295
307
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
296
308
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/custom_voices/${encodeURIComponent(id)}`),
|
|
297
309
|
method: "POST",
|
|
298
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
310
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
299
311
|
contentType: "application/json",
|
|
300
312
|
requestType: "json",
|
|
301
313
|
body: serializers.empathicVoice.PostedCustomVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -361,7 +373,7 @@ class CustomVoices {
|
|
|
361
373
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
362
374
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/custom_voices/${encodeURIComponent(id)}`),
|
|
363
375
|
method: "DELETE",
|
|
364
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
376
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
365
377
|
contentType: "application/json",
|
|
366
378
|
requestType: "json",
|
|
367
379
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -424,7 +436,7 @@ class CustomVoices {
|
|
|
424
436
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
425
437
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/custom_voices/${encodeURIComponent(id)}`),
|
|
426
438
|
method: "PATCH",
|
|
427
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
439
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.0", "User-Agent": "hume/0.10.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
428
440
|
contentType: "application/json",
|
|
429
441
|
requestType: "json",
|
|
430
442
|
body: serializers.empathicVoice.PostedCustomVoiceName.jsonOrThrow(request, {
|