hume 0.11.1 → 0.11.2
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 +4 -2
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +74 -40
- package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
- package/api/resources/empathicVoice/resources/chats/client/Client.js +55 -30
- package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
- package/api/resources/empathicVoice/resources/configs/client/Client.js +134 -64
- 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 +10 -5
- package/api/resources/empathicVoice/resources/customVoices/client/Client.js +88 -41
- package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
- package/api/resources/empathicVoice/resources/prompts/client/Client.js +133 -62
- package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
- package/api/resources/empathicVoice/resources/tools/client/Client.js +134 -64
- 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/resources/batch/client/Client.d.ts +12 -6
- package/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
- package/api/resources/tts/client/Client.d.ts +24 -18
- package/api/resources/tts/client/Client.js +84 -46
- 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 +4 -2
- package/api/resources/tts/resources/voices/client/Client.js +45 -22
- 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.js +7 -0
- 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 +48 -9
- package/core/pagination/Page.d.ts +5 -2
- package/core/pagination/Page.js +5 -2
- package/core/pagination/Pageable.d.ts +2 -0
- 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 +4 -2
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +74 -40
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +55 -30
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +134 -64
- 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 +10 -5
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +88 -41
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +133 -62
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +134 -64
- 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/resources/batch/client/Client.d.ts +12 -6
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
- package/dist/api/resources/tts/client/Client.d.ts +24 -18
- package/dist/api/resources/tts/client/Client.js +84 -46
- 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 +4 -2
- package/dist/api/resources/tts/resources/voices/client/Client.js +45 -22
- 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.js +7 -0
- 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 +48 -9
- 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/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 +3 -2
- package/reference.md +17 -15
- 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
|
@@ -76,7 +76,7 @@ class Chats {
|
|
|
76
76
|
*/
|
|
77
77
|
listChats() {
|
|
78
78
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
79
|
-
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
80
80
|
var _a, _b, _c;
|
|
81
81
|
const { pageNumber, pageSize, ascendingOrder, configId } = request;
|
|
82
82
|
const _queryParams = {};
|
|
@@ -95,7 +95,7 @@ class Chats {
|
|
|
95
95
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
96
96
|
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/chats"),
|
|
97
97
|
method: "GET",
|
|
98
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.
|
|
98
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.2", "User-Agent": "hume/0.11.2", "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),
|
|
99
99
|
contentType: "application/json",
|
|
100
100
|
queryParameters: _queryParams,
|
|
101
101
|
requestType: "json",
|
|
@@ -104,12 +104,15 @@ class Chats {
|
|
|
104
104
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
105
105
|
});
|
|
106
106
|
if (_response.ok) {
|
|
107
|
-
return
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
return {
|
|
108
|
+
data: serializers.empathicVoice.ReturnPagedChats.parseOrThrow(_response.body, {
|
|
109
|
+
unrecognizedObjectKeys: "passthrough",
|
|
110
|
+
allowUnrecognizedUnionMembers: true,
|
|
111
|
+
allowUnrecognizedEnumValues: true,
|
|
112
|
+
breadcrumbsPrefix: ["response"],
|
|
113
|
+
}),
|
|
114
|
+
rawResponse: _response.rawResponse,
|
|
115
|
+
};
|
|
113
116
|
}
|
|
114
117
|
if (_response.error.reason === "status-code") {
|
|
115
118
|
switch (_response.error.statusCode) {
|
|
@@ -119,11 +122,12 @@ class Chats {
|
|
|
119
122
|
allowUnrecognizedUnionMembers: true,
|
|
120
123
|
allowUnrecognizedEnumValues: true,
|
|
121
124
|
breadcrumbsPrefix: ["response"],
|
|
122
|
-
}));
|
|
125
|
+
}), _response.rawResponse);
|
|
123
126
|
default:
|
|
124
127
|
throw new errors.HumeError({
|
|
125
128
|
statusCode: _response.error.statusCode,
|
|
126
129
|
body: _response.error.body,
|
|
130
|
+
rawResponse: _response.rawResponse,
|
|
127
131
|
});
|
|
128
132
|
}
|
|
129
133
|
}
|
|
@@ -132,18 +136,22 @@ class Chats {
|
|
|
132
136
|
throw new errors.HumeError({
|
|
133
137
|
statusCode: _response.error.statusCode,
|
|
134
138
|
body: _response.error.rawBody,
|
|
139
|
+
rawResponse: _response.rawResponse,
|
|
135
140
|
});
|
|
136
141
|
case "timeout":
|
|
137
142
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chats.");
|
|
138
143
|
case "unknown":
|
|
139
144
|
throw new errors.HumeError({
|
|
140
145
|
message: _response.error.errorMessage,
|
|
146
|
+
rawResponse: _response.rawResponse,
|
|
141
147
|
});
|
|
142
148
|
}
|
|
143
|
-
});
|
|
149
|
+
}));
|
|
144
150
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
151
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
145
152
|
return new core.Pageable({
|
|
146
|
-
response:
|
|
153
|
+
response: dataWithRawResponse.data,
|
|
154
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
147
155
|
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.chatsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
148
156
|
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.chatsPage) !== null && _a !== void 0 ? _a : []; },
|
|
149
157
|
loadPage: (_response) => {
|
|
@@ -171,7 +179,7 @@ class Chats {
|
|
|
171
179
|
*/
|
|
172
180
|
listChatEvents(id_1) {
|
|
173
181
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
174
|
-
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
175
183
|
var _a, _b, _c;
|
|
176
184
|
const { pageSize, pageNumber, ascendingOrder } = request;
|
|
177
185
|
const _queryParams = {};
|
|
@@ -187,7 +195,7 @@ class Chats {
|
|
|
187
195
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
188
196
|
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/chats/${encodeURIComponent(id)}`),
|
|
189
197
|
method: "GET",
|
|
190
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.
|
|
198
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.2", "User-Agent": "hume/0.11.2", "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),
|
|
191
199
|
contentType: "application/json",
|
|
192
200
|
queryParameters: _queryParams,
|
|
193
201
|
requestType: "json",
|
|
@@ -196,12 +204,15 @@ class Chats {
|
|
|
196
204
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
197
205
|
});
|
|
198
206
|
if (_response.ok) {
|
|
199
|
-
return
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
207
|
+
return {
|
|
208
|
+
data: serializers.empathicVoice.ReturnChatPagedEvents.parseOrThrow(_response.body, {
|
|
209
|
+
unrecognizedObjectKeys: "passthrough",
|
|
210
|
+
allowUnrecognizedUnionMembers: true,
|
|
211
|
+
allowUnrecognizedEnumValues: true,
|
|
212
|
+
breadcrumbsPrefix: ["response"],
|
|
213
|
+
}),
|
|
214
|
+
rawResponse: _response.rawResponse,
|
|
215
|
+
};
|
|
205
216
|
}
|
|
206
217
|
if (_response.error.reason === "status-code") {
|
|
207
218
|
switch (_response.error.statusCode) {
|
|
@@ -211,11 +222,12 @@ class Chats {
|
|
|
211
222
|
allowUnrecognizedUnionMembers: true,
|
|
212
223
|
allowUnrecognizedEnumValues: true,
|
|
213
224
|
breadcrumbsPrefix: ["response"],
|
|
214
|
-
}));
|
|
225
|
+
}), _response.rawResponse);
|
|
215
226
|
default:
|
|
216
227
|
throw new errors.HumeError({
|
|
217
228
|
statusCode: _response.error.statusCode,
|
|
218
229
|
body: _response.error.body,
|
|
230
|
+
rawResponse: _response.rawResponse,
|
|
219
231
|
});
|
|
220
232
|
}
|
|
221
233
|
}
|
|
@@ -224,18 +236,22 @@ class Chats {
|
|
|
224
236
|
throw new errors.HumeError({
|
|
225
237
|
statusCode: _response.error.statusCode,
|
|
226
238
|
body: _response.error.rawBody,
|
|
239
|
+
rawResponse: _response.rawResponse,
|
|
227
240
|
});
|
|
228
241
|
case "timeout":
|
|
229
242
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chats/{id}.");
|
|
230
243
|
case "unknown":
|
|
231
244
|
throw new errors.HumeError({
|
|
232
245
|
message: _response.error.errorMessage,
|
|
246
|
+
rawResponse: _response.rawResponse,
|
|
233
247
|
});
|
|
234
248
|
}
|
|
235
|
-
});
|
|
249
|
+
}));
|
|
236
250
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
251
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
237
252
|
return new core.Pageable({
|
|
238
|
-
response:
|
|
253
|
+
response: dataWithRawResponse.data,
|
|
254
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
239
255
|
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
240
256
|
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []; },
|
|
241
257
|
loadPage: (_response) => {
|
|
@@ -257,12 +273,15 @@ class Chats {
|
|
|
257
273
|
* await client.empathicVoice.chats.getAudio("470a49f6-1dec-4afe-8b61-035d3b2d63b0")
|
|
258
274
|
*/
|
|
259
275
|
getAudio(id, requestOptions) {
|
|
276
|
+
return core.HttpResponsePromise.fromPromise(this.__getAudio(id, requestOptions));
|
|
277
|
+
}
|
|
278
|
+
__getAudio(id, requestOptions) {
|
|
260
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
261
280
|
var _a, _b, _c;
|
|
262
281
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
263
282
|
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/chats/${encodeURIComponent(id)}/audio`),
|
|
264
283
|
method: "GET",
|
|
265
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.
|
|
284
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.2", "User-Agent": "hume/0.11.2", "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),
|
|
266
285
|
contentType: "application/json",
|
|
267
286
|
requestType: "json",
|
|
268
287
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -270,12 +289,15 @@ class Chats {
|
|
|
270
289
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
271
290
|
});
|
|
272
291
|
if (_response.ok) {
|
|
273
|
-
return
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
292
|
+
return {
|
|
293
|
+
data: serializers.empathicVoice.ReturnChatAudioReconstruction.parseOrThrow(_response.body, {
|
|
294
|
+
unrecognizedObjectKeys: "passthrough",
|
|
295
|
+
allowUnrecognizedUnionMembers: true,
|
|
296
|
+
allowUnrecognizedEnumValues: true,
|
|
297
|
+
breadcrumbsPrefix: ["response"],
|
|
298
|
+
}),
|
|
299
|
+
rawResponse: _response.rawResponse,
|
|
300
|
+
};
|
|
279
301
|
}
|
|
280
302
|
if (_response.error.reason === "status-code") {
|
|
281
303
|
switch (_response.error.statusCode) {
|
|
@@ -285,11 +307,12 @@ class Chats {
|
|
|
285
307
|
allowUnrecognizedUnionMembers: true,
|
|
286
308
|
allowUnrecognizedEnumValues: true,
|
|
287
309
|
breadcrumbsPrefix: ["response"],
|
|
288
|
-
}));
|
|
310
|
+
}), _response.rawResponse);
|
|
289
311
|
default:
|
|
290
312
|
throw new errors.HumeError({
|
|
291
313
|
statusCode: _response.error.statusCode,
|
|
292
314
|
body: _response.error.body,
|
|
315
|
+
rawResponse: _response.rawResponse,
|
|
293
316
|
});
|
|
294
317
|
}
|
|
295
318
|
}
|
|
@@ -298,12 +321,14 @@ class Chats {
|
|
|
298
321
|
throw new errors.HumeError({
|
|
299
322
|
statusCode: _response.error.statusCode,
|
|
300
323
|
body: _response.error.rawBody,
|
|
324
|
+
rawResponse: _response.rawResponse,
|
|
301
325
|
});
|
|
302
326
|
case "timeout":
|
|
303
327
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chats/{id}/audio.");
|
|
304
328
|
case "unknown":
|
|
305
329
|
throw new errors.HumeError({
|
|
306
330
|
message: _response.error.errorMessage,
|
|
331
|
+
rawResponse: _response.rawResponse,
|
|
307
332
|
});
|
|
308
333
|
}
|
|
309
334
|
});
|
|
@@ -86,7 +86,8 @@ export declare class Configs {
|
|
|
86
86
|
* }
|
|
87
87
|
* })
|
|
88
88
|
*/
|
|
89
|
-
createConfig(request: Hume.empathicVoice.PostedConfig, requestOptions?: Configs.RequestOptions):
|
|
89
|
+
createConfig(request: Hume.empathicVoice.PostedConfig, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnConfig>;
|
|
90
|
+
private __createConfig;
|
|
90
91
|
/**
|
|
91
92
|
* Fetches a list of a **Config's** versions.
|
|
92
93
|
*
|
|
@@ -149,7 +150,8 @@ export declare class Configs {
|
|
|
149
150
|
* }
|
|
150
151
|
* })
|
|
151
152
|
*/
|
|
152
|
-
createConfigVersion(id: string, request: Hume.empathicVoice.PostedConfigVersion, requestOptions?: Configs.RequestOptions):
|
|
153
|
+
createConfigVersion(id: string, request: Hume.empathicVoice.PostedConfigVersion, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnConfig>;
|
|
154
|
+
private __createConfigVersion;
|
|
153
155
|
/**
|
|
154
156
|
* Deletes a **Config** and its versions.
|
|
155
157
|
*
|
|
@@ -163,7 +165,8 @@ export declare class Configs {
|
|
|
163
165
|
* @example
|
|
164
166
|
* await client.empathicVoice.configs.deleteConfig("1b60e1a0-cc59-424a-8d2c-189d354db3f3")
|
|
165
167
|
*/
|
|
166
|
-
deleteConfig(id: string, requestOptions?: Configs.RequestOptions):
|
|
168
|
+
deleteConfig(id: string, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<void>;
|
|
169
|
+
private __deleteConfig;
|
|
167
170
|
/**
|
|
168
171
|
* Updates the name of a **Config**.
|
|
169
172
|
*
|
|
@@ -180,7 +183,8 @@ export declare class Configs {
|
|
|
180
183
|
* name: "Updated Weather Assistant Config Name"
|
|
181
184
|
* })
|
|
182
185
|
*/
|
|
183
|
-
updateConfigName(id: string, request: Hume.empathicVoice.PostedConfigName, requestOptions?: Configs.RequestOptions):
|
|
186
|
+
updateConfigName(id: string, request: Hume.empathicVoice.PostedConfigName, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<string>;
|
|
187
|
+
private __updateConfigName;
|
|
184
188
|
/**
|
|
185
189
|
* Fetches a specified version of a **Config**.
|
|
186
190
|
*
|
|
@@ -199,7 +203,8 @@ export declare class Configs {
|
|
|
199
203
|
* @example
|
|
200
204
|
* await client.empathicVoice.configs.getConfigVersion("1b60e1a0-cc59-424a-8d2c-189d354db3f3", 1)
|
|
201
205
|
*/
|
|
202
|
-
getConfigVersion(id: string, version: number, requestOptions?: Configs.RequestOptions):
|
|
206
|
+
getConfigVersion(id: string, version: number, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnConfig>;
|
|
207
|
+
private __getConfigVersion;
|
|
203
208
|
/**
|
|
204
209
|
* Deletes a specified version of a **Config**.
|
|
205
210
|
*
|
|
@@ -218,7 +223,8 @@ export declare class Configs {
|
|
|
218
223
|
* @example
|
|
219
224
|
* await client.empathicVoice.configs.deleteConfigVersion("1b60e1a0-cc59-424a-8d2c-189d354db3f3", 1)
|
|
220
225
|
*/
|
|
221
|
-
deleteConfigVersion(id: string, version: number, requestOptions?: Configs.RequestOptions):
|
|
226
|
+
deleteConfigVersion(id: string, version: number, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<void>;
|
|
227
|
+
private __deleteConfigVersion;
|
|
222
228
|
/**
|
|
223
229
|
* Updates the description of a **Config**.
|
|
224
230
|
*
|
|
@@ -240,7 +246,8 @@ export declare class Configs {
|
|
|
240
246
|
* versionDescription: "This is an updated version_description."
|
|
241
247
|
* })
|
|
242
248
|
*/
|
|
243
|
-
updateConfigDescription(id: string, version: number, request?: Hume.empathicVoice.PostedConfigVersionDescription, requestOptions?: Configs.RequestOptions):
|
|
249
|
+
updateConfigDescription(id: string, version: number, request?: Hume.empathicVoice.PostedConfigVersionDescription, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnConfig>;
|
|
250
|
+
private __updateConfigDescription;
|
|
244
251
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
245
252
|
"X-Hume-Api-Key": string | undefined;
|
|
246
253
|
}>;
|