hume 0.11.0 → 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 +39 -36
- package/.mock/definition/empathic-voice/chat.yml +18 -3
- package/.mock/definition/empathic-voice/chatGroups.yml +14 -10
- package/.mock/definition/empathic-voice/chatWebhooks.yml +2 -0
- package/.mock/definition/empathic-voice/chats.yml +2 -0
- package/.mock/definition/empathic-voice/configs.yml +4 -0
- package/.mock/definition/empathic-voice/customVoices.yml +1 -0
- package/.mock/definition/empathic-voice/prompts.yml +2 -0
- package/.mock/definition/empathic-voice/tools.yml +2 -0
- package/.mock/definition/expression-measurement/batch/__package__.yml +10 -10
- package/.mock/definition/expression-measurement/stream/stream.yml +1 -1
- package/.mock/definition/tts/__package__.yml +98 -55
- package/.mock/definition/tts/voices.yml +20 -9
- 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 +76 -42
- package/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.ts +4 -4
- package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
- package/api/resources/empathicVoice/resources/chats/client/Client.js +57 -32
- package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
- package/api/resources/empathicVoice/resources/configs/client/Client.js +136 -66
- 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 +89 -42
- package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
- package/api/resources/empathicVoice/resources/prompts/client/Client.js +134 -63
- package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
- package/api/resources/empathicVoice/resources/tools/client/Client.js +136 -66
- package/api/resources/empathicVoice/types/AssistantInput.d.ts +1 -1
- package/api/resources/empathicVoice/types/AssistantMessage.d.ts +1 -1
- package/api/resources/empathicVoice/types/PauseAssistantMessage.d.ts +1 -1
- package/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -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/ToolCallMessage.d.ts +1 -1
- package/api/resources/empathicVoice/types/ToolErrorMessage.d.ts +2 -2
- package/api/resources/empathicVoice/types/ToolResponseMessage.d.ts +3 -3
- package/api/resources/empathicVoice/types/UserInput.d.ts +1 -1
- package/api/resources/empathicVoice/types/UserMessage.d.ts +3 -3
- 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 -4
- package/api/resources/empathicVoice/types/index.js +2 -4
- 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 +28 -22
- package/api/resources/tts/client/Client.js +88 -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/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 +9 -5
- package/api/resources/tts/resources/voices/client/Client.js +51 -26
- package/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.ts +4 -1
- package/api/resources/tts/types/PostedTts.d.ts +6 -6
- package/api/resources/tts/types/PostedUtterance.d.ts +5 -5
- package/api/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +6 -7
- package/api/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +6 -7
- package/api/resources/tts/types/ReturnGeneration.d.ts +1 -1
- package/api/resources/tts/types/ReturnTts.d.ts +1 -1
- package/api/resources/tts/types/ReturnVoice.d.ts +2 -8
- 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 +76 -42
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.ts +4 -4
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +57 -32
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +136 -66
- 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 +89 -42
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +134 -63
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +136 -66
- package/dist/api/resources/empathicVoice/types/AssistantInput.d.ts +1 -1
- package/dist/api/resources/empathicVoice/types/AssistantMessage.d.ts +1 -1
- package/dist/api/resources/empathicVoice/types/PauseAssistantMessage.d.ts +1 -1
- package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -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/ToolCallMessage.d.ts +1 -1
- package/dist/api/resources/empathicVoice/types/ToolErrorMessage.d.ts +2 -2
- package/dist/api/resources/empathicVoice/types/ToolResponseMessage.d.ts +3 -3
- package/dist/api/resources/empathicVoice/types/UserInput.d.ts +1 -1
- package/dist/api/resources/empathicVoice/types/UserMessage.d.ts +3 -3
- 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 -4
- package/dist/api/resources/empathicVoice/types/index.js +2 -4
- 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 +28 -22
- package/dist/api/resources/tts/client/Client.js +88 -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/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 +9 -5
- package/dist/api/resources/tts/resources/voices/client/Client.js +51 -26
- package/dist/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.ts +4 -1
- package/dist/api/resources/tts/types/PostedTts.d.ts +6 -6
- package/dist/api/resources/tts/types/PostedUtterance.d.ts +5 -5
- package/dist/api/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +6 -7
- package/dist/api/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +6 -7
- package/dist/api/resources/tts/types/ReturnGeneration.d.ts +1 -1
- package/dist/api/resources/tts/types/ReturnTts.d.ts +1 -1
- package/dist/api/resources/tts/types/ReturnVoice.d.ts +2 -8
- 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/{TextInput.js → PostedNudgeSpec.js} +4 -3
- 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/{FunctionCallResponseInput.js → ReturnNudgeSpec.js} +4 -3
- 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 -4
- package/dist/serialization/resources/empathicVoice/types/index.js +2 -4
- 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 +26 -22
- 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/{dist/serialization/resources/empathicVoice/types/TtsInput.js → serialization/resources/empathicVoice/types/PostedNudgeSpec.js} +4 -3
- 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/{dist/serialization/resources/empathicVoice/types/PostedPromptSpec.js → serialization/resources/empathicVoice/types/ReturnNudgeSpec.js} +4 -3
- 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 -4
- package/serialization/resources/empathicVoice/types/index.js +2 -4
- 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/api/resources/empathicVoice/types/FunctionCallResponseInput.d.ts +0 -6
- package/api/resources/empathicVoice/types/PostedPromptSpec.d.ts +0 -9
- package/api/resources/empathicVoice/types/TextInput.d.ts +0 -6
- package/api/resources/empathicVoice/types/TtsInput.d.ts +0 -6
- package/dist/api/resources/empathicVoice/types/FunctionCallResponseInput.d.ts +0 -6
- package/dist/api/resources/empathicVoice/types/PostedPromptSpec.d.ts +0 -9
- package/dist/api/resources/empathicVoice/types/TextInput.d.ts +0 -6
- package/dist/api/resources/empathicVoice/types/TextInput.js +0 -5
- package/dist/api/resources/empathicVoice/types/TtsInput.d.ts +0 -6
- package/dist/api/resources/empathicVoice/types/TtsInput.js +0 -5
- package/dist/serialization/resources/empathicVoice/types/FunctionCallResponseInput.d.ts +0 -12
- package/dist/serialization/resources/empathicVoice/types/PostedPromptSpec.d.ts +0 -12
- package/dist/serialization/resources/empathicVoice/types/TextInput.d.ts +0 -12
- package/dist/serialization/resources/empathicVoice/types/TtsInput.d.ts +0 -12
- package/serialization/resources/empathicVoice/types/FunctionCallResponseInput.d.ts +0 -12
- package/serialization/resources/empathicVoice/types/FunctionCallResponseInput.js +0 -43
- package/serialization/resources/empathicVoice/types/PostedPromptSpec.d.ts +0 -12
- package/serialization/resources/empathicVoice/types/PostedPromptSpec.js +0 -43
- package/serialization/resources/empathicVoice/types/TextInput.d.ts +0 -12
- package/serialization/resources/empathicVoice/types/TextInput.js +0 -43
- package/serialization/resources/empathicVoice/types/TtsInput.d.ts +0 -12
- package/serialization/resources/empathicVoice/types/TtsInput.js +0 -43
- /package/api/resources/empathicVoice/types/{FunctionCallResponseInput.js → PostedNudgeSpec.js} +0 -0
- /package/api/resources/empathicVoice/types/{PostedPromptSpec.js → ReturnNudgeSpec.js} +0 -0
- /package/api/resources/{empathicVoice/types/TextInput.js → tts/client/requests/SynthesizeJsonRequest.js} +0 -0
- /package/{api/resources/empathicVoice/types/TtsInput.js → dist/api/resources/empathicVoice/types/PostedNudgeSpec.js} +0 -0
- /package/dist/api/resources/empathicVoice/types/{FunctionCallResponseInput.js → ReturnNudgeSpec.js} +0 -0
- /package/dist/api/resources/{empathicVoice/types/PostedPromptSpec.js → tts/client/requests/SynthesizeJsonRequest.js} +0 -0
|
@@ -77,7 +77,7 @@ class Tools {
|
|
|
77
77
|
*/
|
|
78
78
|
listTools() {
|
|
79
79
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
80
|
-
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
81
81
|
var _a, _b, _c;
|
|
82
82
|
const { pageNumber, pageSize, restrictToMostRecent, name } = request;
|
|
83
83
|
const _queryParams = {};
|
|
@@ -96,7 +96,7 @@ class Tools {
|
|
|
96
96
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
97
97
|
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, "v0/evi/tools"),
|
|
98
98
|
method: "GET",
|
|
99
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
99
|
+
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),
|
|
100
100
|
contentType: "application/json",
|
|
101
101
|
queryParameters: _queryParams,
|
|
102
102
|
requestType: "json",
|
|
@@ -105,12 +105,15 @@ class Tools {
|
|
|
105
105
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
106
106
|
});
|
|
107
107
|
if (_response.ok) {
|
|
108
|
-
return
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
return {
|
|
109
|
+
data: serializers.empathicVoice.ReturnPagedUserDefinedTools.parseOrThrow(_response.body, {
|
|
110
|
+
unrecognizedObjectKeys: "passthrough",
|
|
111
|
+
allowUnrecognizedUnionMembers: true,
|
|
112
|
+
allowUnrecognizedEnumValues: true,
|
|
113
|
+
breadcrumbsPrefix: ["response"],
|
|
114
|
+
}),
|
|
115
|
+
rawResponse: _response.rawResponse,
|
|
116
|
+
};
|
|
114
117
|
}
|
|
115
118
|
if (_response.error.reason === "status-code") {
|
|
116
119
|
switch (_response.error.statusCode) {
|
|
@@ -120,11 +123,12 @@ class Tools {
|
|
|
120
123
|
allowUnrecognizedUnionMembers: true,
|
|
121
124
|
allowUnrecognizedEnumValues: true,
|
|
122
125
|
breadcrumbsPrefix: ["response"],
|
|
123
|
-
}));
|
|
126
|
+
}), _response.rawResponse);
|
|
124
127
|
default:
|
|
125
128
|
throw new errors.HumeError({
|
|
126
129
|
statusCode: _response.error.statusCode,
|
|
127
130
|
body: _response.error.body,
|
|
131
|
+
rawResponse: _response.rawResponse,
|
|
128
132
|
});
|
|
129
133
|
}
|
|
130
134
|
}
|
|
@@ -133,18 +137,22 @@ class Tools {
|
|
|
133
137
|
throw new errors.HumeError({
|
|
134
138
|
statusCode: _response.error.statusCode,
|
|
135
139
|
body: _response.error.rawBody,
|
|
140
|
+
rawResponse: _response.rawResponse,
|
|
136
141
|
});
|
|
137
142
|
case "timeout":
|
|
138
143
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/tools.");
|
|
139
144
|
case "unknown":
|
|
140
145
|
throw new errors.HumeError({
|
|
141
146
|
message: _response.error.errorMessage,
|
|
147
|
+
rawResponse: _response.rawResponse,
|
|
142
148
|
});
|
|
143
149
|
}
|
|
144
|
-
});
|
|
145
|
-
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber :
|
|
150
|
+
}));
|
|
151
|
+
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
152
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
146
153
|
return new core.Pageable({
|
|
147
|
-
response:
|
|
154
|
+
response: dataWithRawResponse.data,
|
|
155
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
148
156
|
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.toolsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
149
157
|
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.toolsPage) !== null && _a !== void 0 ? _a : []; },
|
|
150
158
|
loadPage: (_response) => {
|
|
@@ -174,12 +182,15 @@ class Tools {
|
|
|
174
182
|
* })
|
|
175
183
|
*/
|
|
176
184
|
createTool(request, requestOptions) {
|
|
185
|
+
return core.HttpResponsePromise.fromPromise(this.__createTool(request, requestOptions));
|
|
186
|
+
}
|
|
187
|
+
__createTool(request, requestOptions) {
|
|
177
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
178
189
|
var _a, _b, _c;
|
|
179
190
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
180
191
|
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/tools"),
|
|
181
192
|
method: "POST",
|
|
182
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
193
|
+
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),
|
|
183
194
|
contentType: "application/json",
|
|
184
195
|
requestType: "json",
|
|
185
196
|
body: serializers.empathicVoice.PostedUserDefinedTool.jsonOrThrow(request, {
|
|
@@ -190,12 +201,15 @@ class Tools {
|
|
|
190
201
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
191
202
|
});
|
|
192
203
|
if (_response.ok) {
|
|
193
|
-
return
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
204
|
+
return {
|
|
205
|
+
data: serializers.empathicVoice.tools.createTool.Response.parseOrThrow(_response.body, {
|
|
206
|
+
unrecognizedObjectKeys: "passthrough",
|
|
207
|
+
allowUnrecognizedUnionMembers: true,
|
|
208
|
+
allowUnrecognizedEnumValues: true,
|
|
209
|
+
breadcrumbsPrefix: ["response"],
|
|
210
|
+
}),
|
|
211
|
+
rawResponse: _response.rawResponse,
|
|
212
|
+
};
|
|
199
213
|
}
|
|
200
214
|
if (_response.error.reason === "status-code") {
|
|
201
215
|
switch (_response.error.statusCode) {
|
|
@@ -205,11 +219,12 @@ class Tools {
|
|
|
205
219
|
allowUnrecognizedUnionMembers: true,
|
|
206
220
|
allowUnrecognizedEnumValues: true,
|
|
207
221
|
breadcrumbsPrefix: ["response"],
|
|
208
|
-
}));
|
|
222
|
+
}), _response.rawResponse);
|
|
209
223
|
default:
|
|
210
224
|
throw new errors.HumeError({
|
|
211
225
|
statusCode: _response.error.statusCode,
|
|
212
226
|
body: _response.error.body,
|
|
227
|
+
rawResponse: _response.rawResponse,
|
|
213
228
|
});
|
|
214
229
|
}
|
|
215
230
|
}
|
|
@@ -218,12 +233,14 @@ class Tools {
|
|
|
218
233
|
throw new errors.HumeError({
|
|
219
234
|
statusCode: _response.error.statusCode,
|
|
220
235
|
body: _response.error.rawBody,
|
|
236
|
+
rawResponse: _response.rawResponse,
|
|
221
237
|
});
|
|
222
238
|
case "timeout":
|
|
223
239
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/evi/tools.");
|
|
224
240
|
case "unknown":
|
|
225
241
|
throw new errors.HumeError({
|
|
226
242
|
message: _response.error.errorMessage,
|
|
243
|
+
rawResponse: _response.rawResponse,
|
|
227
244
|
});
|
|
228
245
|
}
|
|
229
246
|
});
|
|
@@ -244,7 +261,7 @@ class Tools {
|
|
|
244
261
|
*/
|
|
245
262
|
listToolVersions(id_1) {
|
|
246
263
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
247
|
-
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
248
265
|
var _a, _b, _c;
|
|
249
266
|
const { pageNumber, pageSize, restrictToMostRecent } = request;
|
|
250
267
|
const _queryParams = {};
|
|
@@ -260,7 +277,7 @@ class Tools {
|
|
|
260
277
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
261
278
|
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/tools/${encodeURIComponent(id)}`),
|
|
262
279
|
method: "GET",
|
|
263
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
280
|
+
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),
|
|
264
281
|
contentType: "application/json",
|
|
265
282
|
queryParameters: _queryParams,
|
|
266
283
|
requestType: "json",
|
|
@@ -269,12 +286,15 @@ class Tools {
|
|
|
269
286
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
270
287
|
});
|
|
271
288
|
if (_response.ok) {
|
|
272
|
-
return
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
289
|
+
return {
|
|
290
|
+
data: serializers.empathicVoice.ReturnPagedUserDefinedTools.parseOrThrow(_response.body, {
|
|
291
|
+
unrecognizedObjectKeys: "passthrough",
|
|
292
|
+
allowUnrecognizedUnionMembers: true,
|
|
293
|
+
allowUnrecognizedEnumValues: true,
|
|
294
|
+
breadcrumbsPrefix: ["response"],
|
|
295
|
+
}),
|
|
296
|
+
rawResponse: _response.rawResponse,
|
|
297
|
+
};
|
|
278
298
|
}
|
|
279
299
|
if (_response.error.reason === "status-code") {
|
|
280
300
|
switch (_response.error.statusCode) {
|
|
@@ -284,11 +304,12 @@ class Tools {
|
|
|
284
304
|
allowUnrecognizedUnionMembers: true,
|
|
285
305
|
allowUnrecognizedEnumValues: true,
|
|
286
306
|
breadcrumbsPrefix: ["response"],
|
|
287
|
-
}));
|
|
307
|
+
}), _response.rawResponse);
|
|
288
308
|
default:
|
|
289
309
|
throw new errors.HumeError({
|
|
290
310
|
statusCode: _response.error.statusCode,
|
|
291
311
|
body: _response.error.body,
|
|
312
|
+
rawResponse: _response.rawResponse,
|
|
292
313
|
});
|
|
293
314
|
}
|
|
294
315
|
}
|
|
@@ -297,18 +318,22 @@ class Tools {
|
|
|
297
318
|
throw new errors.HumeError({
|
|
298
319
|
statusCode: _response.error.statusCode,
|
|
299
320
|
body: _response.error.rawBody,
|
|
321
|
+
rawResponse: _response.rawResponse,
|
|
300
322
|
});
|
|
301
323
|
case "timeout":
|
|
302
324
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/tools/{id}.");
|
|
303
325
|
case "unknown":
|
|
304
326
|
throw new errors.HumeError({
|
|
305
327
|
message: _response.error.errorMessage,
|
|
328
|
+
rawResponse: _response.rawResponse,
|
|
306
329
|
});
|
|
307
330
|
}
|
|
308
|
-
});
|
|
309
|
-
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber :
|
|
331
|
+
}));
|
|
332
|
+
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
333
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
310
334
|
return new core.Pageable({
|
|
311
|
-
response:
|
|
335
|
+
response: dataWithRawResponse.data,
|
|
336
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
312
337
|
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.toolsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
313
338
|
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.toolsPage) !== null && _a !== void 0 ? _a : []; },
|
|
314
339
|
loadPage: (_response) => {
|
|
@@ -338,12 +363,15 @@ class Tools {
|
|
|
338
363
|
* })
|
|
339
364
|
*/
|
|
340
365
|
createToolVersion(id, request, requestOptions) {
|
|
366
|
+
return core.HttpResponsePromise.fromPromise(this.__createToolVersion(id, request, requestOptions));
|
|
367
|
+
}
|
|
368
|
+
__createToolVersion(id, request, requestOptions) {
|
|
341
369
|
return __awaiter(this, void 0, void 0, function* () {
|
|
342
370
|
var _a, _b, _c;
|
|
343
371
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
344
372
|
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/tools/${encodeURIComponent(id)}`),
|
|
345
373
|
method: "POST",
|
|
346
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
374
|
+
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),
|
|
347
375
|
contentType: "application/json",
|
|
348
376
|
requestType: "json",
|
|
349
377
|
body: serializers.empathicVoice.PostedUserDefinedToolVersion.jsonOrThrow(request, {
|
|
@@ -354,12 +382,15 @@ class Tools {
|
|
|
354
382
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
355
383
|
});
|
|
356
384
|
if (_response.ok) {
|
|
357
|
-
return
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
385
|
+
return {
|
|
386
|
+
data: serializers.empathicVoice.tools.createToolVersion.Response.parseOrThrow(_response.body, {
|
|
387
|
+
unrecognizedObjectKeys: "passthrough",
|
|
388
|
+
allowUnrecognizedUnionMembers: true,
|
|
389
|
+
allowUnrecognizedEnumValues: true,
|
|
390
|
+
breadcrumbsPrefix: ["response"],
|
|
391
|
+
}),
|
|
392
|
+
rawResponse: _response.rawResponse,
|
|
393
|
+
};
|
|
363
394
|
}
|
|
364
395
|
if (_response.error.reason === "status-code") {
|
|
365
396
|
switch (_response.error.statusCode) {
|
|
@@ -369,11 +400,12 @@ class Tools {
|
|
|
369
400
|
allowUnrecognizedUnionMembers: true,
|
|
370
401
|
allowUnrecognizedEnumValues: true,
|
|
371
402
|
breadcrumbsPrefix: ["response"],
|
|
372
|
-
}));
|
|
403
|
+
}), _response.rawResponse);
|
|
373
404
|
default:
|
|
374
405
|
throw new errors.HumeError({
|
|
375
406
|
statusCode: _response.error.statusCode,
|
|
376
407
|
body: _response.error.body,
|
|
408
|
+
rawResponse: _response.rawResponse,
|
|
377
409
|
});
|
|
378
410
|
}
|
|
379
411
|
}
|
|
@@ -382,12 +414,14 @@ class Tools {
|
|
|
382
414
|
throw new errors.HumeError({
|
|
383
415
|
statusCode: _response.error.statusCode,
|
|
384
416
|
body: _response.error.rawBody,
|
|
417
|
+
rawResponse: _response.rawResponse,
|
|
385
418
|
});
|
|
386
419
|
case "timeout":
|
|
387
420
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/evi/tools/{id}.");
|
|
388
421
|
case "unknown":
|
|
389
422
|
throw new errors.HumeError({
|
|
390
423
|
message: _response.error.errorMessage,
|
|
424
|
+
rawResponse: _response.rawResponse,
|
|
391
425
|
});
|
|
392
426
|
}
|
|
393
427
|
});
|
|
@@ -406,12 +440,15 @@ class Tools {
|
|
|
406
440
|
* await client.empathicVoice.tools.deleteTool("00183a3f-79ba-413d-9f3b-609864268bea")
|
|
407
441
|
*/
|
|
408
442
|
deleteTool(id, requestOptions) {
|
|
443
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteTool(id, requestOptions));
|
|
444
|
+
}
|
|
445
|
+
__deleteTool(id, requestOptions) {
|
|
409
446
|
return __awaiter(this, void 0, void 0, function* () {
|
|
410
447
|
var _a, _b, _c;
|
|
411
448
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
412
449
|
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/tools/${encodeURIComponent(id)}`),
|
|
413
450
|
method: "DELETE",
|
|
414
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
451
|
+
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),
|
|
415
452
|
contentType: "application/json",
|
|
416
453
|
requestType: "json",
|
|
417
454
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -419,7 +456,7 @@ class Tools {
|
|
|
419
456
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
420
457
|
});
|
|
421
458
|
if (_response.ok) {
|
|
422
|
-
return;
|
|
459
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
423
460
|
}
|
|
424
461
|
if (_response.error.reason === "status-code") {
|
|
425
462
|
switch (_response.error.statusCode) {
|
|
@@ -429,11 +466,12 @@ class Tools {
|
|
|
429
466
|
allowUnrecognizedUnionMembers: true,
|
|
430
467
|
allowUnrecognizedEnumValues: true,
|
|
431
468
|
breadcrumbsPrefix: ["response"],
|
|
432
|
-
}));
|
|
469
|
+
}), _response.rawResponse);
|
|
433
470
|
default:
|
|
434
471
|
throw new errors.HumeError({
|
|
435
472
|
statusCode: _response.error.statusCode,
|
|
436
473
|
body: _response.error.body,
|
|
474
|
+
rawResponse: _response.rawResponse,
|
|
437
475
|
});
|
|
438
476
|
}
|
|
439
477
|
}
|
|
@@ -442,12 +480,14 @@ class Tools {
|
|
|
442
480
|
throw new errors.HumeError({
|
|
443
481
|
statusCode: _response.error.statusCode,
|
|
444
482
|
body: _response.error.rawBody,
|
|
483
|
+
rawResponse: _response.rawResponse,
|
|
445
484
|
});
|
|
446
485
|
case "timeout":
|
|
447
486
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling DELETE /v0/evi/tools/{id}.");
|
|
448
487
|
case "unknown":
|
|
449
488
|
throw new errors.HumeError({
|
|
450
489
|
message: _response.error.errorMessage,
|
|
490
|
+
rawResponse: _response.rawResponse,
|
|
451
491
|
});
|
|
452
492
|
}
|
|
453
493
|
});
|
|
@@ -469,12 +509,15 @@ class Tools {
|
|
|
469
509
|
* })
|
|
470
510
|
*/
|
|
471
511
|
updateToolName(id, request, requestOptions) {
|
|
512
|
+
return core.HttpResponsePromise.fromPromise(this.__updateToolName(id, request, requestOptions));
|
|
513
|
+
}
|
|
514
|
+
__updateToolName(id, request, requestOptions) {
|
|
472
515
|
return __awaiter(this, void 0, void 0, function* () {
|
|
473
516
|
var _a, _b, _c;
|
|
474
517
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
475
518
|
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/tools/${encodeURIComponent(id)}`),
|
|
476
519
|
method: "PATCH",
|
|
477
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
520
|
+
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),
|
|
478
521
|
contentType: "application/json",
|
|
479
522
|
requestType: "json",
|
|
480
523
|
body: serializers.empathicVoice.PostedUserDefinedToolName.jsonOrThrow(request, {
|
|
@@ -486,7 +529,7 @@ class Tools {
|
|
|
486
529
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
487
530
|
});
|
|
488
531
|
if (_response.ok) {
|
|
489
|
-
return _response.body;
|
|
532
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
490
533
|
}
|
|
491
534
|
if (_response.error.reason === "status-code") {
|
|
492
535
|
switch (_response.error.statusCode) {
|
|
@@ -496,11 +539,12 @@ class Tools {
|
|
|
496
539
|
allowUnrecognizedUnionMembers: true,
|
|
497
540
|
allowUnrecognizedEnumValues: true,
|
|
498
541
|
breadcrumbsPrefix: ["response"],
|
|
499
|
-
}));
|
|
542
|
+
}), _response.rawResponse);
|
|
500
543
|
default:
|
|
501
544
|
throw new errors.HumeError({
|
|
502
545
|
statusCode: _response.error.statusCode,
|
|
503
546
|
body: _response.error.body,
|
|
547
|
+
rawResponse: _response.rawResponse,
|
|
504
548
|
});
|
|
505
549
|
}
|
|
506
550
|
}
|
|
@@ -509,12 +553,14 @@ class Tools {
|
|
|
509
553
|
throw new errors.HumeError({
|
|
510
554
|
statusCode: _response.error.statusCode,
|
|
511
555
|
body: _response.error.rawBody,
|
|
556
|
+
rawResponse: _response.rawResponse,
|
|
512
557
|
});
|
|
513
558
|
case "timeout":
|
|
514
559
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling PATCH /v0/evi/tools/{id}.");
|
|
515
560
|
case "unknown":
|
|
516
561
|
throw new errors.HumeError({
|
|
517
562
|
message: _response.error.errorMessage,
|
|
563
|
+
rawResponse: _response.rawResponse,
|
|
518
564
|
});
|
|
519
565
|
}
|
|
520
566
|
});
|
|
@@ -538,12 +584,15 @@ class Tools {
|
|
|
538
584
|
* await client.empathicVoice.tools.getToolVersion("00183a3f-79ba-413d-9f3b-609864268bea", 1)
|
|
539
585
|
*/
|
|
540
586
|
getToolVersion(id, version, requestOptions) {
|
|
587
|
+
return core.HttpResponsePromise.fromPromise(this.__getToolVersion(id, version, requestOptions));
|
|
588
|
+
}
|
|
589
|
+
__getToolVersion(id, version, requestOptions) {
|
|
541
590
|
return __awaiter(this, void 0, void 0, function* () {
|
|
542
591
|
var _a, _b, _c;
|
|
543
592
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
544
593
|
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/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
545
594
|
method: "GET",
|
|
546
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
595
|
+
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),
|
|
547
596
|
contentType: "application/json",
|
|
548
597
|
requestType: "json",
|
|
549
598
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -551,12 +600,15 @@ class Tools {
|
|
|
551
600
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
552
601
|
});
|
|
553
602
|
if (_response.ok) {
|
|
554
|
-
return
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
603
|
+
return {
|
|
604
|
+
data: serializers.empathicVoice.tools.getToolVersion.Response.parseOrThrow(_response.body, {
|
|
605
|
+
unrecognizedObjectKeys: "passthrough",
|
|
606
|
+
allowUnrecognizedUnionMembers: true,
|
|
607
|
+
allowUnrecognizedEnumValues: true,
|
|
608
|
+
breadcrumbsPrefix: ["response"],
|
|
609
|
+
}),
|
|
610
|
+
rawResponse: _response.rawResponse,
|
|
611
|
+
};
|
|
560
612
|
}
|
|
561
613
|
if (_response.error.reason === "status-code") {
|
|
562
614
|
switch (_response.error.statusCode) {
|
|
@@ -566,11 +618,12 @@ class Tools {
|
|
|
566
618
|
allowUnrecognizedUnionMembers: true,
|
|
567
619
|
allowUnrecognizedEnumValues: true,
|
|
568
620
|
breadcrumbsPrefix: ["response"],
|
|
569
|
-
}));
|
|
621
|
+
}), _response.rawResponse);
|
|
570
622
|
default:
|
|
571
623
|
throw new errors.HumeError({
|
|
572
624
|
statusCode: _response.error.statusCode,
|
|
573
625
|
body: _response.error.body,
|
|
626
|
+
rawResponse: _response.rawResponse,
|
|
574
627
|
});
|
|
575
628
|
}
|
|
576
629
|
}
|
|
@@ -579,12 +632,14 @@ class Tools {
|
|
|
579
632
|
throw new errors.HumeError({
|
|
580
633
|
statusCode: _response.error.statusCode,
|
|
581
634
|
body: _response.error.rawBody,
|
|
635
|
+
rawResponse: _response.rawResponse,
|
|
582
636
|
});
|
|
583
637
|
case "timeout":
|
|
584
638
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/tools/{id}/version/{version}.");
|
|
585
639
|
case "unknown":
|
|
586
640
|
throw new errors.HumeError({
|
|
587
641
|
message: _response.error.errorMessage,
|
|
642
|
+
rawResponse: _response.rawResponse,
|
|
588
643
|
});
|
|
589
644
|
}
|
|
590
645
|
});
|
|
@@ -608,12 +663,15 @@ class Tools {
|
|
|
608
663
|
* await client.empathicVoice.tools.deleteToolVersion("00183a3f-79ba-413d-9f3b-609864268bea", 1)
|
|
609
664
|
*/
|
|
610
665
|
deleteToolVersion(id, version, requestOptions) {
|
|
666
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteToolVersion(id, version, requestOptions));
|
|
667
|
+
}
|
|
668
|
+
__deleteToolVersion(id, version, requestOptions) {
|
|
611
669
|
return __awaiter(this, void 0, void 0, function* () {
|
|
612
670
|
var _a, _b, _c;
|
|
613
671
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
614
672
|
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/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
615
673
|
method: "DELETE",
|
|
616
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
674
|
+
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),
|
|
617
675
|
contentType: "application/json",
|
|
618
676
|
requestType: "json",
|
|
619
677
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -621,7 +679,7 @@ class Tools {
|
|
|
621
679
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
622
680
|
});
|
|
623
681
|
if (_response.ok) {
|
|
624
|
-
return;
|
|
682
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
625
683
|
}
|
|
626
684
|
if (_response.error.reason === "status-code") {
|
|
627
685
|
switch (_response.error.statusCode) {
|
|
@@ -631,11 +689,12 @@ class Tools {
|
|
|
631
689
|
allowUnrecognizedUnionMembers: true,
|
|
632
690
|
allowUnrecognizedEnumValues: true,
|
|
633
691
|
breadcrumbsPrefix: ["response"],
|
|
634
|
-
}));
|
|
692
|
+
}), _response.rawResponse);
|
|
635
693
|
default:
|
|
636
694
|
throw new errors.HumeError({
|
|
637
695
|
statusCode: _response.error.statusCode,
|
|
638
696
|
body: _response.error.body,
|
|
697
|
+
rawResponse: _response.rawResponse,
|
|
639
698
|
});
|
|
640
699
|
}
|
|
641
700
|
}
|
|
@@ -644,12 +703,14 @@ class Tools {
|
|
|
644
703
|
throw new errors.HumeError({
|
|
645
704
|
statusCode: _response.error.statusCode,
|
|
646
705
|
body: _response.error.rawBody,
|
|
706
|
+
rawResponse: _response.rawResponse,
|
|
647
707
|
});
|
|
648
708
|
case "timeout":
|
|
649
709
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling DELETE /v0/evi/tools/{id}/version/{version}.");
|
|
650
710
|
case "unknown":
|
|
651
711
|
throw new errors.HumeError({
|
|
652
712
|
message: _response.error.errorMessage,
|
|
713
|
+
rawResponse: _response.rawResponse,
|
|
653
714
|
});
|
|
654
715
|
}
|
|
655
716
|
});
|
|
@@ -675,13 +736,16 @@ class Tools {
|
|
|
675
736
|
* versionDescription: "Fetches current temperature, precipitation, wind speed, AQI, and other weather conditions. Uses Celsius, Fahrenheit, or kelvin depending on user's region."
|
|
676
737
|
* })
|
|
677
738
|
*/
|
|
678
|
-
updateToolDescription(
|
|
739
|
+
updateToolDescription(id, version, request = {}, requestOptions) {
|
|
740
|
+
return core.HttpResponsePromise.fromPromise(this.__updateToolDescription(id, version, request, requestOptions));
|
|
741
|
+
}
|
|
742
|
+
__updateToolDescription(id_1, version_1) {
|
|
679
743
|
return __awaiter(this, arguments, void 0, function* (id, version, request = {}, requestOptions) {
|
|
680
744
|
var _a, _b, _c;
|
|
681
745
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
682
746
|
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/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
683
747
|
method: "PATCH",
|
|
684
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.
|
|
748
|
+
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),
|
|
685
749
|
contentType: "application/json",
|
|
686
750
|
requestType: "json",
|
|
687
751
|
body: serializers.empathicVoice.PostedUserDefinedToolVersionDescription.jsonOrThrow(request, {
|
|
@@ -692,12 +756,15 @@ class Tools {
|
|
|
692
756
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
693
757
|
});
|
|
694
758
|
if (_response.ok) {
|
|
695
|
-
return
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
759
|
+
return {
|
|
760
|
+
data: serializers.empathicVoice.tools.updateToolDescription.Response.parseOrThrow(_response.body, {
|
|
761
|
+
unrecognizedObjectKeys: "passthrough",
|
|
762
|
+
allowUnrecognizedUnionMembers: true,
|
|
763
|
+
allowUnrecognizedEnumValues: true,
|
|
764
|
+
breadcrumbsPrefix: ["response"],
|
|
765
|
+
}),
|
|
766
|
+
rawResponse: _response.rawResponse,
|
|
767
|
+
};
|
|
701
768
|
}
|
|
702
769
|
if (_response.error.reason === "status-code") {
|
|
703
770
|
switch (_response.error.statusCode) {
|
|
@@ -707,11 +774,12 @@ class Tools {
|
|
|
707
774
|
allowUnrecognizedUnionMembers: true,
|
|
708
775
|
allowUnrecognizedEnumValues: true,
|
|
709
776
|
breadcrumbsPrefix: ["response"],
|
|
710
|
-
}));
|
|
777
|
+
}), _response.rawResponse);
|
|
711
778
|
default:
|
|
712
779
|
throw new errors.HumeError({
|
|
713
780
|
statusCode: _response.error.statusCode,
|
|
714
781
|
body: _response.error.body,
|
|
782
|
+
rawResponse: _response.rawResponse,
|
|
715
783
|
});
|
|
716
784
|
}
|
|
717
785
|
}
|
|
@@ -720,12 +788,14 @@ class Tools {
|
|
|
720
788
|
throw new errors.HumeError({
|
|
721
789
|
statusCode: _response.error.statusCode,
|
|
722
790
|
body: _response.error.rawBody,
|
|
791
|
+
rawResponse: _response.rawResponse,
|
|
723
792
|
});
|
|
724
793
|
case "timeout":
|
|
725
794
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling PATCH /v0/evi/tools/{id}/version/{version}.");
|
|
726
795
|
case "unknown":
|
|
727
796
|
throw new errors.HumeError({
|
|
728
797
|
message: _response.error.errorMessage,
|
|
798
|
+
rawResponse: _response.rawResponse,
|
|
729
799
|
});
|
|
730
800
|
}
|
|
731
801
|
});
|
|
@@ -10,7 +10,7 @@ export interface AssistantInput {
|
|
|
10
10
|
/**
|
|
11
11
|
* Assistant text to synthesize into spoken audio and insert into the conversation.
|
|
12
12
|
*
|
|
13
|
-
* EVI uses this text to generate spoken audio using our proprietary expressive text-to-speech model. Our model adds appropriate emotional inflections and tones to the text based on the user’s expressions and the context of the conversation. The synthesized audio is streamed back to the user as an [Assistant Message](/reference/empathic-voice-interface-evi/chat/chat#receive.
|
|
13
|
+
* EVI uses this text to generate spoken audio using our proprietary expressive text-to-speech model. Our model adds appropriate emotional inflections and tones to the text based on the user’s expressions and the context of the conversation. The synthesized audio is streamed back to the user as an [Assistant Message](/reference/empathic-voice-interface-evi/chat/chat#receive.AssistantMessage.type).
|
|
14
14
|
*/
|
|
15
15
|
text: string;
|
|
16
16
|
/** The type of message sent through the socket; must be `assistant_input` for our server to correctly identify and process it as an Assistant Input message. */
|
|
@@ -8,7 +8,7 @@ import * as Hume from "../../../index";
|
|
|
8
8
|
export interface AssistantMessage {
|
|
9
9
|
/** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
|
|
10
10
|
customSessionId?: string;
|
|
11
|
-
/** Indicates if this message was inserted into the conversation as text from an [Assistant Input message](/reference/empathic-voice-interface-evi/chat/chat#send.
|
|
11
|
+
/** Indicates if this message was inserted into the conversation as text from an [Assistant Input message](/reference/empathic-voice-interface-evi/chat/chat#send.AssistantInput.text). */
|
|
12
12
|
fromText: boolean;
|
|
13
13
|
/** ID of the assistant message. Allows the Assistant Message to be tracked and referenced. */
|
|
14
14
|
id?: string;
|
|
@@ -10,7 +10,7 @@ export interface PauseAssistantMessage {
|
|
|
10
10
|
/**
|
|
11
11
|
* The type of message sent through the socket; must be `pause_assistant_message` for our server to correctly identify and process it as a Pause Assistant message.
|
|
12
12
|
*
|
|
13
|
-
* Once this message is sent, EVI will not respond until a [Resume Assistant message](/reference/empathic-voice-interface-evi/chat/chat#send.
|
|
13
|
+
* Once this message is sent, EVI will not respond until a [Resume Assistant message](/reference/empathic-voice-interface-evi/chat/chat#send.ResumeAssistantMessage.type) is sent. When paused, EVI won’t respond, but transcriptions of your audio inputs will still be recorded.
|
|
14
14
|
*/
|
|
15
15
|
type: "pause_assistant_message";
|
|
16
16
|
}
|