hume 0.11.2 → 0.11.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.
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +3 -1
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +9 -16
- package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +3 -1
- package/api/resources/empathicVoice/resources/chats/client/Client.js +7 -12
- package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +3 -1
- package/api/resources/empathicVoice/resources/configs/client/Client.js +19 -28
- package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +3 -1
- package/api/resources/empathicVoice/resources/customVoices/client/Client.js +13 -18
- package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +3 -1
- package/api/resources/empathicVoice/resources/prompts/client/Client.js +19 -28
- package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +3 -1
- package/api/resources/empathicVoice/resources/tools/client/Client.js +19 -28
- package/api/resources/expressionMeasurement/client/Client.d.ts +2 -0
- package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +3 -1
- package/api/resources/expressionMeasurement/resources/batch/client/Client.js +13 -20
- package/api/resources/tts/client/Client.d.ts +3 -1
- package/api/resources/tts/client/Client.js +9 -8
- package/api/resources/tts/resources/voices/client/Client.d.ts +3 -1
- package/api/resources/tts/resources/voices/client/Client.js +7 -10
- package/core/fetcher/Fetcher.d.ts +2 -1
- package/core/fetcher/Fetcher.js +22 -9
- package/core/form-data-utils/FormDataWrapper.js +5 -4
- package/core/form-data-utils/toReadableStream.d.ts +1 -0
- package/core/form-data-utils/toReadableStream.js +50 -0
- package/core/headers.d.ts +3 -0
- package/core/headers.js +29 -0
- package/core/index.d.ts +4 -4
- package/core/index.js +5 -4
- package/core/runtime/runtime.js +0 -1
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +3 -1
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +9 -16
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +3 -1
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +7 -12
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +3 -1
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +19 -28
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +3 -1
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +13 -18
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +3 -1
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +19 -28
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +3 -1
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +19 -28
- package/dist/api/resources/expressionMeasurement/client/Client.d.ts +2 -0
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +3 -1
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +13 -20
- package/dist/api/resources/tts/client/Client.d.ts +3 -1
- package/dist/api/resources/tts/client/Client.js +9 -8
- package/dist/api/resources/tts/resources/voices/client/Client.d.ts +3 -1
- package/dist/api/resources/tts/resources/voices/client/Client.js +7 -10
- package/dist/core/fetcher/Fetcher.d.ts +2 -1
- package/dist/core/fetcher/Fetcher.js +22 -9
- package/dist/core/form-data-utils/FormDataWrapper.js +5 -4
- package/dist/core/form-data-utils/toReadableStream.d.ts +1 -0
- package/dist/core/form-data-utils/toReadableStream.js +50 -0
- package/dist/core/headers.d.ts +3 -0
- package/dist/core/headers.js +29 -0
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +5 -4
- package/dist/core/runtime/runtime.js +0 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -3
- package/scripts/rename-to-esm-files.js +10 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
- /package/core/{streaming-fetcher → stream}/Stream.d.ts +0 -0
- /package/core/{streaming-fetcher → stream}/Stream.js +0 -0
- /package/core/{streaming-fetcher → stream}/index.d.ts +0 -0
- /package/core/{streaming-fetcher → stream}/index.js +0 -0
- /package/dist/core/{streaming-fetcher → stream}/Stream.d.ts +0 -0
- /package/dist/core/{streaming-fetcher → stream}/Stream.js +0 -0
- /package/dist/core/{streaming-fetcher → stream}/index.d.ts +0 -0
- /package/dist/core/{streaming-fetcher → stream}/index.js +0 -0
|
@@ -52,6 +52,7 @@ exports.Configs = void 0;
|
|
|
52
52
|
const environments = __importStar(require("../../../../../../environments"));
|
|
53
53
|
const core = __importStar(require("../../../../../../core"));
|
|
54
54
|
const Hume = __importStar(require("../../../../../index"));
|
|
55
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
55
56
|
const url_join_1 = __importDefault(require("url-join"));
|
|
56
57
|
const serializers = __importStar(require("../../../../../../serialization/index"));
|
|
57
58
|
const errors = __importStar(require("../../../../../../errors/index"));
|
|
@@ -78,7 +79,7 @@ class Configs {
|
|
|
78
79
|
listConfigs() {
|
|
79
80
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
80
81
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
var _a, _b, _c;
|
|
82
|
+
var _a, _b, _c, _d;
|
|
82
83
|
const { pageNumber, pageSize, restrictToMostRecent, name } = request;
|
|
83
84
|
const _queryParams = {};
|
|
84
85
|
if (pageNumber != null) {
|
|
@@ -96,10 +97,8 @@ class Configs {
|
|
|
96
97
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
97
98
|
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
99
|
method: "GET",
|
|
99
|
-
headers:
|
|
100
|
-
contentType: "application/json",
|
|
100
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
101
101
|
queryParameters: _queryParams,
|
|
102
|
-
requestType: "json",
|
|
103
102
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
104
103
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
105
104
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -210,11 +209,11 @@ class Configs {
|
|
|
210
209
|
}
|
|
211
210
|
__createConfig(request, requestOptions) {
|
|
212
211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
-
var _a, _b, _c;
|
|
212
|
+
var _a, _b, _c, _d;
|
|
214
213
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
215
214
|
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"),
|
|
216
215
|
method: "POST",
|
|
217
|
-
headers:
|
|
216
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
218
217
|
contentType: "application/json",
|
|
219
218
|
requestType: "json",
|
|
220
219
|
body: serializers.empathicVoice.PostedConfig.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -284,7 +283,7 @@ class Configs {
|
|
|
284
283
|
listConfigVersions(id_1) {
|
|
285
284
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
286
285
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
287
|
-
var _a, _b, _c;
|
|
286
|
+
var _a, _b, _c, _d;
|
|
288
287
|
const { pageNumber, pageSize, restrictToMostRecent } = request;
|
|
289
288
|
const _queryParams = {};
|
|
290
289
|
if (pageNumber != null) {
|
|
@@ -299,10 +298,8 @@ class Configs {
|
|
|
299
298
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
300
299
|
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)}`),
|
|
301
300
|
method: "GET",
|
|
302
|
-
headers:
|
|
303
|
-
contentType: "application/json",
|
|
301
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
304
302
|
queryParameters: _queryParams,
|
|
305
|
-
requestType: "json",
|
|
306
303
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
307
304
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
308
305
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -417,11 +414,11 @@ class Configs {
|
|
|
417
414
|
}
|
|
418
415
|
__createConfigVersion(id, request, requestOptions) {
|
|
419
416
|
return __awaiter(this, void 0, void 0, function* () {
|
|
420
|
-
var _a, _b, _c;
|
|
417
|
+
var _a, _b, _c, _d;
|
|
421
418
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
422
419
|
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)}`),
|
|
423
420
|
method: "POST",
|
|
424
|
-
headers:
|
|
421
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
425
422
|
contentType: "application/json",
|
|
426
423
|
requestType: "json",
|
|
427
424
|
body: serializers.empathicVoice.PostedConfigVersion.jsonOrThrow(request, {
|
|
@@ -494,13 +491,11 @@ class Configs {
|
|
|
494
491
|
}
|
|
495
492
|
__deleteConfig(id, requestOptions) {
|
|
496
493
|
return __awaiter(this, void 0, void 0, function* () {
|
|
497
|
-
var _a, _b, _c;
|
|
494
|
+
var _a, _b, _c, _d;
|
|
498
495
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
499
496
|
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)}`),
|
|
500
497
|
method: "DELETE",
|
|
501
|
-
headers:
|
|
502
|
-
contentType: "application/json",
|
|
503
|
-
requestType: "json",
|
|
498
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
504
499
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
505
500
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
506
501
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -563,11 +558,11 @@ class Configs {
|
|
|
563
558
|
}
|
|
564
559
|
__updateConfigName(id, request, requestOptions) {
|
|
565
560
|
return __awaiter(this, void 0, void 0, function* () {
|
|
566
|
-
var _a, _b, _c;
|
|
561
|
+
var _a, _b, _c, _d;
|
|
567
562
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
568
563
|
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)}`),
|
|
569
564
|
method: "PATCH",
|
|
570
|
-
headers:
|
|
565
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
571
566
|
contentType: "application/json",
|
|
572
567
|
requestType: "json",
|
|
573
568
|
body: serializers.empathicVoice.PostedConfigName.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -636,13 +631,11 @@ class Configs {
|
|
|
636
631
|
}
|
|
637
632
|
__getConfigVersion(id, version, requestOptions) {
|
|
638
633
|
return __awaiter(this, void 0, void 0, function* () {
|
|
639
|
-
var _a, _b, _c;
|
|
634
|
+
var _a, _b, _c, _d;
|
|
640
635
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
641
636
|
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)}`),
|
|
642
637
|
method: "GET",
|
|
643
|
-
headers:
|
|
644
|
-
contentType: "application/json",
|
|
645
|
-
requestType: "json",
|
|
638
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
646
639
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
647
640
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
648
641
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -715,13 +708,11 @@ class Configs {
|
|
|
715
708
|
}
|
|
716
709
|
__deleteConfigVersion(id, version, requestOptions) {
|
|
717
710
|
return __awaiter(this, void 0, void 0, function* () {
|
|
718
|
-
var _a, _b, _c;
|
|
711
|
+
var _a, _b, _c, _d;
|
|
719
712
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
720
713
|
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)}`),
|
|
721
714
|
method: "DELETE",
|
|
722
|
-
headers:
|
|
723
|
-
contentType: "application/json",
|
|
724
|
-
requestType: "json",
|
|
715
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
725
716
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
726
717
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
727
718
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -789,11 +780,11 @@ class Configs {
|
|
|
789
780
|
}
|
|
790
781
|
__updateConfigDescription(id_1, version_1) {
|
|
791
782
|
return __awaiter(this, arguments, void 0, function* (id, version, request = {}, requestOptions) {
|
|
792
|
-
var _a, _b, _c;
|
|
783
|
+
var _a, _b, _c, _d;
|
|
793
784
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
794
785
|
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)}`),
|
|
795
786
|
method: "PATCH",
|
|
796
|
-
headers:
|
|
787
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
797
788
|
contentType: "application/json",
|
|
798
789
|
requestType: "json",
|
|
799
790
|
body: serializers.empathicVoice.PostedConfigVersionDescription.jsonOrThrow(request, {
|
|
@@ -10,6 +10,8 @@ export declare namespace CustomVoices {
|
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
13
15
|
fetcher?: core.FetchFunction;
|
|
14
16
|
}
|
|
15
17
|
interface RequestOptions {
|
|
@@ -20,7 +22,7 @@ export declare namespace CustomVoices {
|
|
|
20
22
|
/** A hook to abort the request. */
|
|
21
23
|
abortSignal?: AbortSignal;
|
|
22
24
|
/** Additional headers to include in the request. */
|
|
23
|
-
headers?: Record<string, string>;
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
export declare class CustomVoices {
|
|
@@ -52,6 +52,7 @@ exports.CustomVoices = void 0;
|
|
|
52
52
|
const environments = __importStar(require("../../../../../../environments"));
|
|
53
53
|
const core = __importStar(require("../../../../../../core"));
|
|
54
54
|
const Hume = __importStar(require("../../../../../index"));
|
|
55
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
55
56
|
const url_join_1 = __importDefault(require("url-join"));
|
|
56
57
|
const serializers = __importStar(require("../../../../../../serialization/index"));
|
|
57
58
|
const errors = __importStar(require("../../../../../../errors/index"));
|
|
@@ -75,7 +76,7 @@ class CustomVoices {
|
|
|
75
76
|
listCustomVoices() {
|
|
76
77
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
77
78
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
var _a, _b, _c;
|
|
79
|
+
var _a, _b, _c, _d;
|
|
79
80
|
const { pageNumber, pageSize, name } = request;
|
|
80
81
|
const _queryParams = {};
|
|
81
82
|
if (pageNumber != null) {
|
|
@@ -90,10 +91,8 @@ class CustomVoices {
|
|
|
90
91
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
91
92
|
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
93
|
method: "GET",
|
|
93
|
-
headers:
|
|
94
|
-
contentType: "application/json",
|
|
94
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
95
95
|
queryParameters: _queryParams,
|
|
96
|
-
requestType: "json",
|
|
97
96
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
98
97
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
99
98
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -178,11 +177,11 @@ class CustomVoices {
|
|
|
178
177
|
}
|
|
179
178
|
__createCustomVoice(request, requestOptions) {
|
|
180
179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
|
-
var _a, _b, _c;
|
|
180
|
+
var _a, _b, _c, _d;
|
|
182
181
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
183
182
|
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"),
|
|
184
183
|
method: "POST",
|
|
185
|
-
headers:
|
|
184
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
186
185
|
contentType: "application/json",
|
|
187
186
|
requestType: "json",
|
|
188
187
|
body: serializers.empathicVoice.PostedCustomVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -253,13 +252,11 @@ class CustomVoices {
|
|
|
253
252
|
}
|
|
254
253
|
__getCustomVoice(id, requestOptions) {
|
|
255
254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
-
var _a, _b, _c;
|
|
255
|
+
var _a, _b, _c, _d;
|
|
257
256
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
258
257
|
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)}`),
|
|
259
258
|
method: "GET",
|
|
260
|
-
headers:
|
|
261
|
-
contentType: "application/json",
|
|
262
|
-
requestType: "json",
|
|
259
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
263
260
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
264
261
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
265
262
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -332,11 +329,11 @@ class CustomVoices {
|
|
|
332
329
|
}
|
|
333
330
|
__createCustomVoiceVersion(id, request, requestOptions) {
|
|
334
331
|
return __awaiter(this, void 0, void 0, function* () {
|
|
335
|
-
var _a, _b, _c;
|
|
332
|
+
var _a, _b, _c, _d;
|
|
336
333
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
337
334
|
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)}`),
|
|
338
335
|
method: "POST",
|
|
339
|
-
headers:
|
|
336
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
340
337
|
contentType: "application/json",
|
|
341
338
|
requestType: "json",
|
|
342
339
|
body: serializers.empathicVoice.PostedCustomVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -407,13 +404,11 @@ class CustomVoices {
|
|
|
407
404
|
}
|
|
408
405
|
__deleteCustomVoice(id, requestOptions) {
|
|
409
406
|
return __awaiter(this, void 0, void 0, function* () {
|
|
410
|
-
var _a, _b, _c;
|
|
407
|
+
var _a, _b, _c, _d;
|
|
411
408
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
412
409
|
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)}`),
|
|
413
410
|
method: "DELETE",
|
|
414
|
-
headers:
|
|
415
|
-
contentType: "application/json",
|
|
416
|
-
requestType: "json",
|
|
411
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
417
412
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
418
413
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
419
414
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -476,11 +471,11 @@ class CustomVoices {
|
|
|
476
471
|
}
|
|
477
472
|
__updateCustomVoiceName(id, request, requestOptions) {
|
|
478
473
|
return __awaiter(this, void 0, void 0, function* () {
|
|
479
|
-
var _a, _b, _c;
|
|
474
|
+
var _a, _b, _c, _d;
|
|
480
475
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
481
476
|
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)}`),
|
|
482
477
|
method: "PATCH",
|
|
483
|
-
headers:
|
|
478
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
484
479
|
contentType: "application/json",
|
|
485
480
|
requestType: "json",
|
|
486
481
|
body: serializers.empathicVoice.PostedCustomVoiceName.jsonOrThrow(request, {
|
|
@@ -10,6 +10,8 @@ export declare namespace Prompts {
|
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
13
15
|
fetcher?: core.FetchFunction;
|
|
14
16
|
}
|
|
15
17
|
interface RequestOptions {
|
|
@@ -20,7 +22,7 @@ export declare namespace Prompts {
|
|
|
20
22
|
/** A hook to abort the request. */
|
|
21
23
|
abortSignal?: AbortSignal;
|
|
22
24
|
/** Additional headers to include in the request. */
|
|
23
|
-
headers?: Record<string, string>;
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
export declare class Prompts {
|
|
@@ -52,6 +52,7 @@ exports.Prompts = void 0;
|
|
|
52
52
|
const environments = __importStar(require("../../../../../../environments"));
|
|
53
53
|
const core = __importStar(require("../../../../../../core"));
|
|
54
54
|
const Hume = __importStar(require("../../../../../index"));
|
|
55
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
55
56
|
const url_join_1 = __importDefault(require("url-join"));
|
|
56
57
|
const serializers = __importStar(require("../../../../../../serialization/index"));
|
|
57
58
|
const errors = __importStar(require("../../../../../../errors/index"));
|
|
@@ -78,7 +79,7 @@ class Prompts {
|
|
|
78
79
|
listPrompts() {
|
|
79
80
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
80
81
|
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
var _a, _b, _c;
|
|
82
|
+
var _a, _b, _c, _d;
|
|
82
83
|
const { pageNumber, pageSize, restrictToMostRecent, name } = request;
|
|
83
84
|
const _queryParams = {};
|
|
84
85
|
if (pageNumber != null) {
|
|
@@ -96,10 +97,8 @@ class Prompts {
|
|
|
96
97
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
97
98
|
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/prompts"),
|
|
98
99
|
method: "GET",
|
|
99
|
-
headers:
|
|
100
|
-
contentType: "application/json",
|
|
100
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
101
101
|
queryParameters: _queryParams,
|
|
102
|
-
requestType: "json",
|
|
103
102
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
104
103
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
105
104
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -183,11 +182,11 @@ class Prompts {
|
|
|
183
182
|
}
|
|
184
183
|
__createPrompt(request, requestOptions) {
|
|
185
184
|
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
-
var _a, _b, _c;
|
|
185
|
+
var _a, _b, _c, _d;
|
|
187
186
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
188
187
|
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/prompts"),
|
|
189
188
|
method: "POST",
|
|
190
|
-
headers:
|
|
189
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
191
190
|
contentType: "application/json",
|
|
192
191
|
requestType: "json",
|
|
193
192
|
body: serializers.empathicVoice.PostedPrompt.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -259,7 +258,7 @@ class Prompts {
|
|
|
259
258
|
}
|
|
260
259
|
__listPromptVersions(id_1) {
|
|
261
260
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
262
|
-
var _a, _b, _c;
|
|
261
|
+
var _a, _b, _c, _d;
|
|
263
262
|
const { pageNumber, pageSize, restrictToMostRecent } = request;
|
|
264
263
|
const _queryParams = {};
|
|
265
264
|
if (pageNumber != null) {
|
|
@@ -274,10 +273,8 @@ class Prompts {
|
|
|
274
273
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
275
274
|
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/prompts/${encodeURIComponent(id)}`),
|
|
276
275
|
method: "GET",
|
|
277
|
-
headers:
|
|
278
|
-
contentType: "application/json",
|
|
276
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
279
277
|
queryParameters: _queryParams,
|
|
280
|
-
requestType: "json",
|
|
281
278
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
282
279
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
283
280
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -349,11 +346,11 @@ class Prompts {
|
|
|
349
346
|
}
|
|
350
347
|
__createPromptVersion(id, request, requestOptions) {
|
|
351
348
|
return __awaiter(this, void 0, void 0, function* () {
|
|
352
|
-
var _a, _b, _c;
|
|
349
|
+
var _a, _b, _c, _d;
|
|
353
350
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
354
351
|
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/prompts/${encodeURIComponent(id)}`),
|
|
355
352
|
method: "POST",
|
|
356
|
-
headers:
|
|
353
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
357
354
|
contentType: "application/json",
|
|
358
355
|
requestType: "json",
|
|
359
356
|
body: serializers.empathicVoice.PostedPromptVersion.jsonOrThrow(request, {
|
|
@@ -426,13 +423,11 @@ class Prompts {
|
|
|
426
423
|
}
|
|
427
424
|
__deletePrompt(id, requestOptions) {
|
|
428
425
|
return __awaiter(this, void 0, void 0, function* () {
|
|
429
|
-
var _a, _b, _c;
|
|
426
|
+
var _a, _b, _c, _d;
|
|
430
427
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
431
428
|
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/prompts/${encodeURIComponent(id)}`),
|
|
432
429
|
method: "DELETE",
|
|
433
|
-
headers:
|
|
434
|
-
contentType: "application/json",
|
|
435
|
-
requestType: "json",
|
|
430
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
436
431
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
437
432
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
438
433
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -495,11 +490,11 @@ class Prompts {
|
|
|
495
490
|
}
|
|
496
491
|
__updatePromptName(id, request, requestOptions) {
|
|
497
492
|
return __awaiter(this, void 0, void 0, function* () {
|
|
498
|
-
var _a, _b, _c;
|
|
493
|
+
var _a, _b, _c, _d;
|
|
499
494
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
500
495
|
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/prompts/${encodeURIComponent(id)}`),
|
|
501
496
|
method: "PATCH",
|
|
502
|
-
headers:
|
|
497
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
503
498
|
contentType: "application/json",
|
|
504
499
|
requestType: "json",
|
|
505
500
|
body: serializers.empathicVoice.PostedPromptName.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -568,13 +563,11 @@ class Prompts {
|
|
|
568
563
|
}
|
|
569
564
|
__getPromptVersion(id, version, requestOptions) {
|
|
570
565
|
return __awaiter(this, void 0, void 0, function* () {
|
|
571
|
-
var _a, _b, _c;
|
|
566
|
+
var _a, _b, _c, _d;
|
|
572
567
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
573
568
|
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/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
574
569
|
method: "GET",
|
|
575
|
-
headers:
|
|
576
|
-
contentType: "application/json",
|
|
577
|
-
requestType: "json",
|
|
570
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
578
571
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
579
572
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
580
573
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -647,13 +640,11 @@ class Prompts {
|
|
|
647
640
|
}
|
|
648
641
|
__deletePromptVersion(id, version, requestOptions) {
|
|
649
642
|
return __awaiter(this, void 0, void 0, function* () {
|
|
650
|
-
var _a, _b, _c;
|
|
643
|
+
var _a, _b, _c, _d;
|
|
651
644
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
652
645
|
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/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
653
646
|
method: "DELETE",
|
|
654
|
-
headers:
|
|
655
|
-
contentType: "application/json",
|
|
656
|
-
requestType: "json",
|
|
647
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
657
648
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
658
649
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
659
650
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -721,11 +712,11 @@ class Prompts {
|
|
|
721
712
|
}
|
|
722
713
|
__updatePromptDescription(id_1, version_1) {
|
|
723
714
|
return __awaiter(this, arguments, void 0, function* (id, version, request = {}, requestOptions) {
|
|
724
|
-
var _a, _b, _c;
|
|
715
|
+
var _a, _b, _c, _d;
|
|
725
716
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
726
717
|
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/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
727
718
|
method: "PATCH",
|
|
728
|
-
headers:
|
|
719
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
729
720
|
contentType: "application/json",
|
|
730
721
|
requestType: "json",
|
|
731
722
|
body: serializers.empathicVoice.PostedPromptVersionDescription.jsonOrThrow(request, {
|
|
@@ -10,6 +10,8 @@ export declare namespace Tools {
|
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
13
15
|
fetcher?: core.FetchFunction;
|
|
14
16
|
}
|
|
15
17
|
interface RequestOptions {
|
|
@@ -20,7 +22,7 @@ export declare namespace Tools {
|
|
|
20
22
|
/** A hook to abort the request. */
|
|
21
23
|
abortSignal?: AbortSignal;
|
|
22
24
|
/** Additional headers to include in the request. */
|
|
23
|
-
headers?: Record<string, string>;
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
export declare class Tools {
|