hume 0.11.1 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/.mock/definition/empathic-voice/__package__.yml +24 -0
  2. package/.mock/definition/empathic-voice/configs.yml +2 -0
  3. package/.mock/definition/tts/__package__.yml +28 -0
  4. package/.mock/fern.config.json +1 -1
  5. package/Client.d.ts +11 -7
  6. package/Client.js +54 -6
  7. package/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
  8. package/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
  9. package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +7 -3
  10. package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +79 -52
  11. package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +5 -2
  12. package/api/resources/empathicVoice/resources/chats/client/Client.js +59 -39
  13. package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +17 -8
  14. package/api/resources/empathicVoice/resources/configs/client/Client.js +144 -83
  15. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
  16. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
  17. package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +13 -6
  18. package/api/resources/empathicVoice/resources/customVoices/client/Client.js +95 -53
  19. package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +19 -9
  20. package/api/resources/empathicVoice/resources/prompts/client/Client.js +143 -81
  21. package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +17 -8
  22. package/api/resources/empathicVoice/resources/tools/client/Client.js +144 -83
  23. package/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
  24. package/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
  25. package/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
  26. package/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
  27. package/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
  28. package/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
  29. package/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  30. package/api/resources/empathicVoice/types/index.d.ts +2 -0
  31. package/api/resources/empathicVoice/types/index.js +2 -0
  32. package/api/resources/expressionMeasurement/client/Client.d.ts +2 -0
  33. package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +15 -7
  34. package/api/resources/expressionMeasurement/resources/batch/client/Client.js +96 -52
  35. package/api/resources/tts/client/Client.d.ts +27 -19
  36. package/api/resources/tts/client/Client.js +89 -50
  37. package/api/resources/tts/client/index.d.ts +1 -1
  38. package/api/resources/tts/client/index.js +15 -0
  39. package/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
  40. package/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
  41. package/api/resources/tts/client/requests/index.d.ts +1 -0
  42. package/api/resources/tts/client/requests/index.js +2 -0
  43. package/api/resources/tts/errors/BadRequestError.d.ts +2 -1
  44. package/api/resources/tts/errors/BadRequestError.js +2 -1
  45. package/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
  46. package/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
  47. package/api/resources/tts/resources/voices/client/Client.d.ts +7 -3
  48. package/api/resources/tts/resources/voices/client/Client.js +49 -29
  49. package/api/resources/tts/types/Snippet.d.ts +2 -0
  50. package/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
  51. package/core/fetcher/APIResponse.d.ts +10 -0
  52. package/core/fetcher/Fetcher.d.ts +2 -1
  53. package/core/fetcher/Fetcher.js +29 -9
  54. package/core/fetcher/Headers.d.ts +2 -0
  55. package/core/fetcher/Headers.js +84 -0
  56. package/core/fetcher/HttpResponsePromise.d.ts +58 -0
  57. package/core/fetcher/HttpResponsePromise.js +103 -0
  58. package/core/fetcher/RawResponse.d.ts +29 -0
  59. package/core/fetcher/RawResponse.js +44 -0
  60. package/core/fetcher/index.d.ts +3 -0
  61. package/core/fetcher/index.js +7 -1
  62. package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  63. package/core/form-data-utils/FormDataWrapper.js +53 -13
  64. package/core/form-data-utils/toReadableStream.d.ts +1 -0
  65. package/core/form-data-utils/toReadableStream.js +50 -0
  66. package/core/headers.d.ts +3 -0
  67. package/core/headers.js +29 -0
  68. package/core/index.d.ts +4 -4
  69. package/core/index.js +5 -4
  70. package/core/pagination/Page.d.ts +5 -2
  71. package/core/pagination/Page.js +5 -2
  72. package/core/pagination/Pageable.d.ts +2 -0
  73. package/core/runtime/runtime.js +0 -1
  74. package/dist/Client.d.ts +11 -7
  75. package/dist/Client.js +54 -6
  76. package/dist/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
  77. package/dist/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
  78. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +7 -3
  79. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +79 -52
  80. package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +5 -2
  81. package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +59 -39
  82. package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +17 -8
  83. package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +144 -83
  84. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
  85. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
  86. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +13 -6
  87. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +95 -53
  88. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +19 -9
  89. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +143 -81
  90. package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +17 -8
  91. package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +144 -83
  92. package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
  93. package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
  94. package/dist/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
  95. package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
  96. package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
  97. package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
  98. package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  99. package/dist/api/resources/empathicVoice/types/index.d.ts +2 -0
  100. package/dist/api/resources/empathicVoice/types/index.js +2 -0
  101. package/dist/api/resources/expressionMeasurement/client/Client.d.ts +2 -0
  102. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +15 -7
  103. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +96 -52
  104. package/dist/api/resources/tts/client/Client.d.ts +27 -19
  105. package/dist/api/resources/tts/client/Client.js +89 -50
  106. package/dist/api/resources/tts/client/index.d.ts +1 -1
  107. package/dist/api/resources/tts/client/index.js +15 -0
  108. package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
  109. package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
  110. package/dist/api/resources/tts/client/requests/index.d.ts +1 -0
  111. package/dist/api/resources/tts/client/requests/index.js +2 -0
  112. package/dist/api/resources/tts/errors/BadRequestError.d.ts +2 -1
  113. package/dist/api/resources/tts/errors/BadRequestError.js +2 -1
  114. package/dist/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
  115. package/dist/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
  116. package/dist/api/resources/tts/resources/voices/client/Client.d.ts +7 -3
  117. package/dist/api/resources/tts/resources/voices/client/Client.js +49 -29
  118. package/dist/api/resources/tts/types/Snippet.d.ts +2 -0
  119. package/dist/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
  120. package/dist/core/fetcher/APIResponse.d.ts +10 -0
  121. package/dist/core/fetcher/Fetcher.d.ts +2 -1
  122. package/dist/core/fetcher/Fetcher.js +29 -9
  123. package/dist/core/fetcher/Headers.d.ts +2 -0
  124. package/dist/core/fetcher/Headers.js +84 -0
  125. package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
  126. package/dist/core/fetcher/HttpResponsePromise.js +103 -0
  127. package/dist/core/fetcher/RawResponse.d.ts +29 -0
  128. package/dist/core/fetcher/RawResponse.js +44 -0
  129. package/dist/core/fetcher/index.d.ts +3 -0
  130. package/dist/core/fetcher/index.js +7 -1
  131. package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  132. package/dist/core/form-data-utils/FormDataWrapper.js +53 -13
  133. package/dist/core/form-data-utils/toReadableStream.d.ts +1 -0
  134. package/dist/core/form-data-utils/toReadableStream.js +50 -0
  135. package/dist/core/headers.d.ts +3 -0
  136. package/dist/core/headers.js +29 -0
  137. package/dist/core/index.d.ts +4 -4
  138. package/dist/core/index.js +5 -4
  139. package/dist/core/pagination/Page.d.ts +5 -2
  140. package/dist/core/pagination/Page.js +5 -2
  141. package/dist/core/pagination/Pageable.d.ts +2 -0
  142. package/dist/core/runtime/runtime.js +0 -1
  143. package/dist/errors/HumeError.d.ts +7 -2
  144. package/dist/errors/HumeError.js +10 -10
  145. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
  146. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
  147. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
  148. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
  149. package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
  150. package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
  151. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
  152. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
  153. package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
  154. package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
  155. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
  156. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  157. package/dist/serialization/resources/empathicVoice/types/index.d.ts +2 -0
  158. package/dist/serialization/resources/empathicVoice/types/index.js +2 -0
  159. package/dist/serialization/resources/tts/types/Snippet.d.ts +1 -0
  160. package/dist/serialization/resources/tts/types/Snippet.js +1 -0
  161. package/dist/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
  162. package/dist/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
  163. package/dist/version.d.ts +1 -1
  164. package/dist/version.js +1 -1
  165. package/dist/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
  166. package/dist/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
  167. package/dist/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
  168. package/errors/HumeError.d.ts +7 -2
  169. package/errors/HumeError.js +10 -10
  170. package/package.json +9 -4
  171. package/reference.md +17 -15
  172. package/scripts/rename-to-esm-files.js +10 -2
  173. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
  174. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
  175. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
  176. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
  177. package/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
  178. package/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
  179. package/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
  180. package/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
  181. package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
  182. package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
  183. package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
  184. package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  185. package/serialization/resources/empathicVoice/types/index.d.ts +2 -0
  186. package/serialization/resources/empathicVoice/types/index.js +2 -0
  187. package/serialization/resources/tts/types/Snippet.d.ts +1 -0
  188. package/serialization/resources/tts/types/Snippet.js +1 -0
  189. package/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
  190. package/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
  191. package/version.d.ts +1 -1
  192. package/version.js +1 -1
  193. package/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
  194. package/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
  195. package/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
  196. /package/core/{streaming-fetcher → stream}/Stream.d.ts +0 -0
  197. /package/core/{streaming-fetcher → stream}/Stream.js +0 -0
  198. /package/core/{streaming-fetcher → stream}/index.d.ts +0 -0
  199. /package/core/{streaming-fetcher → stream}/index.js +0 -0
  200. /package/dist/core/{streaming-fetcher → stream}/Stream.d.ts +0 -0
  201. /package/dist/core/{streaming-fetcher → stream}/Stream.js +0 -0
  202. /package/dist/core/{streaming-fetcher → stream}/index.d.ts +0 -0
  203. /package/dist/core/{streaming-fetcher → stream}/index.js +0 -0
