hume 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mock/definition/empathic-voice/__package__.yml +24 -0
- package/.mock/definition/empathic-voice/configs.yml +2 -0
- package/.mock/definition/tts/__package__.yml +28 -0
- package/.mock/fern.config.json +1 -1
- package/Client.d.ts +11 -7
- package/Client.js +54 -6
- package/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
- package/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +4 -2
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +74 -40
- package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
- package/api/resources/empathicVoice/resources/chats/client/Client.js +55 -30
- package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
- package/api/resources/empathicVoice/resources/configs/client/Client.js +134 -64
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
- package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +10 -5
- package/api/resources/empathicVoice/resources/customVoices/client/Client.js +88 -41
- package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
- package/api/resources/empathicVoice/resources/prompts/client/Client.js +133 -62
- package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
- package/api/resources/empathicVoice/resources/tools/client/Client.js +134 -64
- package/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
- package/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
- package/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
- package/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
- package/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
- package/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
- package/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/api/resources/empathicVoice/types/index.d.ts +2 -0
- package/api/resources/empathicVoice/types/index.js +2 -0
- package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +12 -6
- package/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
- package/api/resources/tts/client/Client.d.ts +24 -18
- package/api/resources/tts/client/Client.js +84 -46
- package/api/resources/tts/client/index.d.ts +1 -1
- package/api/resources/tts/client/index.js +15 -0
- package/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
- package/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
- package/api/resources/tts/client/requests/index.d.ts +1 -0
- package/api/resources/tts/client/requests/index.js +2 -0
- package/api/resources/tts/errors/BadRequestError.d.ts +2 -1
- package/api/resources/tts/errors/BadRequestError.js +2 -1
- package/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
- package/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
- package/api/resources/tts/resources/voices/client/Client.d.ts +4 -2
- package/api/resources/tts/resources/voices/client/Client.js +45 -22
- package/api/resources/tts/types/Snippet.d.ts +2 -0
- package/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/Fetcher.js +7 -0
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/index.d.ts +3 -0
- package/core/fetcher/index.js +7 -1
- package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/core/form-data-utils/FormDataWrapper.js +48 -9
- package/core/pagination/Page.d.ts +5 -2
- package/core/pagination/Page.js +5 -2
- package/core/pagination/Pageable.d.ts +2 -0
- package/dist/Client.d.ts +11 -7
- package/dist/Client.js +54 -6
- package/dist/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +4 -2
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +74 -40
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +55 -30
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +134 -64
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +10 -5
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +88 -41
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +133 -62
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +134 -64
- package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
- package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
- package/dist/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
- package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
- package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
- package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
- package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/dist/api/resources/empathicVoice/types/index.d.ts +2 -0
- package/dist/api/resources/empathicVoice/types/index.js +2 -0
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +12 -6
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
- package/dist/api/resources/tts/client/Client.d.ts +24 -18
- package/dist/api/resources/tts/client/Client.js +84 -46
- package/dist/api/resources/tts/client/index.d.ts +1 -1
- package/dist/api/resources/tts/client/index.js +15 -0
- package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
- package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
- package/dist/api/resources/tts/client/requests/index.d.ts +1 -0
- package/dist/api/resources/tts/client/requests/index.js +2 -0
- package/dist/api/resources/tts/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/tts/errors/BadRequestError.js +2 -1
- package/dist/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
- package/dist/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
- package/dist/api/resources/tts/resources/voices/client/Client.d.ts +4 -2
- package/dist/api/resources/tts/resources/voices/client/Client.js +45 -22
- package/dist/api/resources/tts/types/Snippet.d.ts +2 -0
- package/dist/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/Fetcher.js +7 -0
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/index.d.ts +3 -0
- package/dist/core/fetcher/index.js +7 -1
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +48 -9
- package/dist/core/pagination/Page.d.ts +5 -2
- package/dist/core/pagination/Page.js +5 -2
- package/dist/core/pagination/Pageable.d.ts +2 -0
- package/dist/errors/HumeError.d.ts +7 -2
- package/dist/errors/HumeError.js +10 -10
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
- package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
- package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
- package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
- package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/dist/serialization/resources/empathicVoice/types/index.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/types/index.js +2 -0
- package/dist/serialization/resources/tts/types/Snippet.d.ts +1 -0
- package/dist/serialization/resources/tts/types/Snippet.js +1 -0
- package/dist/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
- package/dist/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
- package/dist/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
- package/dist/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
- package/errors/HumeError.d.ts +7 -2
- package/errors/HumeError.js +10 -10
- package/package.json +3 -2
- package/reference.md +17 -15
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
- package/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
- package/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
- package/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
- package/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
- package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
- package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
- package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
- package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/serialization/resources/empathicVoice/types/index.d.ts +2 -0
- package/serialization/resources/empathicVoice/types/index.js +2 -0
- package/serialization/resources/tts/types/Snippet.d.ts +1 -0
- package/serialization/resources/tts/types/Snippet.js +1 -0
- package/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
- package/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
- package/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
- package/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
|
@@ -1182,6 +1182,7 @@ types:
|
|
|
1182
1182
|
- USER_TIMEOUT
|
|
1183
1183
|
- INACTIVITY_TIMEOUT
|
|
1184
1184
|
- MAX_DURATION_TIMEOUT
|
|
1185
|
+
- SILENCE_TIMEOUT
|
|
1185
1186
|
- ERROR
|
|
1186
1187
|
source:
|
|
1187
1188
|
openapi: evi-openapi.json
|
|
@@ -1869,6 +1870,7 @@ types:
|
|
|
1869
1870
|
docs: List of built-in tools associated with this Config.
|
|
1870
1871
|
event_messages: optional<ReturnEventMessageSpecs>
|
|
1871
1872
|
timeouts: optional<ReturnTimeoutSpecs>
|
|
1873
|
+
nudges: optional<ReturnNudgeSpec>
|
|
1872
1874
|
webhooks:
|
|
1873
1875
|
type: optional<list<optional<ReturnWebhookSpec>>>
|
|
1874
1876
|
docs: Map of webhooks associated with this config.
|
|
@@ -2564,6 +2566,17 @@ types:
|
|
|
2564
2566
|
the time limit for the chat has been reached.
|
|
2565
2567
|
source:
|
|
2566
2568
|
openapi: evi-openapi.json
|
|
2569
|
+
PostedNudgeSpec:
|
|
2570
|
+
docs: A nudge specification posted to the server
|
|
2571
|
+
properties:
|
|
2572
|
+
enabled:
|
|
2573
|
+
type: optional<boolean>
|
|
2574
|
+
docs: EVI will nudge user after inactivity
|
|
2575
|
+
interval_secs:
|
|
2576
|
+
type: optional<integer>
|
|
2577
|
+
docs: Time interval in seconds after which the nudge will be sent.
|
|
2578
|
+
source:
|
|
2579
|
+
openapi: evi-openapi.json
|
|
2567
2580
|
PostedTimeoutSpecsInactivity:
|
|
2568
2581
|
docs: >-
|
|
2569
2582
|
Specifies the duration of user inactivity (in seconds) after which the EVI
|
|
@@ -2815,6 +2828,17 @@ types:
|
|
|
2815
2828
|
seconds.
|
|
2816
2829
|
source:
|
|
2817
2830
|
openapi: evi-openapi.json
|
|
2831
|
+
ReturnNudgeSpec:
|
|
2832
|
+
docs: A specific nudge configuration returned from the server
|
|
2833
|
+
properties:
|
|
2834
|
+
enabled:
|
|
2835
|
+
type: boolean
|
|
2836
|
+
docs: EVI will nudge user after inactivity
|
|
2837
|
+
interval_secs:
|
|
2838
|
+
type: optional<integer>
|
|
2839
|
+
docs: Time interval in seconds after which the nudge will be sent.
|
|
2840
|
+
source:
|
|
2841
|
+
openapi: evi-openapi.json
|
|
2818
2842
|
ReturnWebhookEventType:
|
|
2819
2843
|
enum:
|
|
2820
2844
|
- chat_started
|
|
@@ -202,6 +202,7 @@ service:
|
|
|
202
202
|
type: optional<list<optional<root.PostedBuiltinTool>>>
|
|
203
203
|
docs: List of built-in tools associated with this Config.
|
|
204
204
|
event_messages: optional<root.PostedEventMessageSpecs>
|
|
205
|
+
nudges: optional<root.PostedNudgeSpec>
|
|
205
206
|
timeouts: optional<root.PostedTimeoutSpecs>
|
|
206
207
|
webhooks:
|
|
207
208
|
type: optional<list<optional<root.PostedWebhookSpec>>>
|
|
@@ -505,6 +506,7 @@ service:
|
|
|
505
506
|
docs: List of built-in tools associated with this Config version.
|
|
506
507
|
event_messages: optional<root.PostedEventMessageSpecs>
|
|
507
508
|
timeouts: optional<root.PostedTimeoutSpecs>
|
|
509
|
+
nudges: optional<root.PostedNudgeSpec>
|
|
508
510
|
webhooks:
|
|
509
511
|
type: optional<list<optional<root.PostedWebhookSpec>>>
|
|
510
512
|
docs: Webhook config specifications for each subscriber.
|
|
@@ -34,6 +34,23 @@ service:
|
|
|
34
34
|
request:
|
|
35
35
|
body:
|
|
36
36
|
type: PostedTts
|
|
37
|
+
query-parameters:
|
|
38
|
+
access_token:
|
|
39
|
+
type: optional<string>
|
|
40
|
+
default: ''
|
|
41
|
+
docs: >-
|
|
42
|
+
Access token used for authenticating the client. If not provided,
|
|
43
|
+
an `api_key` must be provided to authenticate.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
The access token is generated using both an API key and a Secret
|
|
47
|
+
key, which provides an additional layer of security compared to
|
|
48
|
+
using just an API key.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
For more details, refer to the [Authentication Strategies
|
|
52
|
+
Guide](/docs/introduction/api-key#authentication-strategies).
|
|
53
|
+
name: SynthesizeJsonRequest
|
|
37
54
|
content-type: application/json
|
|
38
55
|
response:
|
|
39
56
|
docs: Successful Response
|
|
@@ -444,6 +461,11 @@ types:
|
|
|
444
461
|
text:
|
|
445
462
|
type: string
|
|
446
463
|
docs: The text for this **Snippet**.
|
|
464
|
+
transcribed_text:
|
|
465
|
+
type: optional<string>
|
|
466
|
+
docs: >-
|
|
467
|
+
The transcribed text of the generated audio. It is only present if
|
|
468
|
+
`instant_mode` is set to `false`.
|
|
447
469
|
utterance_index:
|
|
448
470
|
type: optional<integer>
|
|
449
471
|
docs: The index of the utterance in the request this snippet corresponds to.
|
|
@@ -473,6 +495,12 @@ types:
|
|
|
473
495
|
text:
|
|
474
496
|
type: string
|
|
475
497
|
docs: The text of the parent snippet that this chunk corresponds to.
|
|
498
|
+
transcribed_text:
|
|
499
|
+
type: optional<string>
|
|
500
|
+
docs: >-
|
|
501
|
+
The transcribed text of the generated audio of the parent snippet that
|
|
502
|
+
this chunk corresponds to. It is only present if `instant_mode` is set
|
|
503
|
+
to `false`.
|
|
476
504
|
utterance_index:
|
|
477
505
|
type: optional<integer>
|
|
478
506
|
docs: >-
|
package/.mock/fern.config.json
CHANGED
package/Client.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/** THIS FILE IS MANUALLY MAINAINED: see .fernignore */
|
|
2
2
|
import * as environments from "./environments";
|
|
3
3
|
import * as core from "./core";
|
|
4
|
-
import { ExpressionMeasurement } from "./api/resources/expressionMeasurement/client/Client";
|
|
5
|
-
import { EmpathicVoice } from "./api/resources/empathicVoice/client/Client";
|
|
6
4
|
import { Tts } from "./api/resources/tts/client/Client";
|
|
5
|
+
import { EmpathicVoice } from "./api/resources/empathicVoice/client/Client";
|
|
6
|
+
import { ExpressionMeasurement } from "./api/resources/expressionMeasurement/client/Client";
|
|
7
7
|
export declare namespace HumeClient {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.HumeEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
11
13
|
accessToken?: core.Supplier<string | undefined>;
|
|
12
14
|
fetcher?: core.FetchFunction;
|
|
@@ -18,15 +20,17 @@ export declare namespace HumeClient {
|
|
|
18
20
|
maxRetries?: number;
|
|
19
21
|
/** A hook to abort the request. */
|
|
20
22
|
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional headers to include in the request. */
|
|
24
|
+
headers?: Record<string, string>;
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
export declare class HumeClient {
|
|
24
28
|
protected readonly _options: HumeClient.Options;
|
|
25
|
-
constructor(_options?: HumeClient.Options);
|
|
26
|
-
protected _expressionMeasurement: ExpressionMeasurement | undefined;
|
|
27
|
-
get expressionMeasurement(): ExpressionMeasurement;
|
|
28
|
-
protected _empathicVoice: EmpathicVoice | undefined;
|
|
29
|
-
get empathicVoice(): EmpathicVoice;
|
|
30
29
|
protected _tts: Tts | undefined;
|
|
30
|
+
protected _empathicVoice: EmpathicVoice | undefined;
|
|
31
|
+
protected _expressionMeasurement: ExpressionMeasurement | undefined;
|
|
32
|
+
constructor(_options?: HumeClient.Options);
|
|
31
33
|
get tts(): Tts;
|
|
34
|
+
get empathicVoice(): EmpathicVoice;
|
|
35
|
+
get expressionMeasurement(): ExpressionMeasurement;
|
|
32
36
|
}
|
package/Client.js
CHANGED
|
@@ -1,25 +1,73 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/** THIS FILE IS MANUALLY MAINAINED: see .fernignore */
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
37
|
exports.HumeClient = void 0;
|
|
5
|
-
const
|
|
38
|
+
const core = __importStar(require("./core"));
|
|
39
|
+
const Client_1 = require("./api/resources/tts/client/Client");
|
|
6
40
|
const Client_2 = require("./api/resources/empathicVoice/client/Client");
|
|
7
|
-
const Client_3 = require("./api/resources/
|
|
41
|
+
const Client_3 = require("./api/resources/expressionMeasurement/client/Client");
|
|
42
|
+
const version_1 = require("./version");
|
|
43
|
+
const fetcherThatAddsHeaders = (fetcherToWrap) => {
|
|
44
|
+
return (args) => {
|
|
45
|
+
var _a;
|
|
46
|
+
const newArgs = Object.assign({}, args);
|
|
47
|
+
newArgs.headers = (_a = newArgs.headers) !== null && _a !== void 0 ? _a : {};
|
|
48
|
+
(newArgs.headers["X-Hume-Client-Name"] = "typescript_sdk"),
|
|
49
|
+
(newArgs.headers["X-Hume-Client-Version"] = version_1.SDK_VERSION);
|
|
50
|
+
return fetcherToWrap(args);
|
|
51
|
+
};
|
|
52
|
+
};
|
|
8
53
|
class HumeClient {
|
|
9
54
|
constructor(_options = {}) {
|
|
55
|
+
var _a;
|
|
10
56
|
this._options = _options;
|
|
57
|
+
const defaultFetcher = (_a = _options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher;
|
|
58
|
+
this._options.fetcher = fetcherThatAddsHeaders(defaultFetcher);
|
|
11
59
|
}
|
|
12
|
-
get
|
|
60
|
+
get tts() {
|
|
13
61
|
var _a;
|
|
14
|
-
return ((_a = this.
|
|
62
|
+
return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new Client_1.Tts(this._options)));
|
|
15
63
|
}
|
|
16
64
|
get empathicVoice() {
|
|
17
65
|
var _a;
|
|
18
66
|
return ((_a = this._empathicVoice) !== null && _a !== void 0 ? _a : (this._empathicVoice = new Client_2.EmpathicVoice(this._options)));
|
|
19
67
|
}
|
|
20
|
-
get
|
|
68
|
+
get expressionMeasurement() {
|
|
21
69
|
var _a;
|
|
22
|
-
return ((_a = this.
|
|
70
|
+
return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new Client_3.ExpressionMeasurement(this._options)));
|
|
23
71
|
}
|
|
24
72
|
}
|
|
25
73
|
exports.HumeClient = HumeClient;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as errors from "../../../../errors/index";
|
|
5
5
|
import * as Hume from "../../../index";
|
|
6
|
+
import * as core from "../../../../core";
|
|
6
7
|
export declare class BadRequestError extends errors.HumeError {
|
|
7
|
-
constructor(body: Hume.empathicVoice.ErrorResponse);
|
|
8
|
+
constructor(body: Hume.empathicVoice.ErrorResponse, rawResponse?: core.RawResponse);
|
|
8
9
|
}
|
|
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.BadRequestError = void 0;
|
|
40
40
|
const errors = __importStar(require("../../../../errors/index"));
|
|
41
41
|
class BadRequestError extends errors.HumeError {
|
|
42
|
-
constructor(body) {
|
|
42
|
+
constructor(body, rawResponse) {
|
|
43
43
|
super({
|
|
44
44
|
message: "BadRequestError",
|
|
45
45
|
statusCode: 400,
|
|
46
46
|
body: body,
|
|
47
|
+
rawResponse: rawResponse,
|
|
47
48
|
});
|
|
48
49
|
Object.setPrototypeOf(this, BadRequestError.prototype);
|
|
49
50
|
}
|
|
@@ -59,7 +59,8 @@ export declare class ChatGroups {
|
|
|
59
59
|
* ascendingOrder: true
|
|
60
60
|
* })
|
|
61
61
|
*/
|
|
62
|
-
getChatGroup(id: string, request?: Hume.empathicVoice.ChatGroupsGetChatGroupRequest, requestOptions?: ChatGroups.RequestOptions):
|
|
62
|
+
getChatGroup(id: string, request?: Hume.empathicVoice.ChatGroupsGetChatGroupRequest, requestOptions?: ChatGroups.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatGroupPagedChats>;
|
|
63
|
+
private __getChatGroup;
|
|
63
64
|
/**
|
|
64
65
|
* Fetches a paginated list of **Chat** events associated with a **Chat Group**.
|
|
65
66
|
*
|
|
@@ -93,7 +94,8 @@ export declare class ChatGroups {
|
|
|
93
94
|
* ascendingOrder: true
|
|
94
95
|
* })
|
|
95
96
|
*/
|
|
96
|
-
getAudio(id: string, request?: Hume.empathicVoice.ChatGroupsGetAudioRequest, requestOptions?: ChatGroups.RequestOptions):
|
|
97
|
+
getAudio(id: string, request?: Hume.empathicVoice.ChatGroupsGetAudioRequest, requestOptions?: ChatGroups.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatGroupPagedAudioReconstructions>;
|
|
98
|
+
private __getAudio;
|
|
97
99
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
98
100
|
"X-Hume-Api-Key": string | undefined;
|
|
99
101
|
}>;
|
|
@@ -77,7 +77,7 @@ class ChatGroups {
|
|
|
77
77
|
*/
|
|
78
78
|
listChatGroups() {
|
|
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, ascendingOrder, configId } = request;
|
|
83
83
|
const _queryParams = {};
|
|
@@ -96,7 +96,7 @@ class ChatGroups {
|
|
|
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/chat_groups"),
|
|
98
98
|
method: "GET",
|
|
99
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.
|
|
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 ChatGroups {
|
|
|
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.ReturnPagedChatGroups.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 ChatGroups {
|
|
|
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 ChatGroups {
|
|
|
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/chat_groups.");
|
|
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
|
-
});
|
|
150
|
+
}));
|
|
145
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.chatGroupsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
149
157
|
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.chatGroupsPage) !== null && _a !== void 0 ? _a : []; },
|
|
150
158
|
loadPage: (_response) => {
|
|
@@ -170,7 +178,10 @@ class ChatGroups {
|
|
|
170
178
|
* ascendingOrder: true
|
|
171
179
|
* })
|
|
172
180
|
*/
|
|
173
|
-
getChatGroup(
|
|
181
|
+
getChatGroup(id, request = {}, requestOptions) {
|
|
182
|
+
return core.HttpResponsePromise.fromPromise(this.__getChatGroup(id, request, requestOptions));
|
|
183
|
+
}
|
|
184
|
+
__getChatGroup(id_1) {
|
|
174
185
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
175
186
|
var _a, _b, _c;
|
|
176
187
|
const { pageSize, pageNumber, ascendingOrder } = request;
|
|
@@ -187,7 +198,7 @@ class ChatGroups {
|
|
|
187
198
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
188
199
|
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/chat_groups/${encodeURIComponent(id)}`),
|
|
189
200
|
method: "GET",
|
|
190
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.
|
|
201
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.2", "User-Agent": "hume/0.11.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
191
202
|
contentType: "application/json",
|
|
192
203
|
queryParameters: _queryParams,
|
|
193
204
|
requestType: "json",
|
|
@@ -196,12 +207,15 @@ class ChatGroups {
|
|
|
196
207
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
197
208
|
});
|
|
198
209
|
if (_response.ok) {
|
|
199
|
-
return
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
210
|
+
return {
|
|
211
|
+
data: serializers.empathicVoice.ReturnChatGroupPagedChats.parseOrThrow(_response.body, {
|
|
212
|
+
unrecognizedObjectKeys: "passthrough",
|
|
213
|
+
allowUnrecognizedUnionMembers: true,
|
|
214
|
+
allowUnrecognizedEnumValues: true,
|
|
215
|
+
breadcrumbsPrefix: ["response"],
|
|
216
|
+
}),
|
|
217
|
+
rawResponse: _response.rawResponse,
|
|
218
|
+
};
|
|
205
219
|
}
|
|
206
220
|
if (_response.error.reason === "status-code") {
|
|
207
221
|
switch (_response.error.statusCode) {
|
|
@@ -211,11 +225,12 @@ class ChatGroups {
|
|
|
211
225
|
allowUnrecognizedUnionMembers: true,
|
|
212
226
|
allowUnrecognizedEnumValues: true,
|
|
213
227
|
breadcrumbsPrefix: ["response"],
|
|
214
|
-
}));
|
|
228
|
+
}), _response.rawResponse);
|
|
215
229
|
default:
|
|
216
230
|
throw new errors.HumeError({
|
|
217
231
|
statusCode: _response.error.statusCode,
|
|
218
232
|
body: _response.error.body,
|
|
233
|
+
rawResponse: _response.rawResponse,
|
|
219
234
|
});
|
|
220
235
|
}
|
|
221
236
|
}
|
|
@@ -224,12 +239,14 @@ class ChatGroups {
|
|
|
224
239
|
throw new errors.HumeError({
|
|
225
240
|
statusCode: _response.error.statusCode,
|
|
226
241
|
body: _response.error.rawBody,
|
|
242
|
+
rawResponse: _response.rawResponse,
|
|
227
243
|
});
|
|
228
244
|
case "timeout":
|
|
229
245
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}.");
|
|
230
246
|
case "unknown":
|
|
231
247
|
throw new errors.HumeError({
|
|
232
248
|
message: _response.error.errorMessage,
|
|
249
|
+
rawResponse: _response.rawResponse,
|
|
233
250
|
});
|
|
234
251
|
}
|
|
235
252
|
});
|
|
@@ -252,7 +269,7 @@ class ChatGroups {
|
|
|
252
269
|
*/
|
|
253
270
|
listChatGroupEvents(id_1) {
|
|
254
271
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
255
|
-
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
272
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
256
273
|
var _a, _b, _c;
|
|
257
274
|
const { pageSize, pageNumber, ascendingOrder } = request;
|
|
258
275
|
const _queryParams = {};
|
|
@@ -268,7 +285,7 @@ class ChatGroups {
|
|
|
268
285
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
269
286
|
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/chat_groups/${encodeURIComponent(id)}/events`),
|
|
270
287
|
method: "GET",
|
|
271
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.
|
|
288
|
+
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),
|
|
272
289
|
contentType: "application/json",
|
|
273
290
|
queryParameters: _queryParams,
|
|
274
291
|
requestType: "json",
|
|
@@ -277,12 +294,15 @@ class ChatGroups {
|
|
|
277
294
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
278
295
|
});
|
|
279
296
|
if (_response.ok) {
|
|
280
|
-
return
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
297
|
+
return {
|
|
298
|
+
data: serializers.empathicVoice.ReturnChatGroupPagedEvents.parseOrThrow(_response.body, {
|
|
299
|
+
unrecognizedObjectKeys: "passthrough",
|
|
300
|
+
allowUnrecognizedUnionMembers: true,
|
|
301
|
+
allowUnrecognizedEnumValues: true,
|
|
302
|
+
breadcrumbsPrefix: ["response"],
|
|
303
|
+
}),
|
|
304
|
+
rawResponse: _response.rawResponse,
|
|
305
|
+
};
|
|
286
306
|
}
|
|
287
307
|
if (_response.error.reason === "status-code") {
|
|
288
308
|
switch (_response.error.statusCode) {
|
|
@@ -292,11 +312,12 @@ class ChatGroups {
|
|
|
292
312
|
allowUnrecognizedUnionMembers: true,
|
|
293
313
|
allowUnrecognizedEnumValues: true,
|
|
294
314
|
breadcrumbsPrefix: ["response"],
|
|
295
|
-
}));
|
|
315
|
+
}), _response.rawResponse);
|
|
296
316
|
default:
|
|
297
317
|
throw new errors.HumeError({
|
|
298
318
|
statusCode: _response.error.statusCode,
|
|
299
319
|
body: _response.error.body,
|
|
320
|
+
rawResponse: _response.rawResponse,
|
|
300
321
|
});
|
|
301
322
|
}
|
|
302
323
|
}
|
|
@@ -305,18 +326,22 @@ class ChatGroups {
|
|
|
305
326
|
throw new errors.HumeError({
|
|
306
327
|
statusCode: _response.error.statusCode,
|
|
307
328
|
body: _response.error.rawBody,
|
|
329
|
+
rawResponse: _response.rawResponse,
|
|
308
330
|
});
|
|
309
331
|
case "timeout":
|
|
310
332
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/events.");
|
|
311
333
|
case "unknown":
|
|
312
334
|
throw new errors.HumeError({
|
|
313
335
|
message: _response.error.errorMessage,
|
|
336
|
+
rawResponse: _response.rawResponse,
|
|
314
337
|
});
|
|
315
338
|
}
|
|
316
|
-
});
|
|
339
|
+
}));
|
|
317
340
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
341
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
318
342
|
return new core.Pageable({
|
|
319
|
-
response:
|
|
343
|
+
response: dataWithRawResponse.data,
|
|
344
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
320
345
|
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
321
346
|
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []; },
|
|
322
347
|
loadPage: (_response) => {
|
|
@@ -342,7 +367,10 @@ class ChatGroups {
|
|
|
342
367
|
* ascendingOrder: true
|
|
343
368
|
* })
|
|
344
369
|
*/
|
|
345
|
-
getAudio(
|
|
370
|
+
getAudio(id, request = {}, requestOptions) {
|
|
371
|
+
return core.HttpResponsePromise.fromPromise(this.__getAudio(id, request, requestOptions));
|
|
372
|
+
}
|
|
373
|
+
__getAudio(id_1) {
|
|
346
374
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
347
375
|
var _a, _b, _c;
|
|
348
376
|
const { pageNumber, pageSize, ascendingOrder } = request;
|
|
@@ -359,7 +387,7 @@ class ChatGroups {
|
|
|
359
387
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
360
388
|
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/chat_groups/${encodeURIComponent(id)}/audio`),
|
|
361
389
|
method: "GET",
|
|
362
|
-
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.
|
|
390
|
+
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),
|
|
363
391
|
contentType: "application/json",
|
|
364
392
|
queryParameters: _queryParams,
|
|
365
393
|
requestType: "json",
|
|
@@ -368,12 +396,15 @@ class ChatGroups {
|
|
|
368
396
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
369
397
|
});
|
|
370
398
|
if (_response.ok) {
|
|
371
|
-
return
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
399
|
+
return {
|
|
400
|
+
data: serializers.empathicVoice.ReturnChatGroupPagedAudioReconstructions.parseOrThrow(_response.body, {
|
|
401
|
+
unrecognizedObjectKeys: "passthrough",
|
|
402
|
+
allowUnrecognizedUnionMembers: true,
|
|
403
|
+
allowUnrecognizedEnumValues: true,
|
|
404
|
+
breadcrumbsPrefix: ["response"],
|
|
405
|
+
}),
|
|
406
|
+
rawResponse: _response.rawResponse,
|
|
407
|
+
};
|
|
377
408
|
}
|
|
378
409
|
if (_response.error.reason === "status-code") {
|
|
379
410
|
switch (_response.error.statusCode) {
|
|
@@ -383,11 +414,12 @@ class ChatGroups {
|
|
|
383
414
|
allowUnrecognizedUnionMembers: true,
|
|
384
415
|
allowUnrecognizedEnumValues: true,
|
|
385
416
|
breadcrumbsPrefix: ["response"],
|
|
386
|
-
}));
|
|
417
|
+
}), _response.rawResponse);
|
|
387
418
|
default:
|
|
388
419
|
throw new errors.HumeError({
|
|
389
420
|
statusCode: _response.error.statusCode,
|
|
390
421
|
body: _response.error.body,
|
|
422
|
+
rawResponse: _response.rawResponse,
|
|
391
423
|
});
|
|
392
424
|
}
|
|
393
425
|
}
|
|
@@ -396,12 +428,14 @@ class ChatGroups {
|
|
|
396
428
|
throw new errors.HumeError({
|
|
397
429
|
statusCode: _response.error.statusCode,
|
|
398
430
|
body: _response.error.rawBody,
|
|
431
|
+
rawResponse: _response.rawResponse,
|
|
399
432
|
});
|
|
400
433
|
case "timeout":
|
|
401
434
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/audio.");
|
|
402
435
|
case "unknown":
|
|
403
436
|
throw new errors.HumeError({
|
|
404
437
|
message: _response.error.errorMessage,
|
|
438
|
+
rawResponse: _response.rawResponse,
|
|
405
439
|
});
|
|
406
440
|
}
|
|
407
441
|
});
|
|
@@ -70,7 +70,8 @@ export declare class Chats {
|
|
|
70
70
|
* @example
|
|
71
71
|
* await client.empathicVoice.chats.getAudio("470a49f6-1dec-4afe-8b61-035d3b2d63b0")
|
|
72
72
|
*/
|
|
73
|
-
getAudio(id: string, requestOptions?: Chats.RequestOptions):
|
|
73
|
+
getAudio(id: string, requestOptions?: Chats.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatAudioReconstruction>;
|
|
74
|
+
private __getAudio;
|
|
74
75
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
75
76
|
"X-Hume-Api-Key": string | undefined;
|
|
76
77
|
}>;
|