hume 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/.mock/definition/empathic-voice/__package__.yml +39 -36
  2. package/.mock/definition/empathic-voice/chat.yml +18 -3
  3. package/.mock/definition/empathic-voice/chatGroups.yml +14 -10
  4. package/.mock/definition/empathic-voice/chatWebhooks.yml +2 -0
  5. package/.mock/definition/empathic-voice/chats.yml +2 -0
  6. package/.mock/definition/empathic-voice/configs.yml +4 -0
  7. package/.mock/definition/empathic-voice/customVoices.yml +1 -0
  8. package/.mock/definition/empathic-voice/prompts.yml +2 -0
  9. package/.mock/definition/empathic-voice/tools.yml +2 -0
  10. package/.mock/definition/expression-measurement/batch/__package__.yml +10 -10
  11. package/.mock/definition/expression-measurement/stream/stream.yml +1 -1
  12. package/.mock/definition/tts/__package__.yml +98 -55
  13. package/.mock/definition/tts/voices.yml +20 -9
  14. package/.mock/fern.config.json +1 -1
  15. package/Client.d.ts +11 -7
  16. package/Client.js +54 -6
  17. package/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
  18. package/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
  19. package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +4 -2
  20. package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +76 -42
  21. package/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.ts +4 -4
  22. package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
  23. package/api/resources/empathicVoice/resources/chats/client/Client.js +57 -32
  24. package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
  25. package/api/resources/empathicVoice/resources/configs/client/Client.js +136 -66
  26. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
  27. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
  28. package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +10 -5
  29. package/api/resources/empathicVoice/resources/customVoices/client/Client.js +89 -42
  30. package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
  31. package/api/resources/empathicVoice/resources/prompts/client/Client.js +134 -63
  32. package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
  33. package/api/resources/empathicVoice/resources/tools/client/Client.js +136 -66
  34. package/api/resources/empathicVoice/types/AssistantInput.d.ts +1 -1
  35. package/api/resources/empathicVoice/types/AssistantMessage.d.ts +1 -1
  36. package/api/resources/empathicVoice/types/PauseAssistantMessage.d.ts +1 -1
  37. package/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
  38. package/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
  39. package/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
  40. package/api/resources/empathicVoice/types/ToolCallMessage.d.ts +1 -1
  41. package/api/resources/empathicVoice/types/ToolErrorMessage.d.ts +2 -2
  42. package/api/resources/empathicVoice/types/ToolResponseMessage.d.ts +3 -3
  43. package/api/resources/empathicVoice/types/UserInput.d.ts +1 -1
  44. package/api/resources/empathicVoice/types/UserMessage.d.ts +3 -3
  45. package/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
  46. package/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  47. package/api/resources/empathicVoice/types/index.d.ts +2 -4
  48. package/api/resources/empathicVoice/types/index.js +2 -4
  49. package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +12 -6
  50. package/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
  51. package/api/resources/tts/client/Client.d.ts +28 -22
  52. package/api/resources/tts/client/Client.js +88 -50
  53. package/api/resources/tts/client/index.d.ts +1 -1
  54. package/api/resources/tts/client/index.js +15 -0
  55. package/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
  56. package/api/resources/tts/client/requests/index.d.ts +1 -0
  57. package/api/resources/tts/client/requests/index.js +2 -0
  58. package/api/resources/tts/errors/BadRequestError.d.ts +2 -1
  59. package/api/resources/tts/errors/BadRequestError.js +2 -1
  60. package/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
  61. package/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
  62. package/api/resources/tts/resources/voices/client/Client.d.ts +9 -5
  63. package/api/resources/tts/resources/voices/client/Client.js +51 -26
  64. package/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.ts +4 -1
  65. package/api/resources/tts/types/PostedTts.d.ts +6 -6
  66. package/api/resources/tts/types/PostedUtterance.d.ts +5 -5
  67. package/api/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +6 -7
  68. package/api/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +6 -7
  69. package/api/resources/tts/types/ReturnGeneration.d.ts +1 -1
  70. package/api/resources/tts/types/ReturnTts.d.ts +1 -1
  71. package/api/resources/tts/types/ReturnVoice.d.ts +2 -8
  72. package/api/resources/tts/types/Snippet.d.ts +2 -0
  73. package/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
  74. package/core/fetcher/APIResponse.d.ts +10 -0
  75. package/core/fetcher/Fetcher.js +7 -0
  76. package/core/fetcher/Headers.d.ts +2 -0
  77. package/core/fetcher/Headers.js +84 -0
  78. package/core/fetcher/HttpResponsePromise.d.ts +58 -0
  79. package/core/fetcher/HttpResponsePromise.js +103 -0
  80. package/core/fetcher/RawResponse.d.ts +29 -0
  81. package/core/fetcher/RawResponse.js +44 -0
  82. package/core/fetcher/index.d.ts +3 -0
  83. package/core/fetcher/index.js +7 -1
  84. package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  85. package/core/form-data-utils/FormDataWrapper.js +48 -9
  86. package/core/pagination/Page.d.ts +5 -2
  87. package/core/pagination/Page.js +5 -2
  88. package/core/pagination/Pageable.d.ts +2 -0
  89. package/dist/Client.d.ts +11 -7
  90. package/dist/Client.js +54 -6
  91. package/dist/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
  92. package/dist/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
  93. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +4 -2
  94. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +76 -42
  95. package/dist/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.ts +4 -4
  96. package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
  97. package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +57 -32
  98. package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
  99. package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +136 -66
  100. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
  101. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
  102. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +10 -5
  103. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +89 -42
  104. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
  105. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +134 -63
  106. package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
  107. package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +136 -66
  108. package/dist/api/resources/empathicVoice/types/AssistantInput.d.ts +1 -1
  109. package/dist/api/resources/empathicVoice/types/AssistantMessage.d.ts +1 -1
  110. package/dist/api/resources/empathicVoice/types/PauseAssistantMessage.d.ts +1 -1
  111. package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
  112. package/dist/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
  113. package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
  114. package/dist/api/resources/empathicVoice/types/ToolCallMessage.d.ts +1 -1
  115. package/dist/api/resources/empathicVoice/types/ToolErrorMessage.d.ts +2 -2
  116. package/dist/api/resources/empathicVoice/types/ToolResponseMessage.d.ts +3 -3
  117. package/dist/api/resources/empathicVoice/types/UserInput.d.ts +1 -1
  118. package/dist/api/resources/empathicVoice/types/UserMessage.d.ts +3 -3
  119. package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
  120. package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  121. package/dist/api/resources/empathicVoice/types/index.d.ts +2 -4
  122. package/dist/api/resources/empathicVoice/types/index.js +2 -4
  123. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +12 -6
  124. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
  125. package/dist/api/resources/tts/client/Client.d.ts +28 -22
  126. package/dist/api/resources/tts/client/Client.js +88 -50
  127. package/dist/api/resources/tts/client/index.d.ts +1 -1
  128. package/dist/api/resources/tts/client/index.js +15 -0
  129. package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
  130. package/dist/api/resources/tts/client/requests/index.d.ts +1 -0
  131. package/dist/api/resources/tts/client/requests/index.js +2 -0
  132. package/dist/api/resources/tts/errors/BadRequestError.d.ts +2 -1
  133. package/dist/api/resources/tts/errors/BadRequestError.js +2 -1
  134. package/dist/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
  135. package/dist/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
  136. package/dist/api/resources/tts/resources/voices/client/Client.d.ts +9 -5
  137. package/dist/api/resources/tts/resources/voices/client/Client.js +51 -26
  138. package/dist/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.ts +4 -1
  139. package/dist/api/resources/tts/types/PostedTts.d.ts +6 -6
  140. package/dist/api/resources/tts/types/PostedUtterance.d.ts +5 -5
  141. package/dist/api/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +6 -7
  142. package/dist/api/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +6 -7
  143. package/dist/api/resources/tts/types/ReturnGeneration.d.ts +1 -1
  144. package/dist/api/resources/tts/types/ReturnTts.d.ts +1 -1
  145. package/dist/api/resources/tts/types/ReturnVoice.d.ts +2 -8
  146. package/dist/api/resources/tts/types/Snippet.d.ts +2 -0
  147. package/dist/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
  148. package/dist/core/fetcher/APIResponse.d.ts +10 -0
  149. package/dist/core/fetcher/Fetcher.js +7 -0
  150. package/dist/core/fetcher/Headers.d.ts +2 -0
  151. package/dist/core/fetcher/Headers.js +84 -0
  152. package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
  153. package/dist/core/fetcher/HttpResponsePromise.js +103 -0
  154. package/dist/core/fetcher/RawResponse.d.ts +29 -0
  155. package/dist/core/fetcher/RawResponse.js +44 -0
  156. package/dist/core/fetcher/index.d.ts +3 -0
  157. package/dist/core/fetcher/index.js +7 -1
  158. package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  159. package/dist/core/form-data-utils/FormDataWrapper.js +48 -9
  160. package/dist/core/pagination/Page.d.ts +5 -2
  161. package/dist/core/pagination/Page.js +5 -2
  162. package/dist/core/pagination/Pageable.d.ts +2 -0
  163. package/dist/errors/HumeError.d.ts +7 -2
  164. package/dist/errors/HumeError.js +10 -10
  165. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
  166. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
  167. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
  168. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
  169. package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
  170. package/dist/serialization/resources/empathicVoice/types/{TextInput.js → PostedNudgeSpec.js} +4 -3
  171. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
  172. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
  173. package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
  174. package/dist/serialization/resources/empathicVoice/types/{FunctionCallResponseInput.js → ReturnNudgeSpec.js} +4 -3
  175. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
  176. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  177. package/dist/serialization/resources/empathicVoice/types/index.d.ts +2 -4
  178. package/dist/serialization/resources/empathicVoice/types/index.js +2 -4
  179. package/dist/serialization/resources/tts/types/Snippet.d.ts +1 -0
  180. package/dist/serialization/resources/tts/types/Snippet.js +1 -0
  181. package/dist/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
  182. package/dist/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
  183. package/dist/version.d.ts +1 -1
  184. package/dist/version.js +1 -1
  185. package/dist/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
  186. package/dist/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
  187. package/dist/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
  188. package/errors/HumeError.d.ts +7 -2
  189. package/errors/HumeError.js +10 -10
  190. package/package.json +3 -2
  191. package/reference.md +26 -22
  192. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
  193. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
  194. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
  195. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
  196. package/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
  197. package/{dist/serialization/resources/empathicVoice/types/TtsInput.js → serialization/resources/empathicVoice/types/PostedNudgeSpec.js} +4 -3
  198. package/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
  199. package/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
  200. package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
  201. package/{dist/serialization/resources/empathicVoice/types/PostedPromptSpec.js → serialization/resources/empathicVoice/types/ReturnNudgeSpec.js} +4 -3
  202. package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
  203. package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  204. package/serialization/resources/empathicVoice/types/index.d.ts +2 -4
  205. package/serialization/resources/empathicVoice/types/index.js +2 -4
  206. package/serialization/resources/tts/types/Snippet.d.ts +1 -0
  207. package/serialization/resources/tts/types/Snippet.js +1 -0
  208. package/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
  209. package/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
  210. package/version.d.ts +1 -1
  211. package/version.js +1 -1
  212. package/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
  213. package/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
  214. package/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
  215. package/api/resources/empathicVoice/types/FunctionCallResponseInput.d.ts +0 -6
  216. package/api/resources/empathicVoice/types/PostedPromptSpec.d.ts +0 -9
  217. package/api/resources/empathicVoice/types/TextInput.d.ts +0 -6
  218. package/api/resources/empathicVoice/types/TtsInput.d.ts +0 -6
  219. package/dist/api/resources/empathicVoice/types/FunctionCallResponseInput.d.ts +0 -6
  220. package/dist/api/resources/empathicVoice/types/PostedPromptSpec.d.ts +0 -9
  221. package/dist/api/resources/empathicVoice/types/TextInput.d.ts +0 -6
  222. package/dist/api/resources/empathicVoice/types/TextInput.js +0 -5
  223. package/dist/api/resources/empathicVoice/types/TtsInput.d.ts +0 -6
  224. package/dist/api/resources/empathicVoice/types/TtsInput.js +0 -5
  225. package/dist/serialization/resources/empathicVoice/types/FunctionCallResponseInput.d.ts +0 -12
  226. package/dist/serialization/resources/empathicVoice/types/PostedPromptSpec.d.ts +0 -12
  227. package/dist/serialization/resources/empathicVoice/types/TextInput.d.ts +0 -12
  228. package/dist/serialization/resources/empathicVoice/types/TtsInput.d.ts +0 -12
  229. package/serialization/resources/empathicVoice/types/FunctionCallResponseInput.d.ts +0 -12
  230. package/serialization/resources/empathicVoice/types/FunctionCallResponseInput.js +0 -43
  231. package/serialization/resources/empathicVoice/types/PostedPromptSpec.d.ts +0 -12
  232. package/serialization/resources/empathicVoice/types/PostedPromptSpec.js +0 -43
  233. package/serialization/resources/empathicVoice/types/TextInput.d.ts +0 -12
  234. package/serialization/resources/empathicVoice/types/TextInput.js +0 -43
  235. package/serialization/resources/empathicVoice/types/TtsInput.d.ts +0 -12
  236. package/serialization/resources/empathicVoice/types/TtsInput.js +0 -43
  237. /package/api/resources/empathicVoice/types/{FunctionCallResponseInput.js → PostedNudgeSpec.js} +0 -0
  238. /package/api/resources/empathicVoice/types/{PostedPromptSpec.js → ReturnNudgeSpec.js} +0 -0
  239. /package/api/resources/{empathicVoice/types/TextInput.js → tts/client/requests/SynthesizeJsonRequest.js} +0 -0
  240. /package/{api/resources/empathicVoice/types/TtsInput.js → dist/api/resources/empathicVoice/types/PostedNudgeSpec.js} +0 -0
  241. /package/dist/api/resources/empathicVoice/types/{FunctionCallResponseInput.js → ReturnNudgeSpec.js} +0 -0
  242. /package/dist/api/resources/{empathicVoice/types/PostedPromptSpec.js → tts/client/requests/SynthesizeJsonRequest.js} +0 -0