@@ -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: >-
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "organization" : "hume",
3
- "version" : "0.63.26"
3
+ "version" : "0.64.10"
4
4
  }
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 Client_1 = require("./api/resources/expressionMeasurement/client/Client");
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/tts/client/Client");
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 expressionMeasurement() {
60
+ get tts() {
13
61
  var _a;
14
- return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new Client_1.ExpressionMeasurement(this._options)));
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 tts() {
68
+ get expressionMeasurement() {
21
69
  var _a;
22
- return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new Client_3.Tts(this._options)));
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
  }
@@ -10,6 +10,8 @@ export declare namespace ChatGroups {
10
10
  /** Specify a custom URL to connect the client to. */
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<string | undefined>;
13
+ /** Additional headers to include in requests. */
14
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
13
15
  fetcher?: core.FetchFunction;
14
16
  }
15
17
  interface RequestOptions {
@@ -20,7 +22,7 @@ export declare namespace ChatGroups {
20
22
  /** A hook to abort the request. */
21
23
  abortSignal?: AbortSignal;
22
24
  /** Additional headers to include in the request. */
23
- headers?: Record<string, string>;
25
+ headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
24
26
  }
25
27
  }
26
28
  export declare class ChatGroups {
@@ -59,7 +61,8 @@ export declare class ChatGroups {
59
61
  * ascendingOrder: true
60
62
  * })
