hume 0.15.9 → 0.15.10

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 (446) hide show
  1. package/dist/cjs/BaseClient.d.ts +13 -4
  2. package/dist/cjs/BaseClient.js +59 -0
  3. package/dist/cjs/Client.d.ts +13 -13
  4. package/dist/cjs/Client.js +6 -47
  5. package/dist/cjs/api/resources/empathicVoice/client/Client.d.ts +27 -27
  6. package/dist/cjs/api/resources/empathicVoice/client/Client.js +13 -12
  7. package/dist/cjs/api/resources/empathicVoice/errors/BadRequestError.js +5 -1
  8. package/dist/cjs/api/resources/empathicVoice/errors/UnprocessableEntityError.js +5 -1
  9. package/dist/cjs/api/resources/empathicVoice/resources/chat/client/Client.d.ts +5 -5
  10. package/dist/cjs/api/resources/empathicVoice/resources/chat/client/Client.js +3 -3
  11. package/dist/cjs/api/resources/empathicVoice/resources/chat/client/index.d.ts +1 -1
  12. package/dist/cjs/api/resources/empathicVoice/resources/chat/client/index.js +2 -2
  13. package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +17 -26
  14. package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/Client.js +48 -136
  15. package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.ts +1 -1
  16. package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetChatGroupRequest.d.ts +1 -1
  17. package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupEventsRequest.d.ts +1 -1
  18. package/dist/cjs/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupsRequest.d.ts +2 -6
  19. package/dist/cjs/api/resources/empathicVoice/resources/chats/client/Client.d.ts +13 -20
  20. package/dist/cjs/api/resources/empathicVoice/resources/chats/client/Client.js +32 -95
  21. package/dist/cjs/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatEventsRequest.d.ts +1 -1
  22. package/dist/cjs/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatsRequest.d.ts +1 -1
  23. package/dist/cjs/api/resources/empathicVoice/resources/configs/client/Client.d.ts +34 -83
  24. package/dist/cjs/api/resources/empathicVoice/resources/configs/client/Client.js +64 -245
  25. package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigVersionsRequest.d.ts +1 -1
  26. package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +4 -16
  27. package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +3 -14
  28. package/dist/cjs/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersionDescription.d.ts +1 -1
  29. package/dist/cjs/api/resources/empathicVoice/resources/controlPlane/client/Client.d.ts +7 -7
  30. package/dist/cjs/api/resources/empathicVoice/resources/controlPlane/client/Client.js +6 -19
  31. package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +34 -83
  32. package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/Client.js +64 -245
  33. package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.ts +2 -8
  34. package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.ts +2 -8
  35. package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersionDescription.d.ts +1 -1
  36. package/dist/cjs/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptVersionsRequest.d.ts +1 -1
  37. package/dist/cjs/api/resources/empathicVoice/resources/tools/client/Client.d.ts +34 -83
  38. package/dist/cjs/api/resources/empathicVoice/resources/tools/client/Client.js +64 -245
  39. package/dist/cjs/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedTool.d.ts +4 -8
  40. package/dist/cjs/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersion.d.ts +4 -8
  41. package/dist/cjs/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersionDescription.d.ts +1 -1
  42. package/dist/cjs/api/resources/empathicVoice/types/AssistantEnd.d.ts +1 -1
  43. package/dist/cjs/api/resources/empathicVoice/types/AssistantInput.d.ts +2 -5
  44. package/dist/cjs/api/resources/empathicVoice/types/AssistantMessage.d.ts +2 -2
  45. package/dist/cjs/api/resources/empathicVoice/types/AssistantProsody.d.ts +1 -1
  46. package/dist/cjs/api/resources/empathicVoice/types/AudioInput.d.ts +6 -4
  47. package/dist/cjs/api/resources/empathicVoice/types/AudioOutput.d.ts +1 -4
  48. package/dist/cjs/api/resources/empathicVoice/types/ChatMetadata.d.ts +3 -5
  49. package/dist/cjs/api/resources/empathicVoice/types/ConnectSessionSettings.d.ts +8 -4
  50. package/dist/cjs/api/resources/empathicVoice/types/ConnectSessionSettingsAudio.d.ts +3 -3
  51. package/dist/cjs/api/resources/empathicVoice/types/ConnectSessionSettingsContext.d.ts +9 -3
  52. package/dist/cjs/api/resources/empathicVoice/types/Context.d.ts +9 -3
  53. package/dist/cjs/api/resources/empathicVoice/types/ControlPlanePublishEvent.d.ts +1 -36
  54. package/dist/cjs/api/resources/empathicVoice/types/JsonMessage.d.ts +1 -50
  55. package/dist/cjs/api/resources/empathicVoice/types/PauseAssistantMessage.d.ts +2 -4
  56. package/dist/cjs/api/resources/empathicVoice/types/PostedBuiltinTool.d.ts +1 -9
  57. package/dist/cjs/api/resources/empathicVoice/types/PostedBuiltinToolName.d.ts +0 -8
  58. package/dist/cjs/api/resources/empathicVoice/types/PostedBuiltinToolName.js +0 -8
  59. package/dist/cjs/api/resources/empathicVoice/types/PostedEllmModel.d.ts +1 -5
  60. package/dist/cjs/api/resources/empathicVoice/types/PostedEventMessageSpec.d.ts +2 -6
  61. package/dist/cjs/api/resources/empathicVoice/types/PostedEventMessageSpecs.d.ts +1 -14
  62. package/dist/cjs/api/resources/empathicVoice/types/PostedLanguageModel.d.ts +1 -7
  63. package/dist/cjs/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +2 -2
  64. package/dist/cjs/api/resources/empathicVoice/types/PostedTimeoutSpecs.d.ts +1 -13
  65. package/dist/cjs/api/resources/empathicVoice/types/PostedTimeoutSpecsInactivity.d.ts +0 -11
  66. package/dist/cjs/api/resources/empathicVoice/types/PostedTimeoutSpecsMaxDuration.d.ts +0 -11
  67. package/dist/cjs/api/resources/empathicVoice/types/PostedUserDefinedToolSpec.d.ts +1 -7
  68. package/dist/cjs/api/resources/empathicVoice/types/PostedWebhookSpec.d.ts +2 -6
  69. package/dist/cjs/api/resources/empathicVoice/types/ResumeAssistantMessage.d.ts +1 -3
  70. package/dist/cjs/api/resources/empathicVoice/types/ReturnBuiltinTool.d.ts +1 -2
  71. package/dist/cjs/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.d.ts +0 -1
  72. package/dist/cjs/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.js +0 -1
  73. package/dist/cjs/api/resources/empathicVoice/types/ReturnChat.d.ts +4 -19
  74. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatAudioReconstruction.d.ts +0 -13
  75. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.d.ts +0 -13
  76. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.js +0 -13
  77. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEvent.d.ts +5 -30
  78. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventRole.d.ts +0 -7
  79. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventRole.js +0 -7
  80. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventType.d.ts +0 -14
  81. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatEventType.js +0 -14
  82. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroup.d.ts +5 -6
  83. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructions.d.ts +1 -10
  84. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.d.ts +0 -5
  85. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.js +0 -5
  86. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedChats.d.ts +6 -16
  87. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.d.ts +0 -5
  88. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.js +0 -5
  89. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedEvents.d.ts +3 -12
  90. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.d.ts +0 -5
  91. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.js +0 -5
  92. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEvents.d.ts +6 -30
  93. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.d.ts +0 -5
  94. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.js +0 -5
  95. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.d.ts +0 -15
  96. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.js +0 -15
  97. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatStatus.d.ts +0 -15
  98. package/dist/cjs/api/resources/empathicVoice/types/ReturnChatStatus.js +0 -15
  99. package/dist/cjs/api/resources/empathicVoice/types/ReturnConfigSpec.d.ts +2 -8
  100. package/dist/cjs/api/resources/empathicVoice/types/ReturnEllmModel.d.ts +1 -5
  101. package/dist/cjs/api/resources/empathicVoice/types/ReturnEventMessageSpec.d.ts +2 -6
  102. package/dist/cjs/api/resources/empathicVoice/types/ReturnEventMessageSpecs.d.ts +1 -14
  103. package/dist/cjs/api/resources/empathicVoice/types/ReturnLanguageModel.d.ts +1 -7
  104. package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatGroups.d.ts +2 -11
  105. package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.d.ts +0 -5
  106. package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.js +0 -5
  107. package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChats.d.ts +2 -11
  108. package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.d.ts +0 -5
  109. package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.js +0 -5
  110. package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedConfigs.d.ts +2 -6
  111. package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedPrompts.d.ts +2 -6
  112. package/dist/cjs/api/resources/empathicVoice/types/ReturnPagedUserDefinedTools.d.ts +2 -6
  113. package/dist/cjs/api/resources/empathicVoice/types/ReturnPromptVersionType.d.ts +0 -1
  114. package/dist/cjs/api/resources/empathicVoice/types/ReturnPromptVersionType.js +0 -1
  115. package/dist/cjs/api/resources/empathicVoice/types/ReturnTimeoutSpec.d.ts +2 -6
  116. package/dist/cjs/api/resources/empathicVoice/types/ReturnTimeoutSpecs.d.ts +1 -13
  117. package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedTool.d.ts +7 -19
  118. package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.d.ts +0 -1
  119. package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.js +0 -1
  120. package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.d.ts +0 -1
  121. package/dist/cjs/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.js +0 -1
  122. package/dist/cjs/api/resources/empathicVoice/types/ReturnVoice.d.ts +5 -3
  123. package/dist/cjs/api/resources/empathicVoice/types/ReturnWebhookSpec.d.ts +2 -6
  124. package/dist/cjs/api/resources/empathicVoice/types/SessionSettings.d.ts +10 -19
  125. package/dist/cjs/api/resources/empathicVoice/types/SubscribeEvent.d.ts +1 -55
  126. package/dist/cjs/api/resources/empathicVoice/types/ToolCallMessage.d.ts +3 -9
  127. package/dist/cjs/api/resources/empathicVoice/types/ToolErrorMessage.d.ts +3 -5
  128. package/dist/cjs/api/resources/empathicVoice/types/ToolResponseMessage.d.ts +3 -11
  129. package/dist/cjs/api/resources/empathicVoice/types/UserInput.d.ts +6 -2
  130. package/dist/cjs/api/resources/empathicVoice/types/UserInterruption.d.ts +1 -3
  131. package/dist/cjs/api/resources/empathicVoice/types/UserMessage.d.ts +3 -17
  132. package/dist/cjs/api/resources/empathicVoice/types/VoiceId.d.ts +11 -2
  133. package/dist/cjs/api/resources/empathicVoice/types/VoiceName.d.ts +11 -2
  134. package/dist/cjs/api/resources/empathicVoice/types/WebSocketError.d.ts +1 -3
  135. package/dist/cjs/api/resources/expressionMeasurement/client/Client.d.ts +9 -9
  136. package/dist/cjs/api/resources/expressionMeasurement/client/Client.js +7 -6
  137. package/dist/cjs/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +17 -18
  138. package/dist/cjs/api/resources/expressionMeasurement/resources/batch/client/Client.js +63 -151
  139. package/dist/cjs/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.d.ts +7 -8
  140. package/dist/cjs/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.js +7 -12
  141. package/dist/cjs/api/resources/tts/client/Client.d.ts +19 -20
  142. package/dist/cjs/api/resources/tts/client/Client.js +56 -138
  143. package/dist/cjs/api/resources/tts/errors/BadRequestError.js +5 -1
  144. package/dist/cjs/api/resources/tts/errors/UnprocessableEntityError.js +5 -1
  145. package/dist/cjs/api/resources/tts/resources/streamInput/client/Client.d.ts +15 -14
  146. package/dist/cjs/api/resources/tts/resources/streamInput/client/Client.js +10 -6
  147. package/dist/cjs/api/resources/tts/resources/voices/client/Client.d.ts +13 -14
  148. package/dist/cjs/api/resources/tts/resources/voices/client/Client.js +33 -87
  149. package/dist/cjs/api/resources/tts/resources/voices/client/requests/PostedVoice.d.ts +1 -1
  150. package/dist/cjs/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.ts +1 -1
  151. package/dist/cjs/api/resources/tts/types/OctaveVersion.d.ts +7 -3
  152. package/dist/cjs/api/resources/tts/types/OctaveVersion.js +7 -3
  153. package/dist/cjs/api/resources/tts/types/PostedTts.d.ts +0 -6
  154. package/dist/cjs/api/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +1 -1
  155. package/dist/cjs/api/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +1 -1
  156. package/dist/cjs/api/resources/tts/types/PublishTts.d.ts +14 -4
  157. package/dist/cjs/api/resources/tts/types/ReturnPagedVoices.d.ts +5 -9
  158. package/dist/cjs/api/resources/tts/types/ReturnVoice.d.ts +3 -3
  159. package/dist/cjs/auth/HeaderAuthProvider.d.ts +26 -0
  160. package/dist/cjs/auth/HeaderAuthProvider.js +91 -0
  161. package/dist/cjs/auth/index.d.ts +1 -0
  162. package/dist/cjs/auth/index.js +5 -0
  163. package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
  164. package/dist/cjs/core/auth/AuthProvider.js +2 -0
  165. package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
  166. package/dist/cjs/core/auth/AuthRequest.js +2 -0
  167. package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
  168. package/dist/cjs/core/auth/BasicAuth.js +27 -0
  169. package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
  170. package/dist/cjs/core/auth/BearerToken.js +16 -0
  171. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
  172. package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
  173. package/dist/cjs/core/auth/index.d.ts +5 -0
  174. package/dist/cjs/core/auth/index.js +9 -0
  175. package/dist/cjs/core/base64.d.ts +2 -0
  176. package/dist/cjs/core/base64.js +26 -0
  177. package/dist/cjs/core/fetcher/BinaryResponse.d.ts +6 -7
  178. package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
  179. package/dist/cjs/core/fetcher/Fetcher.d.ts +6 -3
  180. package/dist/cjs/core/fetcher/Fetcher.js +42 -24
  181. package/dist/cjs/core/fetcher/getResponseBody.js +18 -4
  182. package/dist/cjs/core/fetcher/makeRequest.d.ts +1 -1
  183. package/dist/cjs/core/fetcher/makeRequest.js +0 -2
  184. package/dist/cjs/core/fetcher/requestWithRetries.js +0 -9
  185. package/dist/cjs/core/fetcher/signals.d.ts +1 -7
  186. package/dist/cjs/core/fetcher/signals.js +0 -12
  187. package/dist/cjs/core/headers.d.ts +2 -2
  188. package/dist/cjs/core/index.d.ts +2 -0
  189. package/dist/cjs/core/index.js +2 -0
  190. package/dist/cjs/core/logging/logger.js +1 -1
  191. package/dist/cjs/core/pagination/CustomPager.d.ts +67 -0
  192. package/dist/cjs/core/pagination/CustomPager.js +194 -0
  193. package/dist/cjs/core/pagination/index.d.ts +1 -0
  194. package/dist/cjs/core/pagination/index.js +4 -1
  195. package/dist/cjs/core/runtime/runtime.js +11 -10
  196. package/dist/cjs/core/schemas/Schema.d.ts +1 -0
  197. package/dist/cjs/core/schemas/Schema.js +1 -0
  198. package/dist/cjs/core/schemas/builders/object/object.js +14 -1
  199. package/dist/cjs/core/schemas/builders/primitives/index.d.ts +1 -0
  200. package/dist/cjs/core/schemas/builders/primitives/index.js +3 -1
  201. package/dist/cjs/core/schemas/builders/primitives/never.d.ts +2 -0
  202. package/dist/cjs/core/schemas/builders/primitives/never.js +14 -0
  203. package/dist/cjs/core/url/join.js +0 -1
  204. package/dist/cjs/errors/HumeError.js +5 -1
  205. package/dist/cjs/errors/HumeTimeoutError.js +5 -1
  206. package/dist/cjs/errors/handleNonStatusCodeError.d.ts +2 -0
  207. package/dist/cjs/errors/handleNonStatusCodeError.js +65 -0
  208. package/dist/cjs/serialization/resources/empathicVoice/types/ReturnVoice.d.ts +3 -3
  209. package/dist/cjs/serialization/resources/empathicVoice/types/ReturnVoice.js +3 -3
  210. package/dist/cjs/serialization/resources/tts/types/ReturnPagedVoices.d.ts +4 -4
  211. package/dist/cjs/serialization/resources/tts/types/ReturnPagedVoices.js +4 -4
  212. package/dist/cjs/serialization/resources/tts/types/ReturnVoice.d.ts +3 -3
  213. package/dist/cjs/serialization/resources/tts/types/ReturnVoice.js +3 -3
  214. package/dist/cjs/version.d.ts +1 -1
  215. package/dist/cjs/version.js +1 -1
  216. package/dist/cjs/wrapper/expressionMeasurement/ExpressionMeasurementClient.d.ts +1 -1
  217. package/dist/cjs/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +1 -1
  218. package/dist/cjs/wrapper/expressionMeasurement/batch/BatchClient.d.ts +1 -1
  219. package/dist/cjs/wrapper/expressionMeasurement/batch/BatchClient.js +1 -1
  220. package/dist/cjs/wrapper/fetchAccessToken.js +3 -0
  221. package/dist/esm/BaseClient.d.mts +13 -4
  222. package/dist/esm/BaseClient.mjs +24 -1
  223. package/dist/esm/Client.d.mts +13 -13
  224. package/dist/esm/Client.mjs +9 -17
  225. package/dist/esm/api/resources/empathicVoice/client/Client.d.mts +27 -27
  226. package/dist/esm/api/resources/empathicVoice/client/Client.mjs +18 -17
  227. package/dist/esm/api/resources/empathicVoice/errors/BadRequestError.mjs +5 -1
  228. package/dist/esm/api/resources/empathicVoice/errors/UnprocessableEntityError.mjs +5 -1
  229. package/dist/esm/api/resources/empathicVoice/resources/chat/client/Client.d.mts +5 -5
  230. package/dist/esm/api/resources/empathicVoice/resources/chat/client/Client.mjs +1 -1
  231. package/dist/esm/api/resources/empathicVoice/resources/chat/client/index.d.mts +1 -1
  232. package/dist/esm/api/resources/empathicVoice/resources/chat/client/index.mjs +1 -1
  233. package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/Client.d.mts +17 -26
  234. package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/Client.mjs +47 -135
  235. package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetAudioRequest.d.mts +1 -1
  236. package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsGetChatGroupRequest.d.mts +1 -1
  237. package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupEventsRequest.d.mts +1 -1
  238. package/dist/esm/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupsRequest.d.mts +2 -6
  239. package/dist/esm/api/resources/empathicVoice/resources/chats/client/Client.d.mts +13 -20
  240. package/dist/esm/api/resources/empathicVoice/resources/chats/client/Client.mjs +31 -94
  241. package/dist/esm/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatEventsRequest.d.mts +1 -1
  242. package/dist/esm/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatsRequest.d.mts +1 -1
  243. package/dist/esm/api/resources/empathicVoice/resources/configs/client/Client.d.mts +34 -83
  244. package/dist/esm/api/resources/empathicVoice/resources/configs/client/Client.mjs +63 -244
  245. package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigVersionsRequest.d.mts +1 -1
  246. package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.mts +4 -16
  247. package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.mts +3 -14
  248. package/dist/esm/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersionDescription.d.mts +1 -1
  249. package/dist/esm/api/resources/empathicVoice/resources/controlPlane/client/Client.d.mts +7 -7
  250. package/dist/esm/api/resources/empathicVoice/resources/controlPlane/client/Client.mjs +4 -17
  251. package/dist/esm/api/resources/empathicVoice/resources/prompts/client/Client.d.mts +34 -83
  252. package/dist/esm/api/resources/empathicVoice/resources/prompts/client/Client.mjs +63 -244
  253. package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.mts +2 -8
  254. package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.mts +2 -8
  255. package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersionDescription.d.mts +1 -1
  256. package/dist/esm/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptVersionsRequest.d.mts +1 -1
  257. package/dist/esm/api/resources/empathicVoice/resources/tools/client/Client.d.mts +34 -83
  258. package/dist/esm/api/resources/empathicVoice/resources/tools/client/Client.mjs +63 -244
  259. package/dist/esm/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedTool.d.mts +4 -8
  260. package/dist/esm/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersion.d.mts +4 -8
  261. package/dist/esm/api/resources/empathicVoice/resources/tools/client/requests/PostedUserDefinedToolVersionDescription.d.mts +1 -1
  262. package/dist/esm/api/resources/empathicVoice/types/AssistantEnd.d.mts +1 -1
  263. package/dist/esm/api/resources/empathicVoice/types/AssistantInput.d.mts +2 -5
  264. package/dist/esm/api/resources/empathicVoice/types/AssistantMessage.d.mts +2 -2
  265. package/dist/esm/api/resources/empathicVoice/types/AssistantProsody.d.mts +1 -1
  266. package/dist/esm/api/resources/empathicVoice/types/AudioInput.d.mts +6 -4
  267. package/dist/esm/api/resources/empathicVoice/types/AudioOutput.d.mts +1 -4
  268. package/dist/esm/api/resources/empathicVoice/types/ChatMetadata.d.mts +3 -5
  269. package/dist/esm/api/resources/empathicVoice/types/ConnectSessionSettings.d.mts +8 -4
  270. package/dist/esm/api/resources/empathicVoice/types/ConnectSessionSettingsAudio.d.mts +3 -3
  271. package/dist/esm/api/resources/empathicVoice/types/ConnectSessionSettingsContext.d.mts +9 -3
  272. package/dist/esm/api/resources/empathicVoice/types/Context.d.mts +9 -3
  273. package/dist/esm/api/resources/empathicVoice/types/ControlPlanePublishEvent.d.mts +1 -36
  274. package/dist/esm/api/resources/empathicVoice/types/JsonMessage.d.mts +1 -50
  275. package/dist/esm/api/resources/empathicVoice/types/PauseAssistantMessage.d.mts +2 -4
  276. package/dist/esm/api/resources/empathicVoice/types/PostedBuiltinTool.d.mts +1 -9
  277. package/dist/esm/api/resources/empathicVoice/types/PostedBuiltinToolName.d.mts +0 -8
  278. package/dist/esm/api/resources/empathicVoice/types/PostedBuiltinToolName.mjs +0 -8
  279. package/dist/esm/api/resources/empathicVoice/types/PostedEllmModel.d.mts +1 -5
  280. package/dist/esm/api/resources/empathicVoice/types/PostedEventMessageSpec.d.mts +2 -6
  281. package/dist/esm/api/resources/empathicVoice/types/PostedEventMessageSpecs.d.mts +1 -14
  282. package/dist/esm/api/resources/empathicVoice/types/PostedLanguageModel.d.mts +1 -7
  283. package/dist/esm/api/resources/empathicVoice/types/PostedNudgeSpec.d.mts +2 -2
  284. package/dist/esm/api/resources/empathicVoice/types/PostedTimeoutSpecs.d.mts +1 -13
  285. package/dist/esm/api/resources/empathicVoice/types/PostedTimeoutSpecsInactivity.d.mts +0 -11
  286. package/dist/esm/api/resources/empathicVoice/types/PostedTimeoutSpecsMaxDuration.d.mts +0 -11
  287. package/dist/esm/api/resources/empathicVoice/types/PostedUserDefinedToolSpec.d.mts +1 -7
  288. package/dist/esm/api/resources/empathicVoice/types/PostedWebhookSpec.d.mts +2 -6
  289. package/dist/esm/api/resources/empathicVoice/types/ResumeAssistantMessage.d.mts +1 -3
  290. package/dist/esm/api/resources/empathicVoice/types/ReturnBuiltinTool.d.mts +1 -2
  291. package/dist/esm/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.d.mts +0 -1
  292. package/dist/esm/api/resources/empathicVoice/types/ReturnBuiltinToolToolType.mjs +0 -1
  293. package/dist/esm/api/resources/empathicVoice/types/ReturnChat.d.mts +4 -19
  294. package/dist/esm/api/resources/empathicVoice/types/ReturnChatAudioReconstruction.d.mts +0 -13
  295. package/dist/esm/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.d.mts +0 -13
  296. package/dist/esm/api/resources/empathicVoice/types/ReturnChatAudioReconstructionStatus.mjs +0 -13
  297. package/dist/esm/api/resources/empathicVoice/types/ReturnChatEvent.d.mts +5 -30
  298. package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventRole.d.mts +0 -7
  299. package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventRole.mjs +0 -7
  300. package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventType.d.mts +0 -14
  301. package/dist/esm/api/resources/empathicVoice/types/ReturnChatEventType.mjs +0 -14
  302. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroup.d.mts +5 -6
  303. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructions.d.mts +1 -10
  304. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.d.mts +0 -5
  305. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedAudioReconstructionsPaginationDirection.mjs +0 -5
  306. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedChats.d.mts +6 -16
  307. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.d.mts +0 -5
  308. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedChatsPaginationDirection.mjs +0 -5
  309. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedEvents.d.mts +3 -12
  310. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.d.mts +0 -5
  311. package/dist/esm/api/resources/empathicVoice/types/ReturnChatGroupPagedEventsPaginationDirection.mjs +0 -5
  312. package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEvents.d.mts +6 -30
  313. package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.d.mts +0 -5
  314. package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsPaginationDirection.mjs +0 -5
  315. package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.d.mts +0 -15
  316. package/dist/esm/api/resources/empathicVoice/types/ReturnChatPagedEventsStatus.mjs +0 -15
  317. package/dist/esm/api/resources/empathicVoice/types/ReturnChatStatus.d.mts +0 -15
  318. package/dist/esm/api/resources/empathicVoice/types/ReturnChatStatus.mjs +0 -15
  319. package/dist/esm/api/resources/empathicVoice/types/ReturnConfigSpec.d.mts +2 -8
  320. package/dist/esm/api/resources/empathicVoice/types/ReturnEllmModel.d.mts +1 -5
  321. package/dist/esm/api/resources/empathicVoice/types/ReturnEventMessageSpec.d.mts +2 -6
  322. package/dist/esm/api/resources/empathicVoice/types/ReturnEventMessageSpecs.d.mts +1 -14
  323. package/dist/esm/api/resources/empathicVoice/types/ReturnLanguageModel.d.mts +1 -7
  324. package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatGroups.d.mts +2 -11
  325. package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.d.mts +0 -5
  326. package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatGroupsPaginationDirection.mjs +0 -5
  327. package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChats.d.mts +2 -11
  328. package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.d.mts +0 -5
  329. package/dist/esm/api/resources/empathicVoice/types/ReturnPagedChatsPaginationDirection.mjs +0 -5
  330. package/dist/esm/api/resources/empathicVoice/types/ReturnPagedConfigs.d.mts +2 -6
  331. package/dist/esm/api/resources/empathicVoice/types/ReturnPagedPrompts.d.mts +2 -6
  332. package/dist/esm/api/resources/empathicVoice/types/ReturnPagedUserDefinedTools.d.mts +2 -6
  333. package/dist/esm/api/resources/empathicVoice/types/ReturnPromptVersionType.d.mts +0 -1
  334. package/dist/esm/api/resources/empathicVoice/types/ReturnPromptVersionType.mjs +0 -1
  335. package/dist/esm/api/resources/empathicVoice/types/ReturnTimeoutSpec.d.mts +2 -6
  336. package/dist/esm/api/resources/empathicVoice/types/ReturnTimeoutSpecs.d.mts +1 -13
  337. package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedTool.d.mts +7 -19
  338. package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.d.mts +0 -1
  339. package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolToolType.mjs +0 -1
  340. package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.d.mts +0 -1
  341. package/dist/esm/api/resources/empathicVoice/types/ReturnUserDefinedToolVersionType.mjs +0 -1
  342. package/dist/esm/api/resources/empathicVoice/types/ReturnVoice.d.mts +5 -3
  343. package/dist/esm/api/resources/empathicVoice/types/ReturnWebhookSpec.d.mts +2 -6
  344. package/dist/esm/api/resources/empathicVoice/types/SessionSettings.d.mts +10 -19
  345. package/dist/esm/api/resources/empathicVoice/types/SubscribeEvent.d.mts +1 -55
  346. package/dist/esm/api/resources/empathicVoice/types/ToolCallMessage.d.mts +3 -9
  347. package/dist/esm/api/resources/empathicVoice/types/ToolErrorMessage.d.mts +3 -5
  348. package/dist/esm/api/resources/empathicVoice/types/ToolResponseMessage.d.mts +3 -11
  349. package/dist/esm/api/resources/empathicVoice/types/UserInput.d.mts +6 -2
  350. package/dist/esm/api/resources/empathicVoice/types/UserInterruption.d.mts +1 -3
  351. package/dist/esm/api/resources/empathicVoice/types/UserMessage.d.mts +3 -17
  352. package/dist/esm/api/resources/empathicVoice/types/VoiceId.d.mts +11 -2
  353. package/dist/esm/api/resources/empathicVoice/types/VoiceName.d.mts +11 -2
  354. package/dist/esm/api/resources/empathicVoice/types/WebSocketError.d.mts +1 -3
  355. package/dist/esm/api/resources/expressionMeasurement/client/Client.d.mts +9 -9
  356. package/dist/esm/api/resources/expressionMeasurement/client/Client.mjs +6 -5
  357. package/dist/esm/api/resources/expressionMeasurement/resources/batch/client/Client.d.mts +17 -18
  358. package/dist/esm/api/resources/expressionMeasurement/resources/batch/client/Client.mjs +61 -149
  359. package/dist/esm/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.d.mts +7 -8
  360. package/dist/esm/api/resources/expressionMeasurement/resources/stream/resources/stream/client/Client.mjs +5 -10
  361. package/dist/esm/api/resources/tts/client/Client.d.mts +19 -20
  362. package/dist/esm/api/resources/tts/client/Client.mjs +56 -138
  363. package/dist/esm/api/resources/tts/errors/BadRequestError.mjs +5 -1
  364. package/dist/esm/api/resources/tts/errors/UnprocessableEntityError.mjs +5 -1
  365. package/dist/esm/api/resources/tts/resources/streamInput/client/Client.d.mts +15 -14
  366. package/dist/esm/api/resources/tts/resources/streamInput/client/Client.mjs +8 -4
  367. package/dist/esm/api/resources/tts/resources/voices/client/Client.d.mts +13 -14
  368. package/dist/esm/api/resources/tts/resources/voices/client/Client.mjs +32 -86
  369. package/dist/esm/api/resources/tts/resources/voices/client/requests/PostedVoice.d.mts +1 -1
  370. package/dist/esm/api/resources/tts/resources/voices/client/requests/VoicesListRequest.d.mts +1 -1
  371. package/dist/esm/api/resources/tts/types/OctaveVersion.d.mts +7 -3
  372. package/dist/esm/api/resources/tts/types/OctaveVersion.mjs +7 -3
  373. package/dist/esm/api/resources/tts/types/PostedTts.d.mts +0 -6
  374. package/dist/esm/api/resources/tts/types/PostedUtteranceVoiceWithId.d.mts +1 -1
  375. package/dist/esm/api/resources/tts/types/PostedUtteranceVoiceWithName.d.mts +1 -1
  376. package/dist/esm/api/resources/tts/types/PublishTts.d.mts +14 -4
  377. package/dist/esm/api/resources/tts/types/ReturnPagedVoices.d.mts +5 -9
  378. package/dist/esm/api/resources/tts/types/ReturnVoice.d.mts +3 -3
  379. package/dist/esm/auth/HeaderAuthProvider.d.mts +26 -0
  380. package/dist/esm/auth/HeaderAuthProvider.mjs +54 -0
  381. package/dist/esm/auth/index.d.mts +1 -0
  382. package/dist/esm/auth/index.mjs +1 -0
  383. package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
  384. package/dist/esm/core/auth/AuthProvider.mjs +1 -0
  385. package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
  386. package/dist/esm/core/auth/AuthRequest.mjs +1 -0
  387. package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
  388. package/dist/esm/core/auth/BasicAuth.mjs +24 -0
  389. package/dist/esm/core/auth/BearerToken.d.mts +7 -0
  390. package/dist/esm/core/auth/BearerToken.mjs +13 -0
  391. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
  392. package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
  393. package/dist/esm/core/auth/index.d.mts +5 -0
  394. package/dist/esm/core/auth/index.mjs +3 -0
  395. package/dist/esm/core/base64.d.mts +2 -0
  396. package/dist/esm/core/base64.mjs +22 -0
  397. package/dist/esm/core/fetcher/BinaryResponse.d.mts +6 -7
  398. package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
  399. package/dist/esm/core/fetcher/Fetcher.d.mts +6 -3
  400. package/dist/esm/core/fetcher/Fetcher.mjs +42 -24
  401. package/dist/esm/core/fetcher/getResponseBody.mjs +18 -4
  402. package/dist/esm/core/fetcher/makeRequest.d.mts +1 -1
  403. package/dist/esm/core/fetcher/makeRequest.mjs +0 -2
  404. package/dist/esm/core/fetcher/requestWithRetries.mjs +0 -9
  405. package/dist/esm/core/fetcher/signals.d.mts +1 -7
  406. package/dist/esm/core/fetcher/signals.mjs +0 -12
  407. package/dist/esm/core/headers.d.mts +2 -2
  408. package/dist/esm/core/index.d.mts +2 -0
  409. package/dist/esm/core/index.mjs +2 -0
  410. package/dist/esm/core/logging/logger.mjs +1 -1
  411. package/dist/esm/core/pagination/CustomPager.d.mts +67 -0
  412. package/dist/esm/core/pagination/CustomPager.mjs +189 -0
  413. package/dist/esm/core/pagination/index.d.mts +1 -0
  414. package/dist/esm/core/pagination/index.mjs +1 -0
  415. package/dist/esm/core/runtime/runtime.mjs +11 -10
  416. package/dist/esm/core/schemas/Schema.d.mts +1 -0
  417. package/dist/esm/core/schemas/Schema.mjs +1 -0
  418. package/dist/esm/core/schemas/builders/object/object.mjs +14 -1
  419. package/dist/esm/core/schemas/builders/primitives/index.d.mts +1 -0
  420. package/dist/esm/core/schemas/builders/primitives/index.mjs +1 -0
  421. package/dist/esm/core/schemas/builders/primitives/never.d.mts +2 -0
  422. package/dist/esm/core/schemas/builders/primitives/never.mjs +11 -0
  423. package/dist/esm/core/url/join.mjs +0 -1
  424. package/dist/esm/errors/HumeError.mjs +5 -1
  425. package/dist/esm/errors/HumeTimeoutError.mjs +5 -1
  426. package/dist/esm/errors/handleNonStatusCodeError.d.mts +2 -0
  427. package/dist/esm/errors/handleNonStatusCodeError.mjs +29 -0
  428. package/dist/esm/serialization/resources/empathicVoice/types/ReturnVoice.d.mts +3 -3
  429. package/dist/esm/serialization/resources/empathicVoice/types/ReturnVoice.mjs +3 -3
  430. package/dist/esm/serialization/resources/tts/types/ReturnPagedVoices.d.mts +4 -4
  431. package/dist/esm/serialization/resources/tts/types/ReturnPagedVoices.mjs +4 -4
  432. package/dist/esm/serialization/resources/tts/types/ReturnVoice.d.mts +3 -3
  433. package/dist/esm/serialization/resources/tts/types/ReturnVoice.mjs +3 -3
  434. package/dist/esm/version.d.mts +1 -1
  435. package/dist/esm/version.mjs +1 -1
  436. package/dist/esm/wrapper/expressionMeasurement/ExpressionMeasurementClient.d.mts +1 -1
  437. package/dist/esm/wrapper/expressionMeasurement/ExpressionMeasurementClient.mjs +1 -1
  438. package/dist/esm/wrapper/expressionMeasurement/batch/BatchClient.d.mts +1 -1
  439. package/dist/esm/wrapper/expressionMeasurement/batch/BatchClient.mjs +1 -1
  440. package/dist/esm/wrapper/fetchAccessToken.mjs +3 -0
  441. package/package.json +5 -2
  442. package/reference.md +85 -669
  443. package/dist/cjs/core/fetcher/ResponseWithBody.d.ts +0 -4
  444. package/dist/cjs/core/fetcher/ResponseWithBody.js +0 -6
  445. package/dist/esm/core/fetcher/ResponseWithBody.d.mts +0 -4
  446. package/dist/esm/core/fetcher/ResponseWithBody.mjs +0 -3