@@ -77,7 +77,7 @@ class Prompts {
77
77
  */
78
78
  listPrompts() {
79
79
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
80
- const list = (request) => __awaiter(this, void 0, void 0, function* () {
80
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
81
81
  var _a, _b, _c;
82
82
  const { pageNumber, pageSize, restrictToMostRecent, name } = request;
83
83
  const _queryParams = {};
@@ -96,7 +96,7 @@ class Prompts {
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/prompts"),
98
98
  method: "GET",
99
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.3", "User-Agent": "hume/0.10.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
99
+ 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 Prompts {
105
105
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
106
106
  });
107
107
  if (_response.ok) {
108
- return serializers.empathicVoice.ReturnPagedPrompts.parseOrThrow(_response.body, {
109
- unrecognizedObjectKeys: "passthrough",
110
- allowUnrecognizedUnionMembers: true,
111
- allowUnrecognizedEnumValues: true,
112
- breadcrumbsPrefix: ["response"],
113
- });
108
+ return {
109
+ data: serializers.empathicVoice.ReturnPagedPrompts.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 Prompts {
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 Prompts {
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/prompts.");
139
144
  case "unknown":
140
145
  throw new errors.HumeError({
141
146
  message: _response.error.errorMessage,
147
+ rawResponse: _response.rawResponse,
142
148
  });
143
149
  }
144
- });
145
- let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 1;
150
+ }));
151
+ let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
152
+ const dataWithRawResponse = yield list(request).withRawResponse();
146
153
  return new core.Pageable({
147
- response: yield list(request),
154
+ response: dataWithRawResponse.data,
155
+ rawResponse: dataWithRawResponse.rawResponse,
148
156
  hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.promptsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
149
157
  getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.promptsPage) !== null && _a !== void 0 ? _a : []; },
150
158
  loadPage: (_response) => {
@@ -171,12 +179,15 @@ class Prompts {
171
179
  * })
172
180
  */
173
181
  createPrompt(request, requestOptions) {
182
+ return core.HttpResponsePromise.fromPromise(this.__createPrompt(request, requestOptions));
183
+ }
184
+ __createPrompt(request, requestOptions) {
174
185
  return __awaiter(this, void 0, void 0, function* () {
175
186
  var _a, _b, _c;
176
187
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
177
188
  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/prompts"),
178
189
  method: "POST",
179
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.3", "User-Agent": "hume/0.10.3", "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),
190
+ 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),
180
191
  contentType: "application/json",
181
192
  requestType: "json",
182
193
  body: serializers.empathicVoice.PostedPrompt.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -185,12 +196,15 @@ class Prompts {
185
196
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
186
197
  });
187
198
  if (_response.ok) {
188
- return serializers.empathicVoice.prompts.createPrompt.Response.parseOrThrow(_response.body, {
189
- unrecognizedObjectKeys: "passthrough",
190
- allowUnrecognizedUnionMembers: true,
191
- allowUnrecognizedEnumValues: true,
192
- breadcrumbsPrefix: ["response"],
193
- });
199
+ return {
200
+ data: serializers.empathicVoice.prompts.createPrompt.Response.parseOrThrow(_response.body, {
201
+ unrecognizedObjectKeys: "passthrough",
202
+ allowUnrecognizedUnionMembers: true,
203
+ allowUnrecognizedEnumValues: true,
204
+ breadcrumbsPrefix: ["response"],
205
+ }),
206
+ rawResponse: _response.rawResponse,
207
+ };
194
208
  }
195
209
  if (_response.error.reason === "status-code") {
196
210
  switch (_response.error.statusCode) {
@@ -200,11 +214,12 @@ class Prompts {
200
214
  allowUnrecognizedUnionMembers: true,
201
215
  allowUnrecognizedEnumValues: true,
202
216
  breadcrumbsPrefix: ["response"],
203
- }));
217
+ }), _response.rawResponse);
204
218
  default:
205
219
  throw new errors.HumeError({
206
220
  statusCode: _response.error.statusCode,
207
221
  body: _response.error.body,
222
+ rawResponse: _response.rawResponse,
208
223
  });
209
224
  }
210
225
  }
@@ -213,12 +228,14 @@ class Prompts {
213
228
  throw new errors.HumeError({
214
229
  statusCode: _response.error.statusCode,
215
230
  body: _response.error.rawBody,
231
+ rawResponse: _response.rawResponse,
216
232
  });
217
233
  case "timeout":
218
234
  throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/evi/prompts.");
219
235
  case "unknown":
220
236
  throw new errors.HumeError({
221
237
  message: _response.error.errorMessage,
238
+ rawResponse: _response.rawResponse,
222
239
  });
223
240
  }
224
241
  });
@@ -237,7 +254,10 @@ class Prompts {
237
254
  * @example
238
255
  * await client.empathicVoice.prompts.listPromptVersions("af699d45-2985-42cc-91b9-af9e5da3bac5")
239
256
  */
240
- listPromptVersions(id_1) {
257
+ listPromptVersions(id, request = {}, requestOptions) {
258
+ return core.HttpResponsePromise.fromPromise(this.__listPromptVersions(id, request, requestOptions));
259
+ }
260
+ __listPromptVersions(id_1) {
241
261
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
242
262
  var _a, _b, _c;
243
263
  const { pageNumber, pageSize, restrictToMostRecent } = request;
@@ -254,7 +274,7 @@ class Prompts {
254
274
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
255
275
  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/prompts/${encodeURIComponent(id)}`),
256
276
  method: "GET",
257
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.3", "User-Agent": "hume/0.10.3", "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),
277
+ 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),
258
278
  contentType: "application/json",
259
279
  queryParameters: _queryParams,
260
280
  requestType: "json",
@@ -263,12 +283,15 @@ class Prompts {
263
283
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
264
284
  });
265
285
  if (_response.ok) {
266
- return serializers.empathicVoice.ReturnPagedPrompts.parseOrThrow(_response.body, {
267
- unrecognizedObjectKeys: "passthrough",
268
- allowUnrecognizedUnionMembers: true,
269
- allowUnrecognizedEnumValues: true,
270
- breadcrumbsPrefix: ["response"],
271
- });
286
+ return {
287
+ data: serializers.empathicVoice.ReturnPagedPrompts.parseOrThrow(_response.body, {
288
+ unrecognizedObjectKeys: "passthrough",
289
+ allowUnrecognizedUnionMembers: true,
290
+ allowUnrecognizedEnumValues: true,
291
+ breadcrumbsPrefix: ["response"],
292
+ }),
293
+ rawResponse: _response.rawResponse,
294
+ };
272
295
  }
273
296
  if (_response.error.reason === "status-code") {
274
297
  switch (_response.error.statusCode) {
@@ -278,11 +301,12 @@ class Prompts {
278
301
  allowUnrecognizedUnionMembers: true,
279
302
  allowUnrecognizedEnumValues: true,
280
303
  breadcrumbsPrefix: ["response"],
281
- }));
304
+ }), _response.rawResponse);
282
305
  default:
283
306
  throw new errors.HumeError({
284
307
  statusCode: _response.error.statusCode,
285
308
  body: _response.error.body,
309
+ rawResponse: _response.rawResponse,
286
310
  });
287
311
  }
288
312
  }
@@ -291,12 +315,14 @@ class Prompts {
291
315
  throw new errors.HumeError({
292
316
  statusCode: _response.error.statusCode,
293
317
  body: _response.error.rawBody,
318
+ rawResponse: _response.rawResponse,
294
319
  });
295
320
  case "timeout":
296
321
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/prompts/{id}.");
297
322
  case "unknown":
298
323
  throw new errors.HumeError({
299
324
  message: _response.error.errorMessage,
325
+ rawResponse: _response.rawResponse,
300
326
  });
301
327
  }
302
328
  });
@@ -319,12 +345,15 @@ class Prompts {
319
345
  * })
320
346
  */
321
347
  createPromptVersion(id, request, requestOptions) {
348
+ return core.HttpResponsePromise.fromPromise(this.__createPromptVersion(id, request, requestOptions));
349
+ }
350
+ __createPromptVersion(id, request, requestOptions) {
322
351
  return __awaiter(this, void 0, void 0, function* () {
323
352
  var _a, _b, _c;
324
353
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
325
354
  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/prompts/${encodeURIComponent(id)}`),
326
355
  method: "POST",
327
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.3", "User-Agent": "hume/0.10.3", "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),
356
+ 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),
328
357
  contentType: "application/json",
329
358
  requestType: "json",
330
359
  body: serializers.empathicVoice.PostedPromptVersion.jsonOrThrow(request, {
@@ -335,12 +364,15 @@ class Prompts {
335
364
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
336
365
  });
337
366
  if (_response.ok) {
338
- return serializers.empathicVoice.prompts.createPromptVersion.Response.parseOrThrow(_response.body, {
339
- unrecognizedObjectKeys: "passthrough",
340
- allowUnrecognizedUnionMembers: true,
341
- allowUnrecognizedEnumValues: true,
342
- breadcrumbsPrefix: ["response"],
343
- });
367
+ return {
368
+ data: serializers.empathicVoice.prompts.createPromptVersion.Response.parseOrThrow(_response.body, {
369
+ unrecognizedObjectKeys: "passthrough",
370
+ allowUnrecognizedUnionMembers: true,
371
+ allowUnrecognizedEnumValues: true,
372
+ breadcrumbsPrefix: ["response"],
373
+ }),
374
+ rawResponse: _response.rawResponse,
375
+ };
344
376
  }
345
377
  if (_response.error.reason === "status-code") {
346
378
  switch (_response.error.statusCode) {
@@ -350,11 +382,12 @@ class Prompts {
350
382
  allowUnrecognizedUnionMembers: true,
351
383
  allowUnrecognizedEnumValues: true,
352
384
  breadcrumbsPrefix: ["response"],
353
- }));
385
+ }), _response.rawResponse);
354
386
  default:
355
387
  throw new errors.HumeError({
356
388
  statusCode: _response.error.statusCode,
357
389
  body: _response.error.body,
390
+ rawResponse: _response.rawResponse,
358
391
  });
359
392
  }
360
393
  }
@@ -363,12 +396,14 @@ class Prompts {
363
396
  throw new errors.HumeError({
364
397
  statusCode: _response.error.statusCode,
365
398
  body: _response.error.rawBody,
399
+ rawResponse: _response.rawResponse,
366
400
  });
367
401
  case "timeout":
368
402
  throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/evi/prompts/{id}.");
369
403
  case "unknown":
370
404
  throw new errors.HumeError({
371
405
  message: _response.error.errorMessage,
406
+ rawResponse: _response.rawResponse,
372
407
  });
373
408
  }
374
409
  });
@@ -387,12 +422,15 @@ class Prompts {
387
422
  * await client.empathicVoice.prompts.deletePrompt("af699d45-2985-42cc-91b9-af9e5da3bac5")
388
423
  */
389
424
  deletePrompt(id, requestOptions) {
425
+ return core.HttpResponsePromise.fromPromise(this.__deletePrompt(id, requestOptions));
426
+ }
427
+ __deletePrompt(id, requestOptions) {
390
428
  return __awaiter(this, void 0, void 0, function* () {
391
429
  var _a, _b, _c;
392
430
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
393
431
  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/prompts/${encodeURIComponent(id)}`),
394
432
  method: "DELETE",
395
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.3", "User-Agent": "hume/0.10.3", "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),
433
+ 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),
396
434
  contentType: "application/json",
397
435
  requestType: "json",
398
436
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -400,7 +438,7 @@ class Prompts {
400
438
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
401
439
  });
402
440
  if (_response.ok) {
403
- return;
441
+ return { data: undefined, rawResponse: _response.rawResponse };
404
442
  }
405
443
  if (_response.error.reason === "status-code") {
406
444
  switch (_response.error.statusCode) {
@@ -410,11 +448,12 @@ class Prompts {
410
448
  allowUnrecognizedUnionMembers: true,
411
449
  allowUnrecognizedEnumValues: true,
412
450
  breadcrumbsPrefix: ["response"],
413
- }));
451
+ }), _response.rawResponse);
414
452
  default:
415
453
  throw new errors.HumeError({
416
454
  statusCode: _response.error.statusCode,
417
455
  body: _response.error.body,
456
+ rawResponse: _response.rawResponse,
418
457
  });
419
458
  }
420
459
  }
@@ -423,12 +462,14 @@ class Prompts {
423
462
  throw new errors.HumeError({
424
463
  statusCode: _response.error.statusCode,
425
464
  body: _response.error.rawBody,
465
+ rawResponse: _response.rawResponse,
426
466
  });
427
467
  case "timeout":
428
468
  throw new errors.HumeTimeoutError("Timeout exceeded when calling DELETE /v0/evi/prompts/{id}.");
429
469
  case "unknown":
430
470
  throw new errors.HumeError({
431
471
  message: _response.error.errorMessage,
472
+ rawResponse: _response.rawResponse,
432
473
  });
433
474
  }
434
475
  });
@@ -450,12 +491,15 @@ class Prompts {
450
491
  * })
451
492
  */
452
493
  updatePromptName(id, request, requestOptions) {
494
+ return core.HttpResponsePromise.fromPromise(this.__updatePromptName(id, request, requestOptions));
495
+ }
496
+ __updatePromptName(id, request, requestOptions) {
453
497
  return __awaiter(this, void 0, void 0, function* () {
454
498
  var _a, _b, _c;
455
499
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
456
500
  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/prompts/${encodeURIComponent(id)}`),
457
501
  method: "PATCH",
458
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.3", "User-Agent": "hume/0.10.3", "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),
502
+ 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),
459
503
  contentType: "application/json",
460
504
  requestType: "json",
461
505
  body: serializers.empathicVoice.PostedPromptName.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -465,7 +509,7 @@ class Prompts {
465
509
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
466
510
  });