61
63
  */
62
- getChatGroup(id: string, request?: Hume.empathicVoice.ChatGroupsGetChatGroupRequest, requestOptions?: ChatGroups.RequestOptions): Promise<Hume.empathicVoice.ReturnChatGroupPagedChats>;
64
+ getChatGroup(id: string, request?: Hume.empathicVoice.ChatGroupsGetChatGroupRequest, requestOptions?: ChatGroups.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatGroupPagedChats>;
65
+ private __getChatGroup;
63
66
  /**
64
67
  * Fetches a paginated list of **Chat** events associated with a **Chat Group**.
65
68
  *
@@ -93,7 +96,8 @@ export declare class ChatGroups {
93
96
  * ascendingOrder: true
94
97
  * })
95
98
  */
96
- getAudio(id: string, request?: Hume.empathicVoice.ChatGroupsGetAudioRequest, requestOptions?: ChatGroups.RequestOptions): Promise<Hume.empathicVoice.ReturnChatGroupPagedAudioReconstructions>;
99
+ getAudio(id: string, request?: Hume.empathicVoice.ChatGroupsGetAudioRequest, requestOptions?: ChatGroups.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatGroupPagedAudioReconstructions>;
100
+ private __getAudio;
97
101
  protected _getCustomAuthorizationHeaders(): Promise<{
98
102
  "X-Hume-Api-Key": string | undefined;
99
103
  }>;
@@ -52,6 +52,7 @@ exports.ChatGroups = void 0;
52
52
  const environments = __importStar(require("../../../../../../environments"));
53
53
  const core = __importStar(require("../../../../../../core"));
54
54
  const Hume = __importStar(require("../../../../../index"));
55
+ const headers_js_1 = require("../../../../../../core/headers.js");
55
56
  const url_join_1 = __importDefault(require("url-join"));
56
57
  const serializers = __importStar(require("../../../../../../serialization/index"));
57
58
  const errors = __importStar(require("../../../../../../errors/index"));
@@ -77,8 +78,8 @@ class ChatGroups {
77
78
  */
78
79
  listChatGroups() {
79
80
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
80
- const list = (request) => __awaiter(this, void 0, void 0, function* () {
81
- var _a, _b, _c;
81
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
82
+ var _a, _b, _c, _d;
82
83
  const { pageNumber, pageSize, ascendingOrder, configId } = request;
83
84
  const _queryParams = {};
84
85
  if (pageNumber != null) {
@@ -96,21 +97,22 @@ class ChatGroups {
96
97
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
97
98
  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
99
  method: "GET",
99
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.1", "User-Agent": "hume/0.11.1", "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
- contentType: "application/json",
100
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
101
101
  queryParameters: _queryParams,
102
- requestType: "json",
103
102
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
104
103
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
105
104
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
106
105
  });
107
106
  if (_response.ok) {
108
- return serializers.empathicVoice.ReturnPagedChatGroups.parseOrThrow(_response.body, {
109
- unrecognizedObjectKeys: "passthrough",
110
- allowUnrecognizedUnionMembers: true,
111
- allowUnrecognizedEnumValues: true,
112
- breadcrumbsPrefix: ["response"],
113
- });
107
+ return {
108
+ data: serializers.empathicVoice.ReturnPagedChatGroups.parseOrThrow(_response.body, {
109
+ unrecognizedObjectKeys: "passthrough",
110
+ allowUnrecognizedUnionMembers: true,
111
+ allowUnrecognizedEnumValues: true,
112
+ breadcrumbsPrefix: ["response"],
113
+ }),
114
+ rawResponse: _response.rawResponse,
115
+ };
114
116
  }
115
117
  if (_response.error.reason === "status-code") {
116
118
  switch (_response.error.statusCode) {
@@ -120,11 +122,12 @@ class ChatGroups {
120
122
  allowUnrecognizedUnionMembers: true,
121
123
  allowUnrecognizedEnumValues: true,
122
124
  breadcrumbsPrefix: ["response"],
123
- }));
125
+ }), _response.rawResponse);
124
126
  default:
125
127
  throw new errors.HumeError({
126
128
  statusCode: _response.error.statusCode,
127
129
  body: _response.error.body,
130
+ rawResponse: _response.rawResponse,
128
131
  });
129
132
  }
130
133
  }
@@ -133,18 +136,22 @@ class ChatGroups {
133
136
  throw new errors.HumeError({
134
137
  statusCode: _response.error.statusCode,
135
138
  body: _response.error.rawBody,
139
+ rawResponse: _response.rawResponse,
136
140
  });
137
141
  case "timeout":
138
142
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups.");
139
143
  case "unknown":
140
144
  throw new errors.HumeError({
141
145
  message: _response.error.errorMessage,
146
+ rawResponse: _response.rawResponse,
142
147
  });
143
148
  }
144
- });
149
+ }));
145
150
  let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
