hume 0.9.13 → 0.9.15
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/expression-measurement/batch/__package__.yml +61 -76
- package/.mock/definition/tts/__package__.yml +113 -15
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +4 -4
- package/api/resources/empathicVoice/resources/chats/client/Client.js +3 -3
- package/api/resources/empathicVoice/resources/configs/client/Client.js +9 -9
- package/api/resources/empathicVoice/resources/customVoices/client/Client.js +6 -6
- package/api/resources/empathicVoice/resources/prompts/client/Client.js +9 -9
- package/api/resources/empathicVoice/resources/tools/client/Client.js +9 -9
- package/api/resources/expressionMeasurement/resources/batch/client/Client.js +6 -6
- package/api/resources/index.d.ts +1 -1
- package/api/resources/index.js +2 -2
- package/api/resources/tts/client/Client.d.ts +11 -0
- package/api/resources/tts/client/Client.js +124 -2
- package/api/resources/tts/resources/voices/client/Client.js +1 -1
- package/api/resources/tts/types/PostedTts.d.ts +10 -0
- package/api/resources/tts/types/Snippet.d.ts +0 -2
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/streaming-fetcher/Stream.d.ts +48 -0
- package/core/streaming-fetcher/Stream.js +170 -0
- package/core/streaming-fetcher/index.d.ts +1 -0
- package/core/streaming-fetcher/index.js +5 -0
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +4 -4
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +3 -3
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +9 -9
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +6 -6
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +9 -9
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +9 -9
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +6 -6
- package/dist/api/resources/index.d.ts +1 -1
- package/dist/api/resources/index.js +2 -2
- package/dist/api/resources/tts/client/Client.d.ts +11 -0
- package/dist/api/resources/tts/client/Client.js +124 -2
- package/dist/api/resources/tts/resources/voices/client/Client.js +1 -1
- package/dist/api/resources/tts/types/PostedTts.d.ts +10 -0
- package/dist/api/resources/tts/types/Snippet.d.ts +0 -2
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/streaming-fetcher/Stream.d.ts +48 -0
- package/dist/core/streaming-fetcher/Stream.js +170 -0
- package/dist/core/streaming-fetcher/index.d.ts +1 -0
- package/dist/core/streaming-fetcher/index.js +5 -0
- package/dist/serialization/resources/index.d.ts +1 -1
- package/dist/serialization/resources/index.js +2 -2
- package/dist/serialization/resources/tts/types/PostedTts.d.ts +1 -0
- package/dist/serialization/resources/tts/types/PostedTts.js +1 -0
- package/dist/serialization/resources/tts/types/Snippet.d.ts +0 -1
- package/dist/serialization/resources/tts/types/Snippet.js +0 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +716 -553
- package/serialization/resources/index.d.ts +1 -1
- package/serialization/resources/index.js +2 -2
- package/serialization/resources/tts/types/PostedTts.d.ts +1 -0
- package/serialization/resources/tts/types/PostedTts.js +1 -0
- package/serialization/resources/tts/types/Snippet.d.ts +0 -1
- package/serialization/resources/tts/types/Snippet.js +0 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -79,7 +79,7 @@ class CustomVoices {
|
|
|
79
79
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
80
80
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/custom_voices"),
|
|
81
81
|
method: "GET",
|
|
82
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
82
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
83
83
|
contentType: "application/json",
|
|
84
84
|
queryParameters: _queryParams,
|
|
85
85
|
requestType: "json",
|
|
@@ -149,7 +149,7 @@ class CustomVoices {
|
|
|
149
149
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
150
150
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/custom_voices"),
|
|
151
151
|
method: "POST",
|
|
152
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
152
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
153
153
|
contentType: "application/json",
|
|
154
154
|
requestType: "json",
|
|
155
155
|
body: serializers.empathicVoice.PostedCustomVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -215,7 +215,7 @@ class CustomVoices {
|
|
|
215
215
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
216
216
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/custom_voices/${encodeURIComponent(id)}`),
|
|
217
217
|
method: "GET",
|
|
218
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
218
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
219
219
|
contentType: "application/json",
|
|
220
220
|
requestType: "json",
|
|
221
221
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -285,7 +285,7 @@ class CustomVoices {
|
|
|
285
285
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
286
286
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/custom_voices/${encodeURIComponent(id)}`),
|
|
287
287
|
method: "POST",
|
|
288
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
288
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
289
289
|
contentType: "application/json",
|
|
290
290
|
requestType: "json",
|
|
291
291
|
body: serializers.empathicVoice.PostedCustomVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -351,7 +351,7 @@ class CustomVoices {
|
|
|
351
351
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
352
352
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/custom_voices/${encodeURIComponent(id)}`),
|
|
353
353
|
method: "DELETE",
|
|
354
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
354
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
355
355
|
contentType: "application/json",
|
|
356
356
|
requestType: "json",
|
|
357
357
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -414,7 +414,7 @@ class CustomVoices {
|
|
|
414
414
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
415
415
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/custom_voices/${encodeURIComponent(id)}`),
|
|
416
416
|
method: "PATCH",
|
|
417
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
417
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
418
418
|
contentType: "application/json",
|
|
419
419
|
requestType: "json",
|
|
420
420
|
body: serializers.empathicVoice.PostedCustomVoiceName.jsonOrThrow(request, {
|
|
@@ -86,7 +86,7 @@ class Prompts {
|
|
|
86
86
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
87
87
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/prompts"),
|
|
88
88
|
method: "GET",
|
|
89
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
89
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
90
90
|
contentType: "application/json",
|
|
91
91
|
queryParameters: _queryParams,
|
|
92
92
|
requestType: "json",
|
|
@@ -166,7 +166,7 @@ class Prompts {
|
|
|
166
166
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
167
167
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/prompts"),
|
|
168
168
|
method: "POST",
|
|
169
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
169
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
170
170
|
contentType: "application/json",
|
|
171
171
|
requestType: "json",
|
|
172
172
|
body: serializers.empathicVoice.PostedPrompt.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -244,7 +244,7 @@ class Prompts {
|
|
|
244
244
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
245
245
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
|
|
246
246
|
method: "GET",
|
|
247
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
247
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
248
248
|
contentType: "application/json",
|
|
249
249
|
queryParameters: _queryParams,
|
|
250
250
|
requestType: "json",
|
|
@@ -314,7 +314,7 @@ class Prompts {
|
|
|
314
314
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
315
315
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
|
|
316
316
|
method: "POST",
|
|
317
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
317
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
318
318
|
contentType: "application/json",
|
|
319
319
|
requestType: "json",
|
|
320
320
|
body: serializers.empathicVoice.PostedPromptVersion.jsonOrThrow(request, {
|
|
@@ -382,7 +382,7 @@ class Prompts {
|
|
|
382
382
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
383
383
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
|
|
384
384
|
method: "DELETE",
|
|
385
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
385
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
386
386
|
contentType: "application/json",
|
|
387
387
|
requestType: "json",
|
|
388
388
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -445,7 +445,7 @@ class Prompts {
|
|
|
445
445
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
446
446
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}`),
|
|
447
447
|
method: "PATCH",
|
|
448
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
448
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
449
449
|
contentType: "application/json",
|
|
450
450
|
requestType: "json",
|
|
451
451
|
body: serializers.empathicVoice.PostedPromptName.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -512,7 +512,7 @@ class Prompts {
|
|
|
512
512
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
513
513
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
514
514
|
method: "GET",
|
|
515
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
515
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
516
516
|
contentType: "application/json",
|
|
517
517
|
requestType: "json",
|
|
518
518
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -582,7 +582,7 @@ class Prompts {
|
|
|
582
582
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
583
583
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
584
584
|
method: "DELETE",
|
|
585
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
585
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
586
586
|
contentType: "application/json",
|
|
587
587
|
requestType: "json",
|
|
588
588
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -650,7 +650,7 @@ class Prompts {
|
|
|
650
650
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
651
651
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
652
652
|
method: "PATCH",
|
|
653
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
653
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
654
654
|
contentType: "application/json",
|
|
655
655
|
requestType: "json",
|
|
656
656
|
body: serializers.empathicVoice.PostedPromptVersionDescription.jsonOrThrow(request, {
|
|
@@ -86,7 +86,7 @@ class Tools {
|
|
|
86
86
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
87
87
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/tools"),
|
|
88
88
|
method: "GET",
|
|
89
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
89
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
90
90
|
contentType: "application/json",
|
|
91
91
|
queryParameters: _queryParams,
|
|
92
92
|
requestType: "json",
|
|
@@ -169,7 +169,7 @@ class Tools {
|
|
|
169
169
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
170
170
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/evi/tools"),
|
|
171
171
|
method: "POST",
|
|
172
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
172
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
173
173
|
contentType: "application/json",
|
|
174
174
|
requestType: "json",
|
|
175
175
|
body: serializers.empathicVoice.PostedUserDefinedTool.jsonOrThrow(request, {
|
|
@@ -249,7 +249,7 @@ class Tools {
|
|
|
249
249
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
250
250
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
|
|
251
251
|
method: "GET",
|
|
252
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
252
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
253
253
|
contentType: "application/json",
|
|
254
254
|
queryParameters: _queryParams,
|
|
255
255
|
requestType: "json",
|
|
@@ -321,7 +321,7 @@ class Tools {
|
|
|
321
321
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
322
322
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
|
|
323
323
|
method: "POST",
|
|
324
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
324
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
325
325
|
contentType: "application/json",
|
|
326
326
|
requestType: "json",
|
|
327
327
|
body: serializers.empathicVoice.PostedUserDefinedToolVersion.jsonOrThrow(request, {
|
|
@@ -389,7 +389,7 @@ class Tools {
|
|
|
389
389
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
390
390
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
|
|
391
391
|
method: "DELETE",
|
|
392
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
392
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
393
393
|
contentType: "application/json",
|
|
394
394
|
requestType: "json",
|
|
395
395
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -452,7 +452,7 @@ class Tools {
|
|
|
452
452
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
453
453
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}`),
|
|
454
454
|
method: "PATCH",
|
|
455
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
455
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
456
456
|
contentType: "application/json",
|
|
457
457
|
requestType: "json",
|
|
458
458
|
body: serializers.empathicVoice.PostedUserDefinedToolName.jsonOrThrow(request, {
|
|
@@ -521,7 +521,7 @@ class Tools {
|
|
|
521
521
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
522
522
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
523
523
|
method: "GET",
|
|
524
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
524
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
525
525
|
contentType: "application/json",
|
|
526
526
|
requestType: "json",
|
|
527
527
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -591,7 +591,7 @@ class Tools {
|
|
|
591
591
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
592
592
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
593
593
|
method: "DELETE",
|
|
594
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
594
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
595
595
|
contentType: "application/json",
|
|
596
596
|
requestType: "json",
|
|
597
597
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -659,7 +659,7 @@ class Tools {
|
|
|
659
659
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
660
660
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/tools/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
|
|
661
661
|
method: "PATCH",
|
|
662
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
662
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
663
663
|
contentType: "application/json",
|
|
664
664
|
requestType: "json",
|
|
665
665
|
body: serializers.empathicVoice.PostedUserDefinedToolVersionDescription.jsonOrThrow(request, {
|
|
@@ -88,7 +88,7 @@ class Batch {
|
|
|
88
88
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
89
89
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/batch/jobs"),
|
|
90
90
|
method: "GET",
|
|
91
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
91
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
92
92
|
contentType: "application/json",
|
|
93
93
|
queryParameters: _queryParams,
|
|
94
94
|
requestType: "json",
|
|
@@ -143,7 +143,7 @@ class Batch {
|
|
|
143
143
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
144
144
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/batch/jobs"),
|
|
145
145
|
method: "POST",
|
|
146
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
146
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
147
147
|
contentType: "application/json",
|
|
148
148
|
requestType: "json",
|
|
149
149
|
body: serializers.expressionMeasurement.batch.InferenceBaseRequest.jsonOrThrow(request, {
|
|
@@ -197,7 +197,7 @@ class Batch {
|
|
|
197
197
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
198
198
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/batch/jobs/${encodeURIComponent(id)}`),
|
|
199
199
|
method: "GET",
|
|
200
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
200
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
201
201
|
contentType: "application/json",
|
|
202
202
|
requestType: "json",
|
|
203
203
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -248,7 +248,7 @@ class Batch {
|
|
|
248
248
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
249
249
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/batch/jobs/${encodeURIComponent(id)}/predictions`),
|
|
250
250
|
method: "GET",
|
|
251
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
251
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
252
252
|
contentType: "application/json",
|
|
253
253
|
requestType: "json",
|
|
254
254
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -293,7 +293,7 @@ class Batch {
|
|
|
293
293
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
294
294
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/batch/jobs/${encodeURIComponent(id)}/artifacts`),
|
|
295
295
|
method: "GET",
|
|
296
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
296
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
297
297
|
contentType: "application/json",
|
|
298
298
|
requestType: "json",
|
|
299
299
|
responseType: "streaming",
|
|
@@ -349,7 +349,7 @@ class Batch {
|
|
|
349
349
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
350
350
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/batch/jobs"),
|
|
351
351
|
method: "POST",
|
|
352
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
352
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers),
|
|
353
353
|
requestType: "file",
|
|
354
354
|
duplex: _maybeEncodedRequest.duplex,
|
|
355
355
|
body: _maybeEncodedRequest.body,
|
package/api/resources/index.d.ts
CHANGED
package/api/resources/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
26
|
+
exports.empathicVoice = exports.expressionMeasurement = exports.tts = void 0;
|
|
27
27
|
exports.tts = __importStar(require("./tts"));
|
|
28
|
-
exports.empathicVoice = __importStar(require("./empathicVoice"));
|
|
29
28
|
exports.expressionMeasurement = __importStar(require("./expressionMeasurement"));
|
|
29
|
+
exports.empathicVoice = __importStar(require("./empathicVoice"));
|
|
@@ -61,6 +61,17 @@ export declare class Tts {
|
|
|
61
61
|
* @throws {@link Hume.tts.UnprocessableEntityError}
|
|
62
62
|
*/
|
|
63
63
|
synthesizeFile(request: Hume.tts.PostedTts, requestOptions?: Tts.RequestOptions): Promise<stream.Readable>;
|
|
64
|
+
/**
|
|
65
|
+
* Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
|
|
66
|
+
* @throws {@link Hume.tts.UnprocessableEntityError}
|
|
67
|
+
*/
|
|
68
|
+
synthesizeFileStreaming(request: Hume.tts.PostedTts, requestOptions?: Tts.RequestOptions): Promise<stream.Readable>;
|
|
69
|
+
/**
|
|
70
|
+
* Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
|
|
71
|
+
*
|
|
72
|
+
* The response is a stream of JSON objects including audio encoded in base64.
|
|
73
|
+
*/
|
|
74
|
+
synthesizeJsonStreaming(request: Hume.tts.PostedTts, requestOptions?: Tts.RequestOptions): Promise<core.Stream<Hume.tts.Snippet>>;
|
|
64
75
|
protected _voices: Voices | undefined;
|
|
65
76
|
get voices(): Voices;
|
|
66
77
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
@@ -84,7 +84,7 @@ class Tts {
|
|
|
84
84
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
85
85
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/tts"),
|
|
86
86
|
method: "POST",
|
|
87
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
87
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
88
88
|
contentType: "application/json",
|
|
89
89
|
requestType: "json",
|
|
90
90
|
body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -143,7 +143,7 @@ class Tts {
|
|
|
143
143
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
144
144
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/tts/file"),
|
|
145
145
|
method: "POST",
|
|
146
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
146
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
147
147
|
contentType: "application/json",
|
|
148
148
|
requestType: "json",
|
|
149
149
|
body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -186,6 +186,128 @@ class Tts {
|
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
|
|
191
|
+
* @throws {@link Hume.tts.UnprocessableEntityError}
|
|
192
|
+
*/
|
|
193
|
+
synthesizeFileStreaming(request, requestOptions) {
|
|
194
|
+
var _a, _b;
|
|
195
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
197
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/tts/stream/file"),
|
|
198
|
+
method: "POST",
|
|
199
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
200
|
+
contentType: "application/json",
|
|
201
|
+
requestType: "json",
|
|
202
|
+
body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
203
|
+
responseType: "streaming",
|
|
204
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
205
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
206
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
207
|
+
});
|
|
208
|
+
if (_response.ok) {
|
|
209
|
+
return _response.body;
|
|
210
|
+
}
|
|
211
|
+
if (_response.error.reason === "status-code") {
|
|
212
|
+
switch (_response.error.statusCode) {
|
|
213
|
+
case 422:
|
|
214
|
+
throw new Hume.tts.UnprocessableEntityError(serializers.tts.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
215
|
+
unrecognizedObjectKeys: "passthrough",
|
|
216
|
+
allowUnrecognizedUnionMembers: true,
|
|
217
|
+
allowUnrecognizedEnumValues: true,
|
|
218
|
+
breadcrumbsPrefix: ["response"],
|
|
219
|
+
}));
|
|
220
|
+
default:
|
|
221
|
+
throw new errors.HumeError({
|
|
222
|
+
statusCode: _response.error.statusCode,
|
|
223
|
+
body: _response.error.body,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
switch (_response.error.reason) {
|
|
228
|
+
case "non-json":
|
|
229
|
+
throw new errors.HumeError({
|
|
230
|
+
statusCode: _response.error.statusCode,
|
|
231
|
+
body: _response.error.rawBody,
|
|
232
|
+
});
|
|
233
|
+
case "timeout":
|
|
234
|
+
throw new errors.HumeTimeoutError();
|
|
235
|
+
case "unknown":
|
|
236
|
+
throw new errors.HumeError({
|
|
237
|
+
message: _response.error.errorMessage,
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
|
|
244
|
+
*
|
|
245
|
+
* The response is a stream of JSON objects including audio encoded in base64.
|
|
246
|
+
*/
|
|
247
|
+
synthesizeJsonStreaming(request, requestOptions) {
|
|
248
|
+
var _a, _b;
|
|
249
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
250
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
251
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/tts/stream/json"),
|
|
252
|
+
method: "POST",
|
|
253
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
254
|
+
contentType: "application/json",
|
|
255
|
+
requestType: "json",
|
|
256
|
+
body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
257
|
+
responseType: "sse",
|
|
258
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
259
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
260
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
261
|
+
});
|
|
262
|
+
if (_response.ok) {
|
|
263
|
+
return new core.Stream({
|
|
264
|
+
stream: _response.body,
|
|
265
|
+
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
266
|
+
return serializers.tts.Snippet.parseOrThrow(data, {
|
|
267
|
+
unrecognizedObjectKeys: "passthrough",
|
|
268
|
+
allowUnrecognizedUnionMembers: true,
|
|
269
|
+
allowUnrecognizedEnumValues: true,
|
|
270
|
+
breadcrumbsPrefix: ["response"],
|
|
271
|
+
});
|
|
272
|
+
}),
|
|
273
|
+
signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
274
|
+
eventShape: {
|
|
275
|
+
type: "json",
|
|
276
|
+
messageTerminator: "\n",
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
if (_response.error.reason === "status-code") {
|
|
281
|
+
switch (_response.error.statusCode) {
|
|
282
|
+
case 422:
|
|
283
|
+
throw new Hume.tts.UnprocessableEntityError(serializers.tts.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
284
|
+
unrecognizedObjectKeys: "passthrough",
|
|
285
|
+
allowUnrecognizedUnionMembers: true,
|
|
286
|
+
allowUnrecognizedEnumValues: true,
|
|
287
|
+
breadcrumbsPrefix: ["response"],
|
|
288
|
+
}));
|
|
289
|
+
default:
|
|
290
|
+
throw new errors.HumeError({
|
|
291
|
+
statusCode: _response.error.statusCode,
|
|
292
|
+
body: _response.error.body,
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
switch (_response.error.reason) {
|
|
297
|
+
case "non-json":
|
|
298
|
+
throw new errors.HumeError({
|
|
299
|
+
statusCode: _response.error.statusCode,
|
|
300
|
+
body: _response.error.rawBody,
|
|
301
|
+
});
|
|
302
|
+
case "timeout":
|
|
303
|
+
throw new errors.HumeTimeoutError();
|
|
304
|
+
case "unknown":
|
|
305
|
+
throw new errors.HumeError({
|
|
306
|
+
message: _response.error.errorMessage,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
189
311
|
get voices() {
|
|
190
312
|
var _a;
|
|
191
313
|
return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new Client_1.Voices(this._options)));
|
|
@@ -69,7 +69,7 @@ class Voices {
|
|
|
69
69
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
70
70
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/tts/voices"),
|
|
71
71
|
method: "POST",
|
|
72
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.
|
|
72
|
+
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.15", "User-Agent": "hume/0.9.15", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
73
73
|
contentType: "application/json",
|
|
74
74
|
requestType: "json",
|
|
75
75
|
body: serializers.tts.PostedVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -9,6 +9,16 @@ export interface PostedTts {
|
|
|
9
9
|
format?: Hume.tts.Format;
|
|
10
10
|
/** Number of generations of the audio to produce. */
|
|
11
11
|
numGenerations?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Controls how audio output is segmented in the response.
|
|
14
|
+
*
|
|
15
|
+
* - When **enabled** (`true`), input utterances are automatically split into natural-sounding speech segments.
|
|
16
|
+
*
|
|
17
|
+
* - When **disabled** (`false`), the response maintains a strict one-to-one mapping between input utterances and output snippets.
|
|
18
|
+
*
|
|
19
|
+
* This setting affects how the `snippets` array is structured in the response, which may be important for applications that need to track the relationship between input text and generated audio segments. When setting to `false`, avoid including utterances with long `text`, as this can result in distorted output.
|
|
20
|
+
*/
|
|
21
|
+
splitUtterances?: boolean;
|
|
12
22
|
/** Utterances to be converted to speech output. */
|
|
13
23
|
utterances: Hume.tts.PostedUtterance[];
|
|
14
24
|
}
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
export interface Snippet {
|
|
5
5
|
/** The segmented audio output in the requested format, encoded as a base64 string. */
|
|
6
6
|
audio: string;
|
|
7
|
-
/** The generated audio output format. */
|
|
8
|
-
audioFormat: string;
|
|
9
7
|
/** The generation ID this snippet corresponds to. */
|
|
10
8
|
generationId: string;
|
|
11
9
|
/** A unique ID associated with this **Snippet**. */
|
package/core/index.d.ts
CHANGED
package/core/index.js
CHANGED
|
@@ -28,6 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.serialization = void 0;
|
|
30
30
|
/** THIS FILE IS MANUALLY MAINAINED: see .fernignore */
|
|
31
|
+
__exportStar(require("./streaming-fetcher"), exports);
|
|
31
32
|
__exportStar(require("./fetcher"), exports);
|
|
32
33
|
__exportStar(require("./runtime"), exports);
|
|
33
34
|
__exportStar(require("./form-data-utils"), exports);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Readable } from "stream";
|
|
3
|
+
export declare namespace Stream {
|
|
4
|
+
interface Args {
|
|
5
|
+
/**
|
|
6
|
+
* The HTTP response stream to read from.
|
|
7
|
+
*/
|
|
8
|
+
stream: Readable | ReadableStream;
|
|
9
|
+
/**
|
|
10
|
+
* The event shape to use for parsing the stream data.
|
|
11
|
+
*/
|
|
12
|
+
eventShape: JsonEvent | SseEvent;
|
|
13
|
+
/**
|
|
14
|
+
* An abort signal to stop the stream.
|
|
15
|
+
*/
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}
|
|
18
|
+
interface JsonEvent {
|
|
19
|
+
type: "json";
|
|
20
|
+
messageTerminator: string;
|
|
21
|
+
}
|
|
22
|
+
interface SseEvent {
|
|
23
|
+
type: "sse";
|
|
24
|
+
streamTerminator?: string;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export declare class Stream<T> implements AsyncIterable<T> {
|
|
28
|
+
private stream;
|
|
29
|
+
private parse;
|
|
30
|
+
/**
|
|
31
|
+
* The prefix to use for each message. For example,
|
|
32
|
+
* for SSE, the prefix is "data: ".
|
|
33
|
+
*/
|
|
34
|
+
private prefix;
|
|
35
|
+
private messageTerminator;
|
|
36
|
+
private streamTerminator;
|
|
37
|
+
private controller;
|
|
38
|
+
constructor({ stream, parse, eventShape, signal }: Stream.Args & {
|
|
39
|
+
parse: (val: unknown) => Promise<T>;
|
|
40
|
+
});
|
|
41
|
+
private iterMessages;
|
|
42
|
+
[Symbol.asyncIterator](): AsyncIterator<T, void, unknown>;
|
|
43
|
+
private decodeChunk;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Browser polyfill for ReadableStream
|
|
47
|
+
*/
|
|
48
|
+
export declare function readableStreamAsyncIterable<T>(stream: any): AsyncIterableIterator<T>;
|