467
511
  if (_response.ok) {
468
- return _response.body;
512
+ return { data: _response.body, rawResponse: _response.rawResponse };
469
513
  }
470
514
  if (_response.error.reason === "status-code") {
471
515
  switch (_response.error.statusCode) {
@@ -475,11 +519,12 @@ class Prompts {
475
519
  allowUnrecognizedUnionMembers: true,
476
520
  allowUnrecognizedEnumValues: true,
477
521
  breadcrumbsPrefix: ["response"],
478
- }));
522
+ }), _response.rawResponse);
479
523
  default:
480
524
  throw new errors.HumeError({
481
525
  statusCode: _response.error.statusCode,
482
526
  body: _response.error.body,
527
+ rawResponse: _response.rawResponse,
483
528
  });
484
529
  }
485
530
  }
@@ -488,12 +533,14 @@ class Prompts {
488
533
  throw new errors.HumeError({
489
534
  statusCode: _response.error.statusCode,
490
535
  body: _response.error.rawBody,
536
+ rawResponse: _response.rawResponse,
491
537
  });
492
538
  case "timeout":
493
539
  throw new errors.HumeTimeoutError("Timeout exceeded when calling PATCH /v0/evi/prompts/{id}.");
494
540
  case "unknown":
495
541
  throw new errors.HumeError({
496
542
  message: _response.error.errorMessage,
543
+ rawResponse: _response.rawResponse,
497
544
  });
498
545
  }