@@ -1,28 +1,28 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
2
3
  import * as core from "../../../../core/index.mjs";
3
4
  import * as Hume from "../../../index.mjs";
4
- import { StreamInput } from "../resources/streamInput/client/Client.mjs";
5
- import { Voices } from "../resources/voices/client/Client.mjs";
6
- export declare namespace Tts {
7
- interface Options extends BaseClientOptions {
8
- }
5
+ import { StreamInputClient } from "../resources/streamInput/client/Client.mjs";
6
+ import { VoicesClient } from "../resources/voices/client/Client.mjs";
7
+ export declare namespace TtsClient {
8
+ type Options = BaseClientOptions;
9
9
  interface RequestOptions extends BaseRequestOptions {
10
10
  }
11
11
  }
12
- export declare class Tts {
13
- protected readonly _options: Tts.Options;
14
- protected _voices: Voices | undefined;
15
- protected _streamInput: StreamInput | undefined;
16
- constructor(_options?: Tts.Options);
17
- get voices(): Voices;
18
- get streamInput(): StreamInput;
12
+ export declare class TtsClient {
13
+ protected readonly _options: NormalizedClientOptionsWithAuth<TtsClient.Options>;
14
+ protected _voices: VoicesClient | undefined;
15
+ protected _streamInput: StreamInputClient | undefined;
16
+ constructor(options?: TtsClient.Options);
17
+ get voices(): VoicesClient;
18
+ get streamInput(): StreamInputClient;
19
19
  /**
20
20
  * Synthesizes one or more input texts into speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
21
21
  *
22
22
  * The response includes the base64-encoded audio and metadata in JSON format.
23
23
  *
24
24
  * @param {Hume.tts.PostedTts} request
25
- * @param {Tts.RequestOptions} requestOptions - Request-specific configuration.
25
+ * @param {TtsClient.RequestOptions} requestOptions - Request-specific configuration.
26
26
  *
27
27
  * @throws {@link Hume.tts.UnprocessableEntityError}
28
28
  *
@@ -44,7 +44,7 @@ export declare class Tts {
44
44
  * }]
45
45
  * })
46
46
  */
47
- synthesizeJson(request: Hume.tts.PostedTts, requestOptions?: Tts.RequestOptions): core.HttpResponsePromise<Hume.tts.ReturnTts>;
47
+ synthesizeJson(request: Hume.tts.PostedTts, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<Hume.tts.ReturnTts>;
48
48
  private __synthesizeJson;
49
49
  /**
50
50
  * Synthesizes one or more input texts into speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
@@ -52,27 +52,26 @@ export declare class Tts {
52
52
  * The response contains the generated audio file in the requested format.
53
53
  * @throws {@link Hume.tts.UnprocessableEntityError}
54
54
  */
55
- synthesizeFile(request: Hume.tts.PostedTts, requestOptions?: Tts.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
55
+ synthesizeFile(request: Hume.tts.PostedTts, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
56
56
  private __synthesizeFile;
57
57
  /**
58
58
  * Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
59
59
  * @throws {@link Hume.tts.UnprocessableEntityError}
60
60
  */
61
- synthesizeFileStreaming(request: Hume.tts.PostedTts, requestOptions?: Tts.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
61
+ synthesizeFileStreaming(request: Hume.tts.PostedTts, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
62
62
  private __synthesizeFileStreaming;
63
63
  /**
64
64
  * Streams synthesized speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
65
65
  *
66
66
  * The response is a stream of JSON objects including audio encoded in base64.
67
67
  */
68
- synthesizeJsonStreaming(request: Hume.tts.PostedTts, requestOptions?: Tts.RequestOptions): core.HttpResponsePromise<core.Stream<Hume.tts.TtsOutput>>;
68
+ synthesizeJsonStreaming(request: Hume.tts.PostedTts, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.Stream<Hume.tts.TtsOutput>>;
69
69
  private __synthesizeJsonStreaming;
70
70
  /**
71
71
  * @throws {@link Hume.tts.UnprocessableEntityError}
72
72
  */
73
- convertVoiceFile(request: Hume.tts.ConvertVoiceFileRequest, requestOptions?: Tts.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
73
+ convertVoiceFile(request: Hume.tts.ConvertVoiceFileRequest, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
74
74
  private __convertVoiceFile;
75
- convertVoiceJson(request: Hume.tts.ConvertVoiceJsonRequest, requestOptions?: Tts.RequestOptions): core.HttpResponsePromise<core.Stream<Hume.tts.TtsOutput>>;
75
+ convertVoiceJson(request: Hume.tts.ConvertVoiceJsonRequest, requestOptions?: TtsClient.RequestOptions): core.HttpResponsePromise<core.Stream<Hume.tts.TtsOutput>>;
76
76
  private __convertVoiceJson;
77
- protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | undefined>>;
78
77
  }
@@ -8,26 +8,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
11
12
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
13
  import * as core from "../../../../core/index.mjs";
13
14
  import { toJson } from "../../../../core/json.mjs";
14
15
  import * as environments from "../../../../environments.mjs";
16
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
15
17
  import * as errors from "../../../../errors/index.mjs";
16
18
  import * as serializers from "../../../../serialization/index.mjs";
17
19
  import * as Hume from "../../../index.mjs";
18
- import { StreamInput } from "../resources/streamInput/client/Client.mjs";
19
- import { Voices } from "../resources/voices/client/Client.mjs";
20
- export class Tts {
21
- constructor(_options = {}) {
22
- this._options = _options;
20
+ import { StreamInputClient } from "../resources/streamInput/client/Client.mjs";
21
+ import { VoicesClient } from "../resources/voices/client/Client.mjs";
22
+ export class TtsClient {
23
+ constructor(options = {}) {
24
+ this._options = normalizeClientOptionsWithAuth(options);
23
25
  }
24
26
  get voices() {
25
27
  var _a;
26
- return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new Voices(this._options)));
28
+ return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new VoicesClient(this._options)));
27
29
  }
28
30
  get streamInput() {
29
31
  var _a;
30
- return ((_a = this._streamInput) !== null && _a !== void 0 ? _a : (this._streamInput = new StreamInput(this._options)));
32
+ return ((_a = this._streamInput) !== null && _a !== void 0 ? _a : (this._streamInput = new StreamInputClient(this._options)));
31
33
  }
32
34
  /**
33
35
  * Synthesizes one or more input texts into speech using the specified voice. If no voice is provided, a novel voice will be generated dynamically. Optionally, additional context can be included to influence the speech's style and prosody.
@@ -35,7 +37,7 @@ export class Tts {
35
37
  * The response includes the base64-encoded audio and metadata in JSON format.
36
38
  *
37
39
  * @param {Hume.tts.PostedTts} request
38
- * @param {Tts.RequestOptions} requestOptions - Request-specific configuration.
40
+ * @param {TtsClient.RequestOptions} requestOptions - Request-specific configuration.
39
41
  *
40
42
  * @throws {@link Hume.tts.UnprocessableEntityError}
41
43
  *
@@ -63,7 +65,8 @@ export class Tts {
63
65
  __synthesizeJson(request, requestOptions) {
64
66
  return __awaiter(this, void 0, void 0, function* () {
65
67
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
66
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
68
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
69
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
67
70
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
68
71
  url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts"),
69
72
  method: "POST",
@@ -111,21 +114,7 @@ export class Tts {
111
114
  });
112
115
  }
113
116
  }
114
- switch (_response.error.reason) {
115
- case "non-json":
116
- throw new errors.HumeError({
117
- statusCode: _response.error.statusCode,
118
- body: _response.error.rawBody,
119
- rawResponse: _response.rawResponse,
120
- });
121
- case "timeout":
122
- throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts.");
123
- case "unknown":
124
- throw new errors.HumeError({
125
- message: _response.error.errorMessage,
126
- rawResponse: _response.rawResponse,
127
- });
128
- }
117
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts");
129
118
  });
130
119
  }
131
120
  /**
@@ -140,7 +129,8 @@ export class Tts {
140
129
  __synthesizeFile(request, requestOptions) {
141
130
  return __awaiter(this, void 0, void 0, function* () {
142
131
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
143
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
132
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
133
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
144
134
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
145
135
  url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/file"),
146
136
  method: "POST",
@@ -180,21 +170,7 @@ export class Tts {
180
170
  });
181
171
  }
182
172
  }
183
- switch (_response.error.reason) {
184
- case "non-json":
185
- throw new errors.HumeError({
186
- statusCode: _response.error.statusCode,
187
- body: _response.error.rawBody,
188
- rawResponse: _response.rawResponse,
189
- });
190
- case "timeout":
191
- throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/file.");
192
- case "unknown":
193
- throw new errors.HumeError({
194
- message: _response.error.errorMessage,
195
- rawResponse: _response.rawResponse,
196
- });
197
- }
173
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/file");
198
174
  });
199
175
  }
200
176
  /**
@@ -207,7 +183,8 @@ export class Tts {
207
183
  __synthesizeFileStreaming(request, requestOptions) {
208
184
  return __awaiter(this, void 0, void 0, function* () {
209
185
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
210
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
186
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
187
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
211
188
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
212
189
  url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/stream/file"),
213
190
  method: "POST",
@@ -247,21 +224,7 @@ export class Tts {
247
224
  });
248
225
  }
249
226
  }
250
- switch (_response.error.reason) {
251
- case "non-json":
252
- throw new errors.HumeError({
253
- statusCode: _response.error.statusCode,
254
- body: _response.error.rawBody,
255
- rawResponse: _response.rawResponse,
256
- });
257
- case "timeout":
258
- throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/stream/file.");
259
- case "unknown":
260
- throw new errors.HumeError({
261
- message: _response.error.errorMessage,
262
- rawResponse: _response.rawResponse,
263
- });
264
- }
227
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/stream/file");
265
228
  });
266
229
  }
267
230
  /**
@@ -275,7 +238,8 @@ export class Tts {
275
238
  __synthesizeJsonStreaming(request, requestOptions) {
276
239
  return __awaiter(this, void 0, void 0, function* () {
277
240
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
278
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
241
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
242
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
279
243
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
280
244
  url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/stream/json"),
281
245
  method: "POST",
@@ -334,21 +298,7 @@ export class Tts {
334
298
  });
335
299
  }
336
300
  }
337
- switch (_response.error.reason) {
338
- case "non-json":
339
- throw new errors.HumeError({
340
- statusCode: _response.error.statusCode,
341
- body: _response.error.rawBody,
342
- rawResponse: _response.rawResponse,
343
- });
344
- case "timeout":
345
- throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/stream/json.");
346
- case "unknown":
347
- throw new errors.HumeError({
348
- message: _response.error.errorMessage,
349
- rawResponse: _response.rawResponse,
350
- });
351
- }
301
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/stream/json");
352
302
  });
353
303
  }
354
304
  /**
@@ -359,14 +309,14 @@ export class Tts {
359
309
  }
360
310
  __convertVoiceFile(request, requestOptions) {
361
311
  return __awaiter(this, void 0, void 0, function* () {
362
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
363
- const _request = yield core.newFormData();
312
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
313
+ const _body = yield core.newFormData();
364
314
  if (request.stripHeaders != null) {
365
- _request.append("strip_headers", request.stripHeaders.toString());
315
+ _body.append("strip_headers", (_a = request.stripHeaders) === null || _a === void 0 ? void 0 : _a.toString());
366
316
  }
367
- yield _request.appendFile("audio", request.audio);
317
+ yield _body.appendFile("audio", request.audio);
368
318
  if (request.context != null) {
369
- _request.append("context", (() => {
319
+ _body.append("context", (() => {
370
320
  const mapped = serializers.tts.PostedContext.jsonOrThrow(request.context, {
371
321
  unrecognizedObjectKeys: "strip",
372
322
  omitUndefined: true,
@@ -375,7 +325,7 @@ export class Tts {
375
325
  })());
376
326
  }
377
327
  if (request.voice != null) {
378
- _request.append("voice", (() => {
328
+ _body.append("voice", (() => {
379
329
  const mapped = serializers.tts.PostedUtteranceVoice.jsonOrThrow(request.voice, {
380
330
  unrecognizedObjectKeys: "strip",
381
331
  omitUndefined: true,
@@ -384,7 +334,7 @@ export class Tts {
384
334
  })());
385
335
  }
386
336
  if (request.format != null) {
387
- _request.append("format", (() => {
337
+ _body.append("format", (() => {
388
338
  const mapped = serializers.tts.Format.jsonOrThrow(request.format, {
389
339
  unrecognizedObjectKeys: "strip",
390
340
  omitUndefined: true,
@@ -394,16 +344,17 @@ export class Tts {
394
344
  }
395
345
  if (request.includeTimestampTypes != null) {
396
346
  for (const _item of request.includeTimestampTypes) {
397
- _request.append("include_timestamp_types", serializers.tts.TimestampType.jsonOrThrow(_item, {
347
+ _body.append("include_timestamp_types", serializers.tts.TimestampType.jsonOrThrow(_item, {
398
348
  unrecognizedObjectKeys: "strip",
399
349
  omitUndefined: true,
400
350
  }));
401
351
  }
402
352
  }
403
- const _maybeEncodedRequest = yield _request.getRequest();
404
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign(Object.assign({}, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
405
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
406
- url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/voice_conversion/file"),
353
+ const _maybeEncodedRequest = yield _body.getRequest();
354
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
355
+ const _headers = mergeHeaders(_authRequest.headers, (_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
356
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
357
+ url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.HumeEnvironment.Prod).base, "v0/tts/voice_conversion/file"),
407
358
  method: "POST",
408
359
  headers: _headers,
409
360
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -411,10 +362,10 @@ export class Tts {
411
362
  duplex: _maybeEncodedRequest.duplex,
412
363
  body: _maybeEncodedRequest.body,
413
364
  responseType: "binary-response",
414
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
415
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
365
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
366
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
416
367
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
417
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
368
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
418
369
  logging: this._options.logging,
419
370
  });
420
371
  if (_response.ok) {
@@ -438,21 +389,7 @@ export class Tts {
438
389
  });
439
390
  }
440
391
  }
441
- switch (_response.error.reason) {
442
- case "non-json":
443
- throw new errors.HumeError({
444
- statusCode: _response.error.statusCode,
445
- body: _response.error.rawBody,
446
- rawResponse: _response.rawResponse,
447
- });
448
- case "timeout":
449
- throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/voice_conversion/file.");
450
- case "unknown":
451
- throw new errors.HumeError({
452
- message: _response.error.errorMessage,
453
- rawResponse: _response.rawResponse,
454
- });
455
- }
392
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/voice_conversion/file");
456
393
  });
457
394
  }
458
395
  convertVoiceJson(request, requestOptions) {
@@ -460,16 +397,16 @@ export class Tts {
460
397
  }
461
398
  __convertVoiceJson(request, requestOptions) {
462
399
  return __awaiter(this, void 0, void 0, function* () {
463
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
464
- const _request = yield core.newFormData();
400
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
401
+ const _body = yield core.newFormData();
465
402
  if (request.stripHeaders != null) {
466
- _request.append("strip_headers", request.stripHeaders.toString());
403
+ _body.append("strip_headers", (_a = request.stripHeaders) === null || _a === void 0 ? void 0 : _a.toString());
467
404
  }
468
405
  if (request.audio != null) {
469
- yield _request.appendFile("audio", request.audio);
406
+ yield _body.appendFile("audio", request.audio);
470
407
  }
471
408
  if (request.context != null) {
472
- _request.append("context", (() => {
409
+ _body.append("context", (() => {
473
410
  const mapped = serializers.tts.PostedContext.jsonOrThrow(request.context, {
474
411
  unrecognizedObjectKeys: "strip",
475
412
  omitUndefined: true,
@@ -478,7 +415,7 @@ export class Tts {
478
415
  })());
479
416
  }
480
417
  if (request.voice != null) {
481
- _request.append("voice", (() => {
418
+ _body.append("voice", (() => {
482
419
  const mapped = serializers.tts.PostedUtteranceVoice.jsonOrThrow(request.voice, {
483
420
  unrecognizedObjectKeys: "strip",
484
421
  omitUndefined: true,
@@ -487,7 +424,7 @@ export class Tts {
487
424
  })());
488
425
  }
489
426
  if (request.format != null) {
490
- _request.append("format", (() => {
427
+ _body.append("format", (() => {
491
428
  const mapped = serializers.tts.Format.jsonOrThrow(request.format, {
492
429
  unrecognizedObjectKeys: "strip",
493
430
  omitUndefined: true,
@@ -497,16 +434,17 @@ export class Tts {
497
434
  }
498
435
  if (request.includeTimestampTypes != null) {
499
436
  for (const _item of request.includeTimestampTypes) {
500
- _request.append("include_timestamp_types", serializers.tts.TimestampType.jsonOrThrow(_item, {
437
+ _body.append("include_timestamp_types", serializers.tts.TimestampType.jsonOrThrow(_item, {
501
438
  unrecognizedObjectKeys: "strip",
502
439
  omitUndefined: true,
503
440
  }));
504
441
  }
505
442
  }
506
- const _maybeEncodedRequest = yield _request.getRequest();
507
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign(Object.assign({}, (yield this._getCustomAuthorizationHeaders())), _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
508
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
509
- url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.HumeEnvironment.Prod).base, "v0/tts/voice_conversion/json"),
443
+ const _maybeEncodedRequest = yield _body.getRequest();
444
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
445
+ const _headers = mergeHeaders(_authRequest.headers, (_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, mergeOnlyDefinedHeaders(Object.assign({}, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
446
+ const _response = yield ((_c = this._options.fetcher) !== null && _c !== void 0 ? _c : core.fetcher)({
447
+ url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.HumeEnvironment.Prod).base, "v0/tts/voice_conversion/json"),
510
448
  method: "POST",
511
449
  headers: _headers,
512
450
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
@@ -514,10 +452,10 @@ export class Tts {
514
452
  duplex: _maybeEncodedRequest.duplex,
515
453
  body: _maybeEncodedRequest.body,
516
454
  responseType: "sse",
517
- timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
518
- maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
455
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
456
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
519
457
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
520
- fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
458
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
521
459
  logging: this._options.logging,
522
460
  });
523
461
  if (_response.ok) {
@@ -560,27 +498,7 @@ export class Tts {
560
498
  });
561
499
  }
562
500
  }
563
- switch (_response.error.reason) {
564
- case "non-json":
565
- throw new errors.HumeError({
566
- statusCode: _response.error.statusCode,
567
- body: _response.error.rawBody,
568
- rawResponse: _response.rawResponse,
569
- });
570
- case "timeout":
571
- throw new errors.HumeTimeoutError("Timeout exceeded when calling POST /v0/tts/voice_conversion/json.");
572
- case "unknown":
573
- throw new errors.HumeError({
574
- message: _response.error.errorMessage,
575
- rawResponse: _response.rawResponse,
576
- });
577
- }
578
- });
579
- }
580
- _getCustomAuthorizationHeaders() {
581
- return __awaiter(this, void 0, void 0, function* () {
582
- const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
583
- return { "X-Hume-Api-Key": apiKeyValue };
501
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v0/tts/voice_conversion/json");
584
502
  });
585
503
  }
586
504
  }
@@ -8,6 +8,10 @@ export class BadRequestError extends errors.HumeError {
8
8
  body: body,
9
9
  rawResponse: rawResponse,
10
10
  });
11
- Object.setPrototypeOf(this, BadRequestError.prototype);
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = this.constructor.name;
12
16
  }
13
17
  }
@@ -8,6 +8,10 @@ export class UnprocessableEntityError extends errors.HumeError {
8
8
  body: body,
9
9
  rawResponse: rawResponse,
10
10
  });
11
- Object.setPrototypeOf(this, UnprocessableEntityError.prototype);
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = this.constructor.name;
12
16
  }
13
17
  }
@@ -1,19 +1,20 @@
1
1
  import type { BaseClientOptions } from "../../../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptions } from "../../../../../../BaseClient.mjs";
2
3
  import type * as Hume from "../../../../../index.mjs";
3
4
  import { StreamInputSocket } from "./Socket.mjs";
4
- export declare namespace StreamInput {
5
+ export declare namespace StreamInputClient {
5
6
  interface Options extends BaseClientOptions {
6
7
  }
7
8
  interface ConnectArgs {
8
- accessToken?: string | undefined;
9
- contextGenerationId?: string | undefined;
10
- formatType?: Hume.tts.AudioFormatType | undefined;
11
- includeTimestampTypes?: Hume.tts.TimestampType | undefined;
12
- instantMode?: boolean | undefined;
13
- noBinary?: boolean | undefined;
14
- stripHeaders?: boolean | undefined;
15
- version?: Hume.tts.OctaveVersion | undefined;
16
- apiKey?: string | undefined;
9
+ accessToken?: string;
10
+ contextGenerationId?: string;
11
+ formatType?: Hume.tts.AudioFormatType;
12
+ includeTimestampTypes?: Hume.tts.TimestampType | Hume.tts.TimestampType[];
13
+ instantMode?: boolean;
14
+ noBinary?: boolean;
15
+ stripHeaders?: boolean;
16
+ version?: Hume.tts.OctaveVersion;
17
+ apiKey?: string;
17
18
  /** Arbitrary headers to send with the websocket connect request. */
18
19
  headers?: Record<string, string>;
19
20
  /** Enable debug mode on the websocket. Defaults to false. */
@@ -22,9 +23,9 @@ export declare namespace StreamInput {
22
23
  reconnectAttempts?: number;
23
24
  }
24
25
  }
25
- export declare class StreamInput {
26
- protected readonly _options: StreamInput.Options;
27
- constructor(_options?: StreamInput.Options);
28
- connect(args?: StreamInput.ConnectArgs): Promise<StreamInputSocket>;
26
+ export declare class StreamInputClient {
27
+ protected readonly _options: NormalizedClientOptions<StreamInputClient.Options>;
28
+ constructor(options?: StreamInputClient.Options);
29
+ connect(args?: StreamInputClient.ConnectArgs): Promise<StreamInputSocket>;
29
30
  protected _getCustomAuthorizationHeaders(): Promise<Record<string, string | null | undefined>>;
30
31
  }
@@ -8,14 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ import { normalizeClientOptions } from "../../../../../../BaseClient.mjs";
11
12
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
12
13
  import * as core from "../../../../../../core/index.mjs";
13
14
  import * as environments from "../../../../../../environments.mjs";
14
15
  import * as serializers from "../../../../../../serialization/index.mjs";
15
16
  import { StreamInputSocket } from "./Socket.mjs";
16
- export class StreamInput {
17
- constructor(_options = {}) {
18
- this._options = _options;
17
+ export class StreamInputClient {
18
+ constructor(options = {}) {
19
+ this._options = normalizeClientOptions(options);
19
20
  }
20
21
  connect() {
21
22
  return __awaiter(this, arguments, void 0, function* (args = {}) {
@@ -42,7 +43,10 @@ export class StreamInput {
42
43
  }));
43
44
  }
44
45
  else {
45
- _queryParams.include_timestamp_types = serializers.tts.TimestampType.jsonOrThrow(includeTimestampTypes, { unrecognizedObjectKeys: "strip", omitUndefined: true });
46
+ _queryParams.include_timestamp_types = serializers.tts.TimestampType.jsonOrThrow(includeTimestampTypes, {
47
+ unrecognizedObjectKeys: "strip",
48
+ omitUndefined: true,
49
+ });
46
50
  }
47
51
  }
48
52
  if (instantMode != null) {