hume 0.11.1 → 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/.mock/definition/empathic-voice/__package__.yml +24 -0
- package/.mock/definition/empathic-voice/configs.yml +2 -0
- package/.mock/definition/tts/__package__.yml +28 -0
- package/.mock/fern.config.json +1 -1
- package/Client.d.ts +11 -7
- package/Client.js +54 -6
- package/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
- package/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +7 -3
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +79 -52
- package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +5 -2
- package/api/resources/empathicVoice/resources/chats/client/Client.js +59 -39
- package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +17 -8
- package/api/resources/empathicVoice/resources/configs/client/Client.js +144 -83
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
- package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +13 -6
- package/api/resources/empathicVoice/resources/customVoices/client/Client.js +95 -53
- package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +19 -9
- package/api/resources/empathicVoice/resources/prompts/client/Client.js +143 -81
- package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +17 -8
- package/api/resources/empathicVoice/resources/tools/client/Client.js +144 -83
- package/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
- package/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
- package/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
- package/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
- package/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
- package/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
- package/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/api/resources/empathicVoice/types/index.d.ts +2 -0
- package/api/resources/empathicVoice/types/index.js +2 -0
- package/api/resources/expressionMeasurement/client/Client.d.ts +2 -0
- package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +15 -7
- package/api/resources/expressionMeasurement/resources/batch/client/Client.js +96 -52
- package/api/resources/tts/client/Client.d.ts +27 -19
- package/api/resources/tts/client/Client.js +89 -50
- package/api/resources/tts/client/index.d.ts +1 -1
- package/api/resources/tts/client/index.js +15 -0
- package/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
- package/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
- package/api/resources/tts/client/requests/index.d.ts +1 -0
- package/api/resources/tts/client/requests/index.js +2 -0
- package/api/resources/tts/errors/BadRequestError.d.ts +2 -1
- package/api/resources/tts/errors/BadRequestError.js +2 -1
- package/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
- package/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
- package/api/resources/tts/resources/voices/client/Client.d.ts +7 -3
- package/api/resources/tts/resources/voices/client/Client.js +49 -29
- package/api/resources/tts/types/Snippet.d.ts +2 -0
- package/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/Fetcher.d.ts +2 -1
- package/core/fetcher/Fetcher.js +29 -9
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/index.d.ts +3 -0
- package/core/fetcher/index.js +7 -1
- package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/core/form-data-utils/FormDataWrapper.js +53 -13
- 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/pagination/Page.d.ts +5 -2
- package/core/pagination/Page.js +5 -2
- package/core/pagination/Pageable.d.ts +2 -0
- package/core/runtime/runtime.js +0 -1
- package/dist/Client.d.ts +11 -7
- package/dist/Client.js +54 -6
- package/dist/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +7 -3
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +79 -52
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +5 -2
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +59 -39
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +17 -8
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +144 -83
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +13 -6
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +95 -53
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +19 -9
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +143 -81
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +17 -8
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +144 -83
- package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
- package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
- package/dist/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
- package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
- package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
- package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
- package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/dist/api/resources/empathicVoice/types/index.d.ts +2 -0
- package/dist/api/resources/empathicVoice/types/index.js +2 -0
- package/dist/api/resources/expressionMeasurement/client/Client.d.ts +2 -0
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +15 -7
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +96 -52
- package/dist/api/resources/tts/client/Client.d.ts +27 -19
- package/dist/api/resources/tts/client/Client.js +89 -50
- package/dist/api/resources/tts/client/index.d.ts +1 -1
- package/dist/api/resources/tts/client/index.js +15 -0
- package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
- package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
- package/dist/api/resources/tts/client/requests/index.d.ts +1 -0
- package/dist/api/resources/tts/client/requests/index.js +2 -0
- package/dist/api/resources/tts/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/tts/errors/BadRequestError.js +2 -1
- package/dist/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
- package/dist/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
- package/dist/api/resources/tts/resources/voices/client/Client.d.ts +7 -3
- package/dist/api/resources/tts/resources/voices/client/Client.js +49 -29
- package/dist/api/resources/tts/types/Snippet.d.ts +2 -0
- package/dist/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/Fetcher.d.ts +2 -1
- package/dist/core/fetcher/Fetcher.js +29 -9
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/index.d.ts +3 -0
- package/dist/core/fetcher/index.js +7 -1
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +53 -13
- 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/pagination/Page.d.ts +5 -2
- package/dist/core/pagination/Page.js +5 -2
- package/dist/core/pagination/Pageable.d.ts +2 -0
- package/dist/core/runtime/runtime.js +0 -1
- package/dist/errors/HumeError.d.ts +7 -2
- package/dist/errors/HumeError.js +10 -10
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
- package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
- package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
- package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
- package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/dist/serialization/resources/empathicVoice/types/index.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/types/index.js +2 -0
- package/dist/serialization/resources/tts/types/Snippet.d.ts +1 -0
- package/dist/serialization/resources/tts/types/Snippet.js +1 -0
- package/dist/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
- package/dist/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
- package/dist/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
- package/dist/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
- package/errors/HumeError.d.ts +7 -2
- package/errors/HumeError.js +10 -10
- package/package.json +9 -4
- package/reference.md +17 -15
- package/scripts/rename-to-esm-files.js +10 -2
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
- package/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
- package/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
- package/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
- package/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
- package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
- package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
- package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
- package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/serialization/resources/empathicVoice/types/index.d.ts +2 -0
- package/serialization/resources/empathicVoice/types/index.js +2 -0
- package/serialization/resources/tts/types/Snippet.d.ts +1 -0
- package/serialization/resources/tts/types/Snippet.js +1 -0
- package/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
- package/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
- package/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
- package/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
- /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
|
@@ -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 {
|
|
@@ -57,7 +59,8 @@ export declare class CustomVoices {
|
|
|
57
59
|
* parameterModel: "20241004-11parameter"
|
|
58
60
|
* })
|
|
59
61
|
*/
|
|
60
|
-
createCustomVoice(request: Hume.empathicVoice.PostedCustomVoice, requestOptions?: CustomVoices.RequestOptions):
|
|
62
|
+
createCustomVoice(request: Hume.empathicVoice.PostedCustomVoice, requestOptions?: CustomVoices.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnCustomVoice>;
|
|
63
|
+
private __createCustomVoice;
|
|
61
64
|
/**
|
|
62
65
|
* Fetches a specific **Custom Voice** by ID.
|
|
63
66
|
*
|
|
@@ -71,7 +74,8 @@ export declare class CustomVoices {
|
|
|
71
74
|
* @example
|
|
72
75
|
* await client.empathicVoice.customVoices.getCustomVoice("id")
|
|
73
76
|
*/
|
|
74
|
-
getCustomVoice(id: string, requestOptions?: CustomVoices.RequestOptions):
|
|
77
|
+
getCustomVoice(id: string, requestOptions?: CustomVoices.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnCustomVoice>;
|
|
78
|
+
private __getCustomVoice;
|
|
75
79
|
/**
|
|
76
80
|
* Updates a **Custom Voice** by creating a new version of the **Custom Voice**.
|
|
77
81
|
*
|
|
@@ -90,7 +94,8 @@ export declare class CustomVoices {
|
|
|
90
94
|
* parameterModel: "20241004-11parameter"
|
|
91
95
|
* })
|
|
92
96
|
*/
|
|
93
|
-
createCustomVoiceVersion(id: string, request: Hume.empathicVoice.PostedCustomVoice, requestOptions?: CustomVoices.RequestOptions):
|
|
97
|
+
createCustomVoiceVersion(id: string, request: Hume.empathicVoice.PostedCustomVoice, requestOptions?: CustomVoices.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnCustomVoice>;
|
|
98
|
+
private __createCustomVoiceVersion;
|
|
94
99
|
/**
|
|
95
100
|
* Deletes a **Custom Voice** and its versions.
|
|
96
101
|
*
|
|
@@ -104,7 +109,8 @@ export declare class CustomVoices {
|
|
|
104
109
|
* @example
|
|
105
110
|
* await client.empathicVoice.customVoices.deleteCustomVoice("id")
|
|
106
111
|
*/
|
|
107
|
-
deleteCustomVoice(id: string, requestOptions?: CustomVoices.RequestOptions):
|
|
112
|
+
deleteCustomVoice(id: string, requestOptions?: CustomVoices.RequestOptions): core.HttpResponsePromise<void>;
|
|
113
|
+
private __deleteCustomVoice;
|
|
108
114
|
/**
|
|
109
115
|
* Updates the name of a **Custom Voice**.
|
|
110
116
|
*
|
|
@@ -121,7 +127,8 @@ export declare class CustomVoices {
|
|
|
121
127
|
* name: "name"
|
|
122
128
|
* })
|
|
123
129
|
*/
|
|
124
|
-
updateCustomVoiceName(id: string, request: Hume.empathicVoice.PostedCustomVoiceName, requestOptions?: CustomVoices.RequestOptions):
|
|
130
|
+
updateCustomVoiceName(id: string, request: Hume.empathicVoice.PostedCustomVoiceName, requestOptions?: CustomVoices.RequestOptions): core.HttpResponsePromise<string>;
|
|
131
|
+
private __updateCustomVoiceName;
|
|
125
132
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
126
133
|
"X-Hume-Api-Key": string | undefined;
|
|
127
134
|
}>;
|
|
@@ -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"));
|
|
@@ -74,8 +75,8 @@ class CustomVoices {
|
|
|
74
75
|
*/
|
|
75
76
|
listCustomVoices() {
|
|
76
77
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
77
|
-
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
var _a, _b, _c;
|
|
78
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
var _a, _b, _c, _d;
|
|
79
80
|
const { pageNumber, pageSize, name } = request;
|
|
80
81
|
const _queryParams = {};
|
|
81
82
|
if (pageNumber != null) {
|
|
@@ -90,21 +91,22 @@ 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,
|
|
100
99
|
});
|
|
101
100
|
if (_response.ok) {
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
return {
|
|
102
|
+
data: serializers.empathicVoice.ReturnPagedCustomVoices.parseOrThrow(_response.body, {
|
|
103
|
+
unrecognizedObjectKeys: "passthrough",
|
|
104
|
+
allowUnrecognizedUnionMembers: true,
|
|
105
|
+
allowUnrecognizedEnumValues: true,
|
|
106
|
+
breadcrumbsPrefix: ["response"],
|
|
107
|
+
}),
|
|
108
|
+
rawResponse: _response.rawResponse,
|
|
109
|
+
};
|
|
108
110
|
}
|
|
109
111
|
if (_response.error.reason === "status-code") {
|
|
110
112
|
switch (_response.error.statusCode) {
|
|
@@ -114,11 +116,12 @@ class CustomVoices {
|
|
|
114
116
|
allowUnrecognizedUnionMembers: true,
|
|
115
117
|
allowUnrecognizedEnumValues: true,
|
|
116
118
|
breadcrumbsPrefix: ["response"],
|
|
117
|
-
}));
|
|
119
|
+
}), _response.rawResponse);
|
|
118
120
|
default:
|
|
119
121
|
throw new errors.HumeError({
|
|
120
122
|
statusCode: _response.error.statusCode,
|
|
121
123
|
body: _response.error.body,
|
|
124
|
+
rawResponse: _response.rawResponse,
|
|
122
125
|
});
|
|
123
126
|
}
|
|
124
127
|
}
|
|
@@ -127,18 +130,22 @@ class CustomVoices {
|
|
|
127
130
|
throw new errors.HumeError({
|
|
128
131
|
statusCode: _response.error.statusCode,
|
|
129
132
|
body: _response.error.rawBody,
|
|
133
|
+
rawResponse: _response.rawResponse,
|
|
130
134
|
});
|
|
131
135
|
case "timeout":
|
|
132
136
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/custom_voices.");
|
|
133
137
|
case "unknown":
|
|
134
138
|
throw new errors.HumeError({
|
|
135
139
|
message: _response.error.errorMessage,
|
|
140
|
+
rawResponse: _response.rawResponse,
|
|
136
141
|
});
|
|
137
142
|
}
|
|
138
|
-
});
|
|
143
|
+
}));
|
|
139
144
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
145
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
140
146
|
return new core.Pageable({
|
|
141
|
-
response:
|
|
147
|
+
response: dataWithRawResponse.data,
|
|
148
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
142
149
|
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.customVoicesPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
143
150
|
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.customVoicesPage) !== null && _a !== void 0 ? _a : []; },
|
|
144
151
|
loadPage: (_response) => {
|
|
@@ -166,12 +173,15 @@ class CustomVoices {
|
|
|
166
173
|
* })
|
|
167
174
|
*/
|
|
168
175
|
createCustomVoice(request, requestOptions) {
|
|
176
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomVoice(request, requestOptions));
|
|
177
|
+
}
|
|
178
|
+
__createCustomVoice(request, requestOptions) {
|
|
169
179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
var _a, _b, _c;
|
|
180
|
+
var _a, _b, _c, _d;
|
|
171
181
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
172
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"),
|
|
173
183
|
method: "POST",
|
|
174
|
-
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),
|
|
175
185
|
contentType: "application/json",
|
|
176
186
|
requestType: "json",
|
|
177
187
|
body: serializers.empathicVoice.PostedCustomVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -180,12 +190,15 @@ class CustomVoices {
|
|
|
180
190
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
181
191
|
});
|
|
182
192
|
if (_response.ok) {
|
|
183
|
-
return
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
193
|
+
return {
|
|
194
|
+
data: serializers.empathicVoice.ReturnCustomVoice.parseOrThrow(_response.body, {
|
|
195
|
+
unrecognizedObjectKeys: "passthrough",
|
|
196
|
+
allowUnrecognizedUnionMembers: true,
|
|
197
|
+
allowUnrecognizedEnumValues: true,
|
|
198
|
+
breadcrumbsPrefix: ["response"],
|
|
199
|
+
}),
|
|
200
|
+
rawResponse: _response.rawResponse,
|
|
201
|
+
};
|
|
189
202
|
}
|
|
190
203
|
if (_response.error.reason === "status-code") {
|
|
191
204
|
switch (_response.error.statusCode) {
|
|
@@ -195,11 +208,12 @@ class CustomVoices {
|
|
|
195
208
|
allowUnrecognizedUnionMembers: true,
|
|
196
209
|
allowUnrecognizedEnumValues: true,
|
|
197
210
|
breadcrumbsPrefix: ["response"],
|
|
198
|
-
}));
|
|
211
|
+
}), _response.rawResponse);
|
|
199
212
|
default:
|
|
200
213
|
throw new errors.HumeError({
|
|
201
214
|
statusCode: _response.error.statusCode,
|
|
202
215
|
body: _response.error.body,
|
|
216
|
+
rawResponse: _response.rawResponse,
|
|
203
217
|
});
|
|
204
218
|
}
|
|
205
219
|
}
|
|
@@ -208,12 +222,14 @@ class CustomVoices {
|
|
|
208
222
|
throw new errors.HumeError({
|
|
209
223
|
statusCode: _response.error.statusCode,
|
|
210
224
|
body: _response.error.rawBody,
|
|
225
|
+
rawResponse: _response.rawResponse,
|
|
211
226
|
});
|
|
212
227
|
case "timeout":
|
|
213
228
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/evi/custom_voices.");
|
|
214
229
|
case "unknown":
|
|
215
230
|
throw new errors.HumeError({
|
|
216
231
|
message: _response.error.errorMessage,
|
|
232
|
+
rawResponse: _response.rawResponse,
|
|
217
233
|
});
|
|
218
234
|
}
|
|
219
235
|
});
|
|
@@ -232,25 +248,29 @@ class CustomVoices {
|
|
|
232
248
|
* await client.empathicVoice.customVoices.getCustomVoice("id")
|
|
233
249
|
*/
|
|
234
250
|
getCustomVoice(id, requestOptions) {
|
|
251
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomVoice(id, requestOptions));
|
|
252
|
+
}
|
|
253
|
+
__getCustomVoice(id, requestOptions) {
|
|
235
254
|
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
-
var _a, _b, _c;
|
|
255
|
+
var _a, _b, _c, _d;
|
|
237
256
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
238
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)}`),
|
|
239
258
|
method: "GET",
|
|
240
|
-
headers:
|
|
241
|
-
contentType: "application/json",
|
|
242
|
-
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),
|
|
243
260
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
244
261
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
245
262
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
246
263
|
});
|
|
247
264
|
if (_response.ok) {
|
|
248
|
-
return
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
265
|
+
return {
|
|
266
|
+
data: serializers.empathicVoice.ReturnCustomVoice.parseOrThrow(_response.body, {
|
|
267
|
+
unrecognizedObjectKeys: "passthrough",
|
|
268
|
+
allowUnrecognizedUnionMembers: true,
|
|
269
|
+
allowUnrecognizedEnumValues: true,
|
|
270
|
+
breadcrumbsPrefix: ["response"],
|
|
271
|
+
}),
|
|
272
|
+
rawResponse: _response.rawResponse,
|
|
273
|
+
};
|
|
254
274
|
}
|
|
255
275
|
if (_response.error.reason === "status-code") {
|
|
256
276
|
switch (_response.error.statusCode) {
|
|
@@ -260,11 +280,12 @@ class CustomVoices {
|
|
|
260
280
|
allowUnrecognizedUnionMembers: true,
|
|
261
281
|
allowUnrecognizedEnumValues: true,
|
|
262
282
|
breadcrumbsPrefix: ["response"],
|
|
263
|
-
}));
|
|
283
|
+
}), _response.rawResponse);
|
|
264
284
|
default:
|
|
265
285
|
throw new errors.HumeError({
|
|
266
286
|
statusCode: _response.error.statusCode,
|
|
267
287
|
body: _response.error.body,
|
|
288
|
+
rawResponse: _response.rawResponse,
|
|
268
289
|
});
|
|
269
290
|
}
|
|
270
291
|
}
|
|
@@ -273,12 +294,14 @@ class CustomVoices {
|
|
|
273
294
|
throw new errors.HumeError({
|
|
274
295
|
statusCode: _response.error.statusCode,
|
|
275
296
|
body: _response.error.rawBody,
|
|
297
|
+
rawResponse: _response.rawResponse,
|
|
276
298
|
});
|
|
277
299
|
case "timeout":
|
|
278
300
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/custom_voices/{id}.");
|
|
279
301
|
case "unknown":
|
|
280
302
|
throw new errors.HumeError({
|
|
281
303
|
message: _response.error.errorMessage,
|
|
304
|
+
rawResponse: _response.rawResponse,
|
|
282
305
|
});
|
|
283
306
|
}
|
|
284
307
|
});
|
|
@@ -302,12 +325,15 @@ class CustomVoices {
|
|
|
302
325
|
* })
|
|
303
326
|
*/
|
|
304
327
|
createCustomVoiceVersion(id, request, requestOptions) {
|
|
328
|
+
return core.HttpResponsePromise.fromPromise(this.__createCustomVoiceVersion(id, request, requestOptions));
|
|
329
|
+
}
|
|
330
|
+
__createCustomVoiceVersion(id, request, requestOptions) {
|
|
305
331
|
return __awaiter(this, void 0, void 0, function* () {
|
|
306
|
-
var _a, _b, _c;
|
|
332
|
+
var _a, _b, _c, _d;
|
|
307
333
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
308
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)}`),
|
|
309
335
|
method: "POST",
|
|
310
|
-
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),
|
|
311
337
|
contentType: "application/json",
|
|
312
338
|
requestType: "json",
|
|
313
339
|
body: serializers.empathicVoice.PostedCustomVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -316,12 +342,15 @@ class CustomVoices {
|
|
|
316
342
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
317
343
|
});
|
|
318
344
|
if (_response.ok) {
|
|
319
|
-
return
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
345
|
+
return {
|
|
346
|
+
data: serializers.empathicVoice.ReturnCustomVoice.parseOrThrow(_response.body, {
|
|
347
|
+
unrecognizedObjectKeys: "passthrough",
|
|
348
|
+
allowUnrecognizedUnionMembers: true,
|
|
349
|
+
allowUnrecognizedEnumValues: true,
|
|
350
|
+
breadcrumbsPrefix: ["response"],
|
|
351
|
+
}),
|
|
352
|
+
rawResponse: _response.rawResponse,
|
|
353
|
+
};
|
|
325
354
|
}
|
|
326
355
|
if (_response.error.reason === "status-code") {
|
|
327
356
|
switch (_response.error.statusCode) {
|
|
@@ -331,11 +360,12 @@ class CustomVoices {
|
|
|
331
360
|
allowUnrecognizedUnionMembers: true,
|
|
332
361
|
allowUnrecognizedEnumValues: true,
|
|
333
362
|
breadcrumbsPrefix: ["response"],
|
|
334
|
-
}));
|
|
363
|
+
}), _response.rawResponse);
|
|
335
364
|
default:
|
|
336
365
|
throw new errors.HumeError({
|
|
337
366
|
statusCode: _response.error.statusCode,
|
|
338
367
|
body: _response.error.body,
|
|
368
|
+
rawResponse: _response.rawResponse,
|
|
339
369
|
});
|
|
340
370
|
}
|
|
341
371
|
}
|
|
@@ -344,12 +374,14 @@ class CustomVoices {
|
|
|
344
374
|
throw new errors.HumeError({
|
|
345
375
|
statusCode: _response.error.statusCode,
|
|
346
376
|
body: _response.error.rawBody,
|
|
377
|
+
rawResponse: _response.rawResponse,
|
|
347
378
|
});
|
|
348
379
|
case "timeout":
|
|
349
380
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/evi/custom_voices/{id}.");
|
|
350
381
|
case "unknown":
|
|
351
382
|
throw new errors.HumeError({
|
|
352
383
|
message: _response.error.errorMessage,
|
|
384
|
+
rawResponse: _response.rawResponse,
|
|
353
385
|
});
|
|
354
386
|
}
|
|
355
387
|
});
|
|
@@ -368,20 +400,21 @@ class CustomVoices {
|
|
|
368
400
|
* await client.empathicVoice.customVoices.deleteCustomVoice("id")
|
|
369
401
|
*/
|
|
370
402
|
deleteCustomVoice(id, requestOptions) {
|
|
403
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCustomVoice(id, requestOptions));
|
|
404
|
+
}
|
|
405
|
+
__deleteCustomVoice(id, requestOptions) {
|
|
371
406
|
return __awaiter(this, void 0, void 0, function* () {
|
|
372
|
-
var _a, _b, _c;
|
|
407
|
+
var _a, _b, _c, _d;
|
|
373
408
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
374
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)}`),
|
|
375
410
|
method: "DELETE",
|
|
376
|
-
headers:
|
|
377
|
-
contentType: "application/json",
|
|
378
|
-
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),
|
|
379
412
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
380
413
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
381
414
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
382
415
|
});
|
|
383
416
|
if (_response.ok) {
|
|
384
|
-
return;
|
|
417
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
385
418
|
}
|
|
386
419
|
if (_response.error.reason === "status-code") {
|
|
387
420
|
switch (_response.error.statusCode) {
|
|
@@ -391,11 +424,12 @@ class CustomVoices {
|
|
|
391
424
|
allowUnrecognizedUnionMembers: true,
|
|
392
425
|
allowUnrecognizedEnumValues: true,
|
|
393
426
|
breadcrumbsPrefix: ["response"],
|
|
394
|
-
}));
|
|
427
|
+
}), _response.rawResponse);
|
|
395
428
|
default:
|
|
396
429
|
throw new errors.HumeError({
|
|
397
430
|
statusCode: _response.error.statusCode,
|
|
398
431
|
body: _response.error.body,
|
|
432
|
+
rawResponse: _response.rawResponse,
|
|
399
433
|
});
|
|
400
434
|
}
|
|
401
435
|
}
|
|
@@ -404,12 +438,14 @@ class CustomVoices {
|
|
|
404
438
|
throw new errors.HumeError({
|
|
405
439
|
statusCode: _response.error.statusCode,
|
|
406
440
|
body: _response.error.rawBody,
|
|
441
|
+
rawResponse: _response.rawResponse,
|
|
407
442
|
});
|
|
408
443
|
case "timeout":
|
|
409
444
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling DELETE /v0/evi/custom_voices/{id}.");
|
|
410
445
|
case "unknown":
|
|
411
446
|
throw new errors.HumeError({
|
|
412
447
|
message: _response.error.errorMessage,
|
|
448
|
+
rawResponse: _response.rawResponse,
|
|
413
449
|
});
|
|
414
450
|
}
|
|
415
451
|
});
|
|
@@ -431,12 +467,15 @@ class CustomVoices {
|
|
|
431
467
|
* })
|
|
432
468
|
*/
|
|
433
469
|
updateCustomVoiceName(id, request, requestOptions) {
|
|
470
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCustomVoiceName(id, request, requestOptions));
|
|
471
|
+
}
|
|
472
|
+
__updateCustomVoiceName(id, request, requestOptions) {
|
|
434
473
|
return __awaiter(this, void 0, void 0, function* () {
|
|
435
|
-
var _a, _b, _c;
|
|
474
|
+
var _a, _b, _c, _d;
|
|
436
475
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
437
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)}`),
|
|
438
477
|
method: "PATCH",
|
|
439
|
-
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),
|
|
440
479
|
contentType: "application/json",
|
|
441
480
|
requestType: "json",
|
|
442
481
|
body: serializers.empathicVoice.PostedCustomVoiceName.jsonOrThrow(request, {
|
|
@@ -448,7 +487,7 @@ class CustomVoices {
|
|
|
448
487
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
449
488
|
});
|
|
450
489
|
if (_response.ok) {
|
|
451
|
-
return _response.body;
|
|
490
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
452
491
|
}
|
|
453
492
|
if (_response.error.reason === "status-code") {
|
|
454
493
|
switch (_response.error.statusCode) {
|
|
@@ -458,11 +497,12 @@ class CustomVoices {
|
|
|
458
497
|
allowUnrecognizedUnionMembers: true,
|
|
459
498
|
allowUnrecognizedEnumValues: true,
|
|
460
499
|
breadcrumbsPrefix: ["response"],
|
|
461
|
-
}));
|
|
500
|
+
}), _response.rawResponse);
|
|
462
501
|
default:
|
|
463
502
|
throw new errors.HumeError({
|
|
464
503
|
statusCode: _response.error.statusCode,
|
|
465
504
|
body: _response.error.body,
|
|
505
|
+
rawResponse: _response.rawResponse,
|
|
466
506
|
});
|
|
467
507
|
}
|
|
468
508
|
}
|
|
@@ -471,12 +511,14 @@ class CustomVoices {
|
|
|
471
511
|
throw new errors.HumeError({
|
|
472
512
|
statusCode: _response.error.statusCode,
|
|
473
513
|
body: _response.error.rawBody,
|
|
514
|
+
rawResponse: _response.rawResponse,
|
|
474
515
|
});
|
|
475
516
|
case "timeout":
|
|
476
517
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling PATCH /v0/evi/custom_voices/{id}.");
|
|
477
518
|
case "unknown":
|
|
478
519
|
throw new errors.HumeError({
|
|
479
520
|
message: _response.error.errorMessage,
|
|
521
|
+
rawResponse: _response.rawResponse,
|
|
480
522
|
});
|
|
481
523
|
}
|
|
482
524
|
});
|
|
@@ -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 {
|
|
@@ -59,7 +61,8 @@ export declare class Prompts {
|
|
|
59
61
|
* text: "<role>You are an AI weather assistant providing users with accurate and up-to-date weather information. Respond to user queries concisely and clearly. Use simple language and avoid technical jargon. Provide temperature, precipitation, wind conditions, and any weather alerts. Include helpful tips if severe weather is expected.</role>"
|
|
60
62
|
* })
|
|
61
63
|
*/
|
|
62
|
-
createPrompt(request: Hume.empathicVoice.PostedPrompt, requestOptions?: Prompts.RequestOptions):
|
|
64
|
+
createPrompt(request: Hume.empathicVoice.PostedPrompt, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnPrompt | undefined>;
|
|
65
|
+
private __createPrompt;
|
|
63
66
|
/**
|
|
64
67
|
* Fetches a list of a **Prompt's** versions.
|
|
65
68
|
*
|
|
@@ -74,7 +77,8 @@ export declare class Prompts {
|
|
|
74
77
|
* @example
|
|
75
78
|
* await client.empathicVoice.prompts.listPromptVersions("af699d45-2985-42cc-91b9-af9e5da3bac5")
|
|
76
79
|
*/
|
|
77
|
-
listPromptVersions(id: string, request?: Hume.empathicVoice.PromptsListPromptVersionsRequest, requestOptions?: Prompts.RequestOptions):
|
|
80
|
+
listPromptVersions(id: string, request?: Hume.empathicVoice.PromptsListPromptVersionsRequest, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnPagedPrompts>;
|
|
81
|
+
private __listPromptVersions;
|
|
78
82
|
/**
|
|
79
83
|
* Updates a **Prompt** by creating a new version of the **Prompt**.
|
|
80
84
|
*
|
|
@@ -92,7 +96,8 @@ export declare class Prompts {
|
|
|
92
96
|
* versionDescription: "This is an updated version of the Weather Assistant Prompt."
|
|
93
97
|
* })
|
|
94
98
|
*/
|
|
95
|
-
createPromptVersion(id: string, request: Hume.empathicVoice.PostedPromptVersion, requestOptions?: Prompts.RequestOptions):
|
|
99
|
+
createPromptVersion(id: string, request: Hume.empathicVoice.PostedPromptVersion, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnPrompt | undefined>;
|
|
100
|
+
private __createPromptVersion;
|
|
96
101
|
/**
|
|
97
102
|
* Deletes a **Prompt** and its versions.
|
|
98
103
|
*
|
|
@@ -106,7 +111,8 @@ export declare class Prompts {
|
|
|
106
111
|
* @example
|
|
107
112
|
* await client.empathicVoice.prompts.deletePrompt("af699d45-2985-42cc-91b9-af9e5da3bac5")
|
|
108
113
|
*/
|
|
109
|
-
deletePrompt(id: string, requestOptions?: Prompts.RequestOptions):
|
|
114
|
+
deletePrompt(id: string, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<void>;
|
|
115
|
+
private __deletePrompt;
|
|
110
116
|
/**
|
|
111
117
|
* Updates the name of a **Prompt**.
|
|
112
118
|
*
|
|
@@ -123,7 +129,8 @@ export declare class Prompts {
|
|
|
123
129
|
* name: "Updated Weather Assistant Prompt Name"
|
|
124
130
|
* })
|
|
125
131
|
*/
|
|
126
|
-
updatePromptName(id: string, request: Hume.empathicVoice.PostedPromptName, requestOptions?: Prompts.RequestOptions):
|
|
132
|
+
updatePromptName(id: string, request: Hume.empathicVoice.PostedPromptName, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<string>;
|
|
133
|
+
private __updatePromptName;
|
|
127
134
|
/**
|
|
128
135
|
* Fetches a specified version of a **Prompt**.
|
|
129
136
|
*
|
|
@@ -142,7 +149,8 @@ export declare class Prompts {
|
|
|
142
149
|
* @example
|
|
143
150
|
* await client.empathicVoice.prompts.getPromptVersion("af699d45-2985-42cc-91b9-af9e5da3bac5", 0)
|
|
144
151
|
*/
|
|
145
|
-
getPromptVersion(id: string, version: number, requestOptions?: Prompts.RequestOptions):
|
|
152
|
+
getPromptVersion(id: string, version: number, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnPrompt | undefined>;
|
|
153
|
+
private __getPromptVersion;
|
|
146
154
|
/**
|
|
147
155
|
* Deletes a specified version of a **Prompt**.
|
|
148
156
|
*
|
|
@@ -161,7 +169,8 @@ export declare class Prompts {
|
|
|
161
169
|
* @example
|
|
162
170
|
* await client.empathicVoice.prompts.deletePromptVersion("af699d45-2985-42cc-91b9-af9e5da3bac5", 1)
|
|
163
171
|
*/
|
|
164
|
-
deletePromptVersion(id: string, version: number, requestOptions?: Prompts.RequestOptions):
|
|
172
|
+
deletePromptVersion(id: string, version: number, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<void>;
|
|
173
|
+
private __deletePromptVersion;
|
|
165
174
|
/**
|
|
166
175
|
* Updates the description of a **Prompt**.
|
|
167
176
|
*
|
|
@@ -183,7 +192,8 @@ export declare class Prompts {
|
|
|
183
192
|
* versionDescription: "This is an updated version_description."
|
|
184
193
|
* })
|
|
185
194
|
*/
|
|
186
|
-
updatePromptDescription(id: string, version: number, request?: Hume.empathicVoice.PostedPromptVersionDescription, requestOptions?: Prompts.RequestOptions):
|
|
195
|
+
updatePromptDescription(id: string, version: number, request?: Hume.empathicVoice.PostedPromptVersionDescription, requestOptions?: Prompts.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnPrompt | undefined>;
|
|
196
|
+
private __updatePromptDescription;
|
|
187
197
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
188
198
|
"X-Hume-Api-Key": string | undefined;
|
|
189
199
|
}>;
|