499
546
  });
@@ -517,12 +564,15 @@ class Prompts {
517
564
  * await client.empathicVoice.prompts.getPromptVersion("af699d45-2985-42cc-91b9-af9e5da3bac5", 0)
518
565
  */
519
566
  getPromptVersion(id, version, requestOptions) {
567
+ return core.HttpResponsePromise.fromPromise(this.__getPromptVersion(id, version, requestOptions));
568
+ }
569
+ __getPromptVersion(id, version, requestOptions) {
520
570
  return __awaiter(this, void 0, void 0, function* () {
521
571
  var _a, _b, _c;
522
572
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
523
573
  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/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
524
574
  method: "GET",
525
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.3", "User-Agent": "hume/0.10.3", "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),
575
+ 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),
526
576
  contentType: "application/json",
527
577
  requestType: "json",
528
578
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -530,12 +580,15 @@ class Prompts {
530
580
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
531
581
  });
532
582
  if (_response.ok) {
533
- return serializers.empathicVoice.prompts.getPromptVersion.Response.parseOrThrow(_response.body, {
534
- unrecognizedObjectKeys: "passthrough",
535
- allowUnrecognizedUnionMembers: true,
536
- allowUnrecognizedEnumValues: true,
537
- breadcrumbsPrefix: ["response"],
538
- });
583
+ return {
584
+ data: serializers.empathicVoice.prompts.getPromptVersion.Response.parseOrThrow(_response.body, {
585
+ unrecognizedObjectKeys: "passthrough",
586
+ allowUnrecognizedUnionMembers: true,
587
+ allowUnrecognizedEnumValues: true,
588
+ breadcrumbsPrefix: ["response"],
589
+ }),
590
+ rawResponse: _response.rawResponse,
591
+ };
539
592
  }
540
593
  if (_response.error.reason === "status-code") {
541
594
  switch (_response.error.statusCode) {
@@ -545,11 +598,12 @@ class Prompts {
545
598
  allowUnrecognizedUnionMembers: true,
546
599
  allowUnrecognizedEnumValues: true,
547
600
  breadcrumbsPrefix: ["response"],
548
- }));
601
+ }), _response.rawResponse);
549
602
  default:
550
603
  throw new errors.HumeError({
551
604
  statusCode: _response.error.statusCode,
552
605
  body: _response.error.body,
606
+ rawResponse: _response.rawResponse,
553
607
  });
554
608
  }
555
609
  }
@@ -558,12 +612,14 @@ class Prompts {
558
612
  throw new errors.HumeError({
559
613
  statusCode: _response.error.statusCode,
560
614
  body: _response.error.rawBody,
615
+ rawResponse: _response.rawResponse,
561
616
  });
562
617
  case "timeout":
563
618
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/prompts/{id}/version/{version}.");
564
619
  case "unknown":
565
620
  throw new errors.HumeError({
566
621
  message: _response.error.errorMessage,
622
+ rawResponse: _response.rawResponse,
567
623
  });
568
624
  }
569
625
  });
@@ -587,12 +643,15 @@ class Prompts {
587
643
  * await client.empathicVoice.prompts.deletePromptVersion("af699d45-2985-42cc-91b9-af9e5da3bac5", 1)
588
644
  */
589
645
  deletePromptVersion(id, version, requestOptions) {
646
+ return core.HttpResponsePromise.fromPromise(this.__deletePromptVersion(id, version, requestOptions));
647
+ }
648
+ __deletePromptVersion(id, version, requestOptions) {
590
649
  return __awaiter(this, void 0, void 0, function* () {
591
650
  var _a, _b, _c;
592
651
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
593
652
  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/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
594
653
  method: "DELETE",
595
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.3", "User-Agent": "hume/0.10.3", "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),
654
+ 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),
596
655
  contentType: "application/json",
597
656
  requestType: "json",
598
657
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -600,7 +659,7 @@ class Prompts {
600
659
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
601
660
  });
602
661
  if (_response.ok) {
603
- return;
662
+ return { data: undefined, rawResponse: _response.rawResponse };
604
663
  }
605
664
  if (_response.error.reason === "status-code") {
606
665
  switch (_response.error.statusCode) {
@@ -610,11 +669,12 @@ class Prompts {
610
669
  allowUnrecognizedUnionMembers: true,
611
670
  allowUnrecognizedEnumValues: true,
612
671
  breadcrumbsPrefix: ["response"],
613
- }));
672
+ }), _response.rawResponse);
614
673
  default:
615
674
  throw new errors.HumeError({
616
675
  statusCode: _response.error.statusCode,
617
676
  body: _response.error.body,
677
+ rawResponse: _response.rawResponse,
618
678
  });
619
679
  }
620
680
  }
@@ -623,12 +683,14 @@ class Prompts {
623
683
  throw new errors.HumeError({
624
684
  statusCode: _response.error.statusCode,
625
685
  body: _response.error.rawBody,
686
+ rawResponse: _response.rawResponse,
626
687
  });
627
688
  case "timeout":
628
689
  throw new errors.HumeTimeoutError("Timeout exceeded when calling DELETE /v0/evi/prompts/{id}/version/{version}.");
629
690
  case "unknown":
630
691
  throw new errors.HumeError({
631
692
  message: _response.error.errorMessage,
693
+ rawResponse: _response.rawResponse,
632
694
  });
633
695
  }
634
696
  });
@@ -654,13 +716,16 @@ class Prompts {
654
716
  * versionDescription: "This is an updated version_description."
655
717
  * })
656
718
  */
657
- updatePromptDescription(id_1, version_1) {
719
+ updatePromptDescription(id, version, request = {}, requestOptions) {
720
+ return core.HttpResponsePromise.fromPromise(this.__updatePromptDescription(id, version, request, requestOptions));
721
+ }
722
+ __updatePromptDescription(id_1, version_1) {
658
723
  return __awaiter(this, arguments, void 0, function* (id, version, request = {}, requestOptions) {
659
724
  var _a, _b, _c;
660
725
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
661
726
  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/prompts/${encodeURIComponent(id)}/version/${encodeURIComponent(version)}`),
662
727
  method: "PATCH",
663
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.10.3", "User-Agent": "hume/0.10.3", "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),
728
+ 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),
664
729
  contentType: "application/json",
665
730
  requestType: "json",
666
731
  body: serializers.empathicVoice.PostedPromptVersionDescription.jsonOrThrow(request, {
@@ -671,12 +736,15 @@ class Prompts {
671
736
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
672
737
  });
673
738
  if (_response.ok) {
674
- return serializers.empathicVoice.prompts.updatePromptDescription.Response.parseOrThrow(_response.body, {
675
- unrecognizedObjectKeys: "passthrough",
676
- allowUnrecognizedUnionMembers: true,
677
- allowUnrecognizedEnumValues: true,
678
- breadcrumbsPrefix: ["response"],
679
- });
739
+ return {
740
+ data: serializers.empathicVoice.prompts.updatePromptDescription.Response.parseOrThrow(_response.body, {
741
+ unrecognizedObjectKeys: "passthrough",
742
+ allowUnrecognizedUnionMembers: true,
743
+ allowUnrecognizedEnumValues: true,
744
+ breadcrumbsPrefix: ["response"],
745
+ }),
746
+ rawResponse: _response.rawResponse,
747
+ };
680
748
  }
681
749
  if (_response.error.reason === "status-code") {
682
750
  switch (_response.error.statusCode) {
@@ -686,11 +754,12 @@ class Prompts {
686
754
  allowUnrecognizedUnionMembers: true,
687
755
  allowUnrecognizedEnumValues: true,
688
756
  breadcrumbsPrefix: ["response"],
689
- }));
757
+ }), _response.rawResponse);
690
758
  default:
691
759
  throw new errors.HumeError({
692
760
  statusCode: _response.error.statusCode,
693
761
  body: _response.error.body,
762
+ rawResponse: _response.rawResponse,
694
763
  });
695
764
  }
696
765
  }
@@ -699,12 +768,14 @@ class Prompts {
699
768
  throw new errors.HumeError({
700
769
  statusCode: _response.error.statusCode,
701
770
  body: _response.error.rawBody,
771
+ rawResponse: _response.rawResponse,
702
772
  });
703
773
  case "timeout":
704
774
  throw new errors.HumeTimeoutError("Timeout exceeded when calling PATCH /v0/evi/prompts/{id}/version/{version}.");
705
775
  case "unknown":
706
776
  throw new errors.HumeError({
707
777
  message: _response.error.errorMessage,
778
+ rawResponse: _response.rawResponse,
708
779
  });
709
780
  }
710
781
  });