151
+ const dataWithRawResponse = yield list(request).withRawResponse();
146
152
  return new core.Pageable({
147
- response: yield list(request),
153
+ response: dataWithRawResponse.data,
154
+ rawResponse: dataWithRawResponse.rawResponse,
148
155
  hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.chatGroupsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
149
156
  getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.chatGroupsPage) !== null && _a !== void 0 ? _a : []; },
150
157
  loadPage: (_response) => {
@@ -170,9 +177,12 @@ class ChatGroups {
170
177
  * ascendingOrder: true
171
178
  * })
172
179
  */
173
- getChatGroup(id_1) {
180
+ getChatGroup(id, request = {}, requestOptions) {
181
+ return core.HttpResponsePromise.fromPromise(this.__getChatGroup(id, request, requestOptions));
182
+ }
183
+ __getChatGroup(id_1) {
174
184
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
175
- var _a, _b, _c;
185
+ var _a, _b, _c, _d;
176
186
  const { pageSize, pageNumber, ascendingOrder } = request;
177
187
  const _queryParams = {};
178
188
  if (pageSize != null) {
@@ -187,21 +197,22 @@ class ChatGroups {
187
197
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
188
198
  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
199
  method: "GET",
190
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.1", "User-Agent": "hume/0.11.1", "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
- contentType: "application/json",
200
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
192
201
  queryParameters: _queryParams,
193
- requestType: "json",
194
202
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
195
203
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
196
204
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
197
205
  });
198
206
  if (_response.ok) {
199
- return serializers.empathicVoice.ReturnChatGroupPagedChats.parseOrThrow(_response.body, {
200
- unrecognizedObjectKeys: "passthrough",
201
- allowUnrecognizedUnionMembers: true,
202
- allowUnrecognizedEnumValues: true,
203
- breadcrumbsPrefix: ["response"],
204
- });
207
+ return {
208
+ data: serializers.empathicVoice.ReturnChatGroupPagedChats.parseOrThrow(_response.body, {
209
+ unrecognizedObjectKeys: "passthrough",
210
+ allowUnrecognizedUnionMembers: true,
211
+ allowUnrecognizedEnumValues: true,
212
+ breadcrumbsPrefix: ["response"],
213
+ }),
214
+ rawResponse: _response.rawResponse,
215
+ };
205
216
  }
206
217
  if (_response.error.reason === "status-code") {
207
218
  switch (_response.error.statusCode) {
@@ -211,11 +222,12 @@ class ChatGroups {
211
222
  allowUnrecognizedUnionMembers: true,
212
223
  allowUnrecognizedEnumValues: true,
213
224
  breadcrumbsPrefix: ["response"],
214
- }));
225
+ }), _response.rawResponse);
215
226
  default:
216
227
  throw new errors.HumeError({
217
228
  statusCode: _response.error.statusCode,
218
229
  body: _response.error.body,
230
+ rawResponse: _response.rawResponse,
219
231
  });
220
232
  }
221
233
  }
@@ -224,12 +236,14 @@ class ChatGroups {
224
236
  throw new errors.HumeError({
225
237
  statusCode: _response.error.statusCode,
226
238
  body: _response.error.rawBody,
239
+ rawResponse: _response.rawResponse,
227
240
  });
228
241
  case "timeout":
229
242
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}.");
230
243
  case "unknown":
231
244
  throw new errors.HumeError({
232
245
  message: _response.error.errorMessage,
246
+ rawResponse: _response.rawResponse,
233
247
  });
234
248
  }
235
249
  });
@@ -252,8 +266,8 @@ class ChatGroups {
252
266
  */
253
267
  listChatGroupEvents(id_1) {
254
268
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
255
- const list = (request) => __awaiter(this, void 0, void 0, function* () {
256
- var _a, _b, _c;
269
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
270
+ var _a, _b, _c, _d;
257
271
  const { pageSize, pageNumber, ascendingOrder } = request;
258
272
  const _queryParams = {};
259
273
  if (pageSize != null) {
@@ -268,21 +282,22 @@ class ChatGroups {
268
282
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
269
283
  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
284
  method: "GET",
271
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.1", "User-Agent": "hume/0.11.1", "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
- contentType: "application/json",
285
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
273
286
  queryParameters: _queryParams,
274
- requestType: "json",
275
287
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
276
288
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
277
289
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
278
290
  });
279
291
  if (_response.ok) {
280
- return serializers.empathicVoice.ReturnChatGroupPagedEvents.parseOrThrow(_response.body, {
281
- unrecognizedObjectKeys: "passthrough",
282
- allowUnrecognizedUnionMembers: true,
283
- allowUnrecognizedEnumValues: true,
284
- breadcrumbsPrefix: ["response"],
285
- });
292
+ return {
293
+ data: serializers.empathicVoice.ReturnChatGroupPagedEvents.parseOrThrow(_response.body, {
294
+ unrecognizedObjectKeys: "passthrough",
295
+ allowUnrecognizedUnionMembers: true,
296
+ allowUnrecognizedEnumValues: true,
297
+ breadcrumbsPrefix: ["response"],
298
+ }),
299
+ rawResponse: _response.rawResponse,
300
+ };
286
301
  }
287
302
  if (_response.error.reason === "status-code") {
288
303
  switch (_response.error.statusCode) {
@@ -292,11 +307,12 @@ class ChatGroups {
292
307
  allowUnrecognizedUnionMembers: true,
293
308
  allowUnrecognizedEnumValues: true,
294
309
  breadcrumbsPrefix: ["response"],
295
- }));
310
+ }), _response.rawResponse);
296
311
  default:
297
312
  throw new errors.HumeError({
298
313
  statusCode: _response.error.statusCode,
299
314
  body: _response.error.body,
315
+ rawResponse: _response.rawResponse,
300
316
  });
301
317
  }
302
318
  }
@@ -305,18 +321,22 @@ class ChatGroups {
305
321
  throw new errors.HumeError({
306
322
  statusCode: _response.error.statusCode,
307
323
  body: _response.error.rawBody,
324
+ rawResponse: _response.rawResponse,
308
325
  });
309
326
  case "timeout":
310
327
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/events.");
311
328
  case "unknown":
312
329
  throw new errors.HumeError({
313
330
  message: _response.error.errorMessage,
331
+ rawResponse: _response.rawResponse,
314
332
  });
315
333
  }
316
- });
334
+ }));
317
335
  let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
336
+ const dataWithRawResponse = yield list(request).withRawResponse();
318
337
  return new core.Pageable({
319
- response: yield list(request),
338
+ response: dataWithRawResponse.data,
339
+ rawResponse: dataWithRawResponse.rawResponse,
320
340
  hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
321
341
  getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []; },
322
342
  loadPage: (_response) => {
@@ -342,9 +362,12 @@ class ChatGroups {
342
362
  * ascendingOrder: true
343
363
  * })
344
364
  */
345
- getAudio(id_1) {
365
+ getAudio(id, request = {}, requestOptions) {
366
+ return core.HttpResponsePromise.fromPromise(this.__getAudio(id, request, requestOptions));
367
+ }
368
+ __getAudio(id_1) {
346
369
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
347
- var _a, _b, _c;
370
+ var _a, _b, _c, _d;
348
371
  const { pageNumber, pageSize, ascendingOrder } = request;
349
372
  const _queryParams = {};
350
373
  if (pageNumber != null) {
@@ -359,21 +382,22 @@ class ChatGroups {
359
382
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
360
383
  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
384
  method: "GET",
362
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.1", "User-Agent": "hume/0.11.1", "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
- contentType: "application/json",
385
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
364
386
  queryParameters: _queryParams,
365
- requestType: "json",
366
387
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
367
388
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
368
389
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
369
390
  });
370
391
  if (_response.ok) {
371
- return serializers.empathicVoice.ReturnChatGroupPagedAudioReconstructions.parseOrThrow(_response.body, {
372
- unrecognizedObjectKeys: "passthrough",
373
- allowUnrecognizedUnionMembers: true,
374
- allowUnrecognizedEnumValues: true,
375
- breadcrumbsPrefix: ["response"],
376
- });
392
+ return {
393
+ data: serializers.empathicVoice.ReturnChatGroupPagedAudioReconstructions.parseOrThrow(_response.body, {
394
+ unrecognizedObjectKeys: "passthrough",
395
+ allowUnrecognizedUnionMembers: true,
396
+ allowUnrecognizedEnumValues: true,
397
+ breadcrumbsPrefix: ["response"],
398
+ }),
399
+ rawResponse: _response.rawResponse,
400
+ };
377
401
  }
378
402
  if (_response.error.reason === "status-code") {
379
403
  switch (_response.error.statusCode) {
@@ -383,11 +407,12 @@ class ChatGroups {
383
407
  allowUnrecognizedUnionMembers: true,
384
408
  allowUnrecognizedEnumValues: true,
385
409
  breadcrumbsPrefix: ["response"],
386
- }));
410
+ }), _response.rawResponse);
387
411
  default:
388
412
  throw new errors.HumeError({
389
413
  statusCode: _response.error.statusCode,
390
414
  body: _response.error.body,
415
+ rawResponse: _response.rawResponse,
391
416
  });
392
417
  }
393
418
  }
@@ -396,12 +421,14 @@ class ChatGroups {
396
421
  throw new errors.HumeError({
397
422
  statusCode: _response.error.statusCode,
398
423
  body: _response.error.rawBody,
424
+ rawResponse: _response.rawResponse,
399
425
  });
400
426
  case "timeout":
401
427
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/audio.");
402
428
  case "unknown":
403
429
  throw new errors.HumeError({
404
430
  message: _response.error.errorMessage,
431
+ rawResponse: _response.rawResponse,
405
432
  });
406
433
  }
407
434
  });