hume 0.9.10 → 0.9.11

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 (349) hide show
  1. package/.mock/definition/empathic-voice/__package__.yml +87 -26
  2. package/.mock/definition/empathic-voice/chat.yml +5 -1
  3. package/.mock/definition/empathic-voice/chatGroups.yml +6 -0
  4. package/.mock/definition/empathic-voice/chatWebhooks.yml +24 -13
  5. package/.mock/definition/empathic-voice/chats.yml +3 -0
  6. package/.mock/definition/empathic-voice/configs.yml +8 -1
  7. package/.mock/definition/empathic-voice/customVoices.yml +23 -12
  8. package/.mock/definition/empathic-voice/prompts.yml +29 -21
  9. package/.mock/definition/empathic-voice/tools.yml +34 -27
  10. package/.mock/definition/expression-measurement/batch/__package__.yml +23 -0
  11. package/.mock/definition/expression-measurement/stream/__package__.yml +0 -435
  12. package/.mock/definition/expression-measurement/v0StreamModels.yml +437 -0
  13. package/.mock/definition/tts/__package__.yml +394 -0
  14. package/.mock/definition/tts/voices.yml +47 -0
  15. package/.mock/fern.config.json +1 -1
  16. package/Client.d.ts +3 -0
  17. package/Client.js +5 -0
  18. package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +4 -4
  19. package/api/resources/empathicVoice/resources/chats/client/Client.js +3 -3
  20. package/api/resources/empathicVoice/resources/configs/client/Client.js +9 -9
  21. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -1
  22. package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +11 -6
  23. package/api/resources/empathicVoice/resources/customVoices/client/Client.js +17 -12
  24. package/api/resources/empathicVoice/resources/customVoices/client/requests/PostedCustomVoiceName.d.ts +6 -0
  25. package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +11 -11
  26. package/api/resources/empathicVoice/resources/prompts/client/Client.js +21 -21
  27. package/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.ts +1 -1
  28. package/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.ts +1 -1
  29. package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +9 -9
  30. package/api/resources/empathicVoice/resources/tools/client/Client.js +18 -18
  31. package/api/resources/empathicVoice/types/Context.d.ts +2 -2
  32. package/api/resources/empathicVoice/types/PostedBuiltinTool.d.ts +1 -1
  33. package/api/resources/empathicVoice/types/PostedBuiltinToolName.d.ts +1 -1
  34. package/api/resources/empathicVoice/types/PostedCustomVoice.d.ts +1 -1
  35. package/api/resources/empathicVoice/types/PostedWebhookSpec.d.ts +6 -2
  36. package/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -1
  37. package/api/resources/empathicVoice/types/ReturnPrompt.d.ts +1 -1
  38. package/api/resources/empathicVoice/types/ReturnWebhookSpec.d.ts +6 -2
  39. package/api/resources/empathicVoice/types/SessionSettings.d.ts +7 -7
  40. package/api/resources/empathicVoice/types/WebhookEventChatEnded.d.ts +5 -0
  41. package/api/resources/empathicVoice/types/WebhookEventChatStarted.d.ts +2 -2
  42. package/api/resources/index.d.ts +2 -1
  43. package/api/resources/index.js +3 -2
  44. package/api/resources/tts/client/Client.d.ts +86 -0
  45. package/api/resources/tts/client/Client.js +218 -0
  46. package/api/resources/tts/client/index.d.ts +1 -0
  47. package/api/resources/tts/client/index.js +2 -0
  48. package/api/resources/tts/errors/UnprocessableEntityError.d.ts +8 -0
  49. package/api/resources/tts/errors/UnprocessableEntityError.js +41 -0
  50. package/api/resources/tts/errors/index.d.ts +1 -0
  51. package/api/resources/tts/errors/index.js +17 -0
  52. package/api/resources/tts/index.d.ts +4 -0
  53. package/api/resources/tts/index.js +20 -0
  54. package/api/resources/tts/resources/index.d.ts +2 -0
  55. package/api/resources/tts/resources/index.js +31 -0
  56. package/api/resources/tts/resources/voices/client/Client.d.ts +43 -0
  57. package/api/resources/tts/resources/voices/client/Client.js +126 -0
  58. package/api/resources/tts/resources/voices/client/index.d.ts +1 -0
  59. package/api/resources/tts/resources/voices/client/index.js +17 -0
  60. package/api/resources/tts/resources/voices/client/requests/PostedVoice.d.ts +16 -0
  61. package/api/resources/tts/resources/voices/client/requests/PostedVoice.js +5 -0
  62. package/api/resources/tts/resources/voices/client/requests/index.d.ts +1 -0
  63. package/api/resources/tts/resources/voices/client/requests/index.js +2 -0
  64. package/api/resources/tts/resources/voices/index.d.ts +1 -0
  65. package/api/resources/tts/resources/voices/index.js +17 -0
  66. package/api/resources/tts/types/AudioEncoding.d.ts +10 -0
  67. package/api/resources/tts/types/AudioEncoding.js +5 -0
  68. package/api/resources/tts/types/AudioFormatType.d.ts +9 -0
  69. package/api/resources/tts/types/AudioFormatType.js +11 -0
  70. package/api/resources/tts/types/Format.d.ts +19 -0
  71. package/api/resources/tts/types/Format.js +5 -0
  72. package/api/resources/tts/types/FormatMp3.d.ts +5 -0
  73. package/api/resources/tts/types/FormatMp3.js +5 -0
  74. package/api/resources/tts/types/FormatPcm.d.ts +5 -0
  75. package/api/resources/tts/types/FormatPcm.js +5 -0
  76. package/api/resources/tts/types/FormatWav.d.ts +5 -0
  77. package/api/resources/tts/types/FormatWav.js +5 -0
  78. package/api/resources/tts/types/HttpValidationError.d.ts +7 -0
  79. package/api/resources/tts/types/HttpValidationError.js +5 -0
  80. package/api/resources/tts/types/PostedContext.d.ts +8 -0
  81. package/api/resources/tts/types/PostedContext.js +5 -0
  82. package/api/resources/tts/types/PostedContextWithGenerationId.d.ts +7 -0
  83. package/api/resources/tts/types/PostedContextWithGenerationId.js +5 -0
  84. package/api/resources/tts/types/PostedContextWithUtterances.d.ts +7 -0
  85. package/api/resources/tts/types/PostedContextWithUtterances.js +5 -0
  86. package/api/resources/tts/types/PostedTts.d.ts +14 -0
  87. package/api/resources/tts/types/PostedTts.js +5 -0
  88. package/api/resources/tts/types/PostedTtsRecord.d.ts +11 -0
  89. package/api/resources/tts/types/PostedTtsRecord.js +5 -0
  90. package/api/resources/tts/types/PostedUtterance.d.ts +22 -0
  91. package/api/resources/tts/types/PostedUtterance.js +5 -0
  92. package/api/resources/tts/types/PostedUtteranceVoice.d.ts +5 -0
  93. package/api/resources/tts/types/PostedUtteranceVoice.js +5 -0
  94. package/api/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +20 -0
  95. package/api/resources/tts/types/PostedUtteranceVoiceWithId.js +5 -0
  96. package/api/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +20 -0
  97. package/api/resources/tts/types/PostedUtteranceVoiceWithName.js +5 -0
  98. package/api/resources/tts/types/ReturnGeneration.d.ts +17 -0
  99. package/api/resources/tts/types/ReturnGeneration.js +5 -0
  100. package/api/resources/tts/types/ReturnTts.d.ts +9 -0
  101. package/api/resources/tts/types/ReturnTts.js +5 -0
  102. package/api/resources/tts/types/ReturnVoice.d.ts +9 -0
  103. package/api/resources/tts/types/ReturnVoice.js +5 -0
  104. package/api/resources/tts/types/Snippet.d.ts +11 -0
  105. package/api/resources/tts/types/Snippet.js +5 -0
  106. package/api/resources/tts/types/ValidationError.d.ts +9 -0
  107. package/api/resources/tts/types/ValidationError.js +5 -0
  108. package/api/resources/tts/types/ValidationErrorLocItem.d.ts +4 -0
  109. package/api/resources/tts/types/ValidationErrorLocItem.js +5 -0
  110. package/api/resources/tts/types/VoiceProvider.d.ts +8 -0
  111. package/api/resources/tts/types/VoiceProvider.js +10 -0
  112. package/api/resources/tts/types/index.d.ts +23 -0
  113. package/api/resources/tts/types/index.js +39 -0
  114. package/dist/Client.d.ts +3 -0
  115. package/dist/Client.js +5 -0
  116. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +4 -4
  117. package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +3 -3
  118. package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +9 -9
  119. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -1
  120. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +11 -6
  121. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +17 -12
  122. package/dist/api/resources/empathicVoice/resources/customVoices/client/requests/PostedCustomVoiceName.d.ts +6 -0
  123. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +11 -11
  124. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +21 -21
  125. package/dist/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.ts +1 -1
  126. package/dist/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.ts +1 -1
  127. package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +9 -9
  128. package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +18 -18
  129. package/dist/api/resources/empathicVoice/types/Context.d.ts +2 -2
  130. package/dist/api/resources/empathicVoice/types/PostedBuiltinTool.d.ts +1 -1
  131. package/dist/api/resources/empathicVoice/types/PostedBuiltinToolName.d.ts +1 -1
  132. package/dist/api/resources/empathicVoice/types/PostedCustomVoice.d.ts +1 -1
  133. package/dist/api/resources/empathicVoice/types/PostedWebhookSpec.d.ts +6 -2
  134. package/dist/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -1
  135. package/dist/api/resources/empathicVoice/types/ReturnPrompt.d.ts +1 -1
  136. package/dist/api/resources/empathicVoice/types/ReturnWebhookSpec.d.ts +6 -2
  137. package/dist/api/resources/empathicVoice/types/SessionSettings.d.ts +7 -7
  138. package/dist/api/resources/empathicVoice/types/WebhookEventChatEnded.d.ts +5 -0
  139. package/dist/api/resources/empathicVoice/types/WebhookEventChatStarted.d.ts +2 -2
  140. package/dist/api/resources/index.d.ts +2 -1
  141. package/dist/api/resources/index.js +3 -2
  142. package/dist/api/resources/tts/client/Client.d.ts +86 -0
  143. package/dist/api/resources/tts/client/Client.js +218 -0
  144. package/dist/api/resources/tts/client/index.d.ts +1 -0
  145. package/dist/api/resources/tts/client/index.js +2 -0
  146. package/dist/api/resources/tts/errors/UnprocessableEntityError.d.ts +8 -0
  147. package/dist/api/resources/tts/errors/UnprocessableEntityError.js +41 -0
  148. package/dist/api/resources/tts/errors/index.d.ts +1 -0
  149. package/dist/api/resources/tts/errors/index.js +17 -0
  150. package/dist/api/resources/tts/index.d.ts +4 -0
  151. package/dist/api/resources/tts/index.js +20 -0
  152. package/dist/api/resources/tts/resources/index.d.ts +2 -0
  153. package/dist/api/resources/tts/resources/index.js +31 -0
  154. package/dist/api/resources/tts/resources/voices/client/Client.d.ts +43 -0
  155. package/dist/api/resources/tts/resources/voices/client/Client.js +126 -0
  156. package/dist/api/resources/tts/resources/voices/client/index.d.ts +1 -0
  157. package/dist/api/resources/tts/resources/voices/client/index.js +17 -0
  158. package/dist/api/resources/tts/resources/voices/client/requests/PostedVoice.d.ts +16 -0
  159. package/dist/api/resources/tts/resources/voices/client/requests/PostedVoice.js +5 -0
  160. package/dist/api/resources/tts/resources/voices/client/requests/index.d.ts +1 -0
  161. package/dist/api/resources/tts/resources/voices/client/requests/index.js +2 -0
  162. package/dist/api/resources/tts/resources/voices/index.d.ts +1 -0
  163. package/dist/api/resources/tts/resources/voices/index.js +17 -0
  164. package/dist/api/resources/tts/types/AudioEncoding.d.ts +10 -0
  165. package/dist/api/resources/tts/types/AudioEncoding.js +5 -0
  166. package/dist/api/resources/tts/types/AudioFormatType.d.ts +9 -0
  167. package/dist/api/resources/tts/types/AudioFormatType.js +11 -0
  168. package/dist/api/resources/tts/types/Format.d.ts +19 -0
  169. package/dist/api/resources/tts/types/Format.js +5 -0
  170. package/dist/api/resources/tts/types/FormatMp3.d.ts +5 -0
  171. package/dist/api/resources/tts/types/FormatMp3.js +5 -0
  172. package/dist/api/resources/tts/types/FormatPcm.d.ts +5 -0
  173. package/dist/api/resources/tts/types/FormatPcm.js +5 -0
  174. package/dist/api/resources/tts/types/FormatWav.d.ts +5 -0
  175. package/dist/api/resources/tts/types/FormatWav.js +5 -0
  176. package/dist/api/resources/tts/types/HttpValidationError.d.ts +7 -0
  177. package/dist/api/resources/tts/types/HttpValidationError.js +5 -0
  178. package/dist/api/resources/tts/types/PostedContext.d.ts +8 -0
  179. package/dist/api/resources/tts/types/PostedContext.js +5 -0
  180. package/dist/api/resources/tts/types/PostedContextWithGenerationId.d.ts +7 -0
  181. package/dist/api/resources/tts/types/PostedContextWithGenerationId.js +5 -0
  182. package/dist/api/resources/tts/types/PostedContextWithUtterances.d.ts +7 -0
  183. package/dist/api/resources/tts/types/PostedContextWithUtterances.js +5 -0
  184. package/dist/api/resources/tts/types/PostedTts.d.ts +14 -0
  185. package/dist/api/resources/tts/types/PostedTts.js +5 -0
  186. package/dist/api/resources/tts/types/PostedTtsRecord.d.ts +11 -0
  187. package/dist/api/resources/tts/types/PostedTtsRecord.js +5 -0
  188. package/dist/api/resources/tts/types/PostedUtterance.d.ts +22 -0
  189. package/dist/api/resources/tts/types/PostedUtterance.js +5 -0
  190. package/dist/api/resources/tts/types/PostedUtteranceVoice.d.ts +5 -0
  191. package/dist/api/resources/tts/types/PostedUtteranceVoice.js +5 -0
  192. package/dist/api/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +20 -0
  193. package/dist/api/resources/tts/types/PostedUtteranceVoiceWithId.js +5 -0
  194. package/dist/api/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +20 -0
  195. package/dist/api/resources/tts/types/PostedUtteranceVoiceWithName.js +5 -0
  196. package/dist/api/resources/tts/types/ReturnGeneration.d.ts +17 -0
  197. package/dist/api/resources/tts/types/ReturnGeneration.js +5 -0
  198. package/dist/api/resources/tts/types/ReturnTts.d.ts +9 -0
  199. package/dist/api/resources/tts/types/ReturnTts.js +5 -0
  200. package/dist/api/resources/tts/types/ReturnVoice.d.ts +9 -0
  201. package/dist/api/resources/tts/types/ReturnVoice.js +5 -0
  202. package/dist/api/resources/tts/types/Snippet.d.ts +11 -0
  203. package/dist/api/resources/tts/types/Snippet.js +5 -0
  204. package/dist/api/resources/tts/types/ValidationError.d.ts +9 -0
  205. package/dist/api/resources/tts/types/ValidationError.js +5 -0
  206. package/dist/api/resources/tts/types/ValidationErrorLocItem.d.ts +4 -0
  207. package/dist/api/resources/tts/types/ValidationErrorLocItem.js +5 -0
  208. package/dist/api/resources/tts/types/VoiceProvider.d.ts +8 -0
  209. package/dist/api/resources/tts/types/VoiceProvider.js +10 -0
  210. package/dist/api/resources/tts/types/index.d.ts +23 -0
  211. package/dist/api/resources/tts/types/index.js +39 -0
  212. package/dist/serialization/resources/empathicVoice/resources/prompts/client/{createPromptVerison.d.ts → createPromptVersion.d.ts} +1 -1
  213. package/dist/serialization/resources/empathicVoice/resources/prompts/client/index.d.ts +1 -1
  214. package/dist/serialization/resources/empathicVoice/resources/prompts/client/index.js +2 -2
  215. package/dist/serialization/resources/index.d.ts +2 -1
  216. package/dist/serialization/resources/index.js +3 -2
  217. package/dist/serialization/resources/tts/index.d.ts +2 -0
  218. package/dist/serialization/resources/tts/index.js +18 -0
  219. package/dist/serialization/resources/tts/resources/index.d.ts +2 -0
  220. package/dist/serialization/resources/tts/resources/index.js +31 -0
  221. package/dist/serialization/resources/tts/resources/voices/client/index.d.ts +1 -0
  222. package/dist/serialization/resources/tts/resources/voices/client/index.js +17 -0
  223. package/dist/serialization/resources/tts/resources/voices/client/requests/PostedVoice.d.ts +13 -0
  224. package/dist/serialization/resources/tts/resources/voices/client/requests/PostedVoice.js +34 -0
  225. package/dist/serialization/resources/tts/resources/voices/client/requests/index.d.ts +1 -0
  226. package/dist/serialization/resources/tts/resources/voices/client/requests/index.js +5 -0
  227. package/dist/serialization/resources/tts/resources/voices/index.d.ts +1 -0
  228. package/dist/serialization/resources/tts/resources/voices/index.js +17 -0
  229. package/dist/serialization/resources/tts/types/AudioEncoding.d.ts +14 -0
  230. package/dist/serialization/resources/tts/types/AudioEncoding.js +35 -0
  231. package/dist/serialization/resources/tts/types/AudioFormatType.d.ts +10 -0
  232. package/dist/serialization/resources/tts/types/AudioFormatType.js +31 -0
  233. package/dist/serialization/resources/tts/types/Format.d.ts +22 -0
  234. package/dist/serialization/resources/tts/types/Format.js +43 -0
  235. package/dist/serialization/resources/tts/types/FormatMp3.d.ts +11 -0
  236. package/dist/serialization/resources/tts/types/FormatMp3.js +31 -0
  237. package/dist/serialization/resources/tts/types/FormatPcm.d.ts +11 -0
  238. package/dist/serialization/resources/tts/types/FormatPcm.js +31 -0
  239. package/dist/serialization/resources/tts/types/FormatWav.d.ts +11 -0
  240. package/dist/serialization/resources/tts/types/FormatWav.js +31 -0
  241. package/dist/serialization/resources/tts/types/HttpValidationError.d.ts +13 -0
  242. package/dist/serialization/resources/tts/types/HttpValidationError.js +34 -0
  243. package/dist/serialization/resources/tts/types/PostedContext.d.ts +12 -0
  244. package/dist/serialization/resources/tts/types/PostedContext.js +33 -0
  245. package/dist/serialization/resources/tts/types/PostedContextWithGenerationId.d.ts +12 -0
  246. package/dist/serialization/resources/tts/types/PostedContextWithGenerationId.js +33 -0
  247. package/dist/serialization/resources/tts/types/PostedContextWithUtterances.d.ts +13 -0
  248. package/dist/serialization/resources/tts/types/PostedContextWithUtterances.js +34 -0
  249. package/dist/serialization/resources/tts/types/PostedTts.d.ts +18 -0
  250. package/dist/serialization/resources/tts/types/PostedTts.js +39 -0
  251. package/dist/serialization/resources/tts/types/PostedTtsRecord.d.ts +17 -0
  252. package/dist/serialization/resources/tts/types/PostedTtsRecord.js +38 -0
  253. package/dist/serialization/resources/tts/types/PostedUtterance.d.ts +15 -0
  254. package/dist/serialization/resources/tts/types/PostedUtterance.js +36 -0
  255. package/dist/serialization/resources/tts/types/PostedUtteranceVoice.d.ts +12 -0
  256. package/dist/serialization/resources/tts/types/PostedUtteranceVoice.js +33 -0
  257. package/dist/serialization/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +14 -0
  258. package/dist/serialization/resources/tts/types/PostedUtteranceVoiceWithId.js +35 -0
  259. package/dist/serialization/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +14 -0
  260. package/dist/serialization/resources/tts/types/PostedUtteranceVoiceWithName.js +35 -0
  261. package/dist/serialization/resources/tts/types/ReturnGeneration.d.ts +19 -0
  262. package/dist/serialization/resources/tts/types/ReturnGeneration.js +40 -0
  263. package/dist/serialization/resources/tts/types/ReturnTts.d.ts +14 -0
  264. package/dist/serialization/resources/tts/types/ReturnTts.js +35 -0
  265. package/dist/serialization/resources/tts/types/ReturnVoice.d.ts +13 -0
  266. package/dist/serialization/resources/tts/types/ReturnVoice.js +34 -0
  267. package/dist/serialization/resources/tts/types/Snippet.d.ts +14 -0
  268. package/dist/serialization/resources/tts/types/Snippet.js +35 -0
  269. package/dist/serialization/resources/tts/types/ValidationError.d.ts +15 -0
  270. package/dist/serialization/resources/tts/types/ValidationError.js +36 -0
  271. package/dist/serialization/resources/tts/types/ValidationErrorLocItem.d.ts +10 -0
  272. package/dist/serialization/resources/tts/types/ValidationErrorLocItem.js +31 -0
  273. package/dist/serialization/resources/tts/types/VoiceProvider.d.ts +10 -0
  274. package/dist/serialization/resources/tts/types/VoiceProvider.js +31 -0
  275. package/dist/serialization/resources/tts/types/index.d.ts +23 -0
  276. package/dist/serialization/resources/tts/types/index.js +39 -0
  277. package/dist/version.d.ts +1 -1
  278. package/dist/version.js +1 -1
  279. package/package.json +1 -1
  280. package/reference.md +489 -178
  281. package/serialization/resources/empathicVoice/resources/prompts/client/{createPromptVerison.d.ts → createPromptVersion.d.ts} +1 -1
  282. package/serialization/resources/empathicVoice/resources/prompts/client/index.d.ts +1 -1
  283. package/serialization/resources/empathicVoice/resources/prompts/client/index.js +2 -2
  284. package/serialization/resources/index.d.ts +2 -1
  285. package/serialization/resources/index.js +3 -2
  286. package/serialization/resources/tts/index.d.ts +2 -0
  287. package/serialization/resources/tts/index.js +18 -0
  288. package/serialization/resources/tts/resources/index.d.ts +2 -0
  289. package/serialization/resources/tts/resources/index.js +31 -0
  290. package/serialization/resources/tts/resources/voices/client/index.d.ts +1 -0
  291. package/serialization/resources/tts/resources/voices/client/index.js +17 -0
  292. package/serialization/resources/tts/resources/voices/client/requests/PostedVoice.d.ts +13 -0
  293. package/serialization/resources/tts/resources/voices/client/requests/PostedVoice.js +34 -0
  294. package/serialization/resources/tts/resources/voices/client/requests/index.d.ts +1 -0
  295. package/serialization/resources/tts/resources/voices/client/requests/index.js +5 -0
  296. package/serialization/resources/tts/resources/voices/index.d.ts +1 -0
  297. package/serialization/resources/tts/resources/voices/index.js +17 -0
  298. package/serialization/resources/tts/types/AudioEncoding.d.ts +14 -0
  299. package/serialization/resources/tts/types/AudioEncoding.js +35 -0
  300. package/serialization/resources/tts/types/AudioFormatType.d.ts +10 -0
  301. package/serialization/resources/tts/types/AudioFormatType.js +31 -0
  302. package/serialization/resources/tts/types/Format.d.ts +22 -0
  303. package/serialization/resources/tts/types/Format.js +43 -0
  304. package/serialization/resources/tts/types/FormatMp3.d.ts +11 -0
  305. package/serialization/resources/tts/types/FormatMp3.js +31 -0
  306. package/serialization/resources/tts/types/FormatPcm.d.ts +11 -0
  307. package/serialization/resources/tts/types/FormatPcm.js +31 -0
  308. package/serialization/resources/tts/types/FormatWav.d.ts +11 -0
  309. package/serialization/resources/tts/types/FormatWav.js +31 -0
  310. package/serialization/resources/tts/types/HttpValidationError.d.ts +13 -0
  311. package/serialization/resources/tts/types/HttpValidationError.js +34 -0
  312. package/serialization/resources/tts/types/PostedContext.d.ts +12 -0
  313. package/serialization/resources/tts/types/PostedContext.js +33 -0
  314. package/serialization/resources/tts/types/PostedContextWithGenerationId.d.ts +12 -0
  315. package/serialization/resources/tts/types/PostedContextWithGenerationId.js +33 -0
  316. package/serialization/resources/tts/types/PostedContextWithUtterances.d.ts +13 -0
  317. package/serialization/resources/tts/types/PostedContextWithUtterances.js +34 -0
  318. package/serialization/resources/tts/types/PostedTts.d.ts +18 -0
  319. package/serialization/resources/tts/types/PostedTts.js +39 -0
  320. package/serialization/resources/tts/types/PostedTtsRecord.d.ts +17 -0
  321. package/serialization/resources/tts/types/PostedTtsRecord.js +38 -0
  322. package/serialization/resources/tts/types/PostedUtterance.d.ts +15 -0
  323. package/serialization/resources/tts/types/PostedUtterance.js +36 -0
  324. package/serialization/resources/tts/types/PostedUtteranceVoice.d.ts +12 -0
  325. package/serialization/resources/tts/types/PostedUtteranceVoice.js +33 -0
  326. package/serialization/resources/tts/types/PostedUtteranceVoiceWithId.d.ts +14 -0
  327. package/serialization/resources/tts/types/PostedUtteranceVoiceWithId.js +35 -0
  328. package/serialization/resources/tts/types/PostedUtteranceVoiceWithName.d.ts +14 -0
  329. package/serialization/resources/tts/types/PostedUtteranceVoiceWithName.js +35 -0
  330. package/serialization/resources/tts/types/ReturnGeneration.d.ts +19 -0
  331. package/serialization/resources/tts/types/ReturnGeneration.js +40 -0
  332. package/serialization/resources/tts/types/ReturnTts.d.ts +14 -0
  333. package/serialization/resources/tts/types/ReturnTts.js +35 -0
  334. package/serialization/resources/tts/types/ReturnVoice.d.ts +13 -0
  335. package/serialization/resources/tts/types/ReturnVoice.js +34 -0
  336. package/serialization/resources/tts/types/Snippet.d.ts +14 -0
  337. package/serialization/resources/tts/types/Snippet.js +35 -0
  338. package/serialization/resources/tts/types/ValidationError.d.ts +15 -0
  339. package/serialization/resources/tts/types/ValidationError.js +36 -0
  340. package/serialization/resources/tts/types/ValidationErrorLocItem.d.ts +10 -0
  341. package/serialization/resources/tts/types/ValidationErrorLocItem.js +31 -0
  342. package/serialization/resources/tts/types/VoiceProvider.d.ts +10 -0
  343. package/serialization/resources/tts/types/VoiceProvider.js +31 -0
  344. package/serialization/resources/tts/types/index.d.ts +23 -0
  345. package/serialization/resources/tts/types/index.js +39 -0
  346. package/version.d.ts +1 -1
  347. package/version.js +1 -1
  348. /package/dist/serialization/resources/empathicVoice/resources/prompts/client/{createPromptVerison.js → createPromptVersion.js} +0 -0
  349. /package/serialization/resources/empathicVoice/resources/prompts/client/{createPromptVerison.js → createPromptVersion.js} +0 -0
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __importDefault = (this && this.__importDefault) || function (mod) {
38
+ return (mod && mod.__esModule) ? mod : { "default": mod };
39
+ };
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.Tts = void 0;
42
+ const environments = __importStar(require("../../../../environments"));
43
+ const core = __importStar(require("../../../../core"));
44
+ const Hume = __importStar(require("../../../index"));
45
+ const serializers = __importStar(require("../../../../serialization/index"));
46
+ const url_join_1 = __importDefault(require("url-join"));
47
+ const errors = __importStar(require("../../../../errors/index"));
48
+ const Client_1 = require("../resources/voices/client/Client");
49
+ class Tts {
50
+ constructor(_options = {}) {
51
+ this._options = _options;
52
+ }
53
+ /**
54
+ * 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.
55
+ *
56
+ * The response includes the base64-encoded audio and metadata in JSON format.
57
+ *
58
+ * @param {Hume.tts.PostedTts} request
59
+ * @param {Tts.RequestOptions} requestOptions - Request-specific configuration.
60
+ *
61
+ * @throws {@link Hume.tts.UnprocessableEntityError}
62
+ *
63
+ * @example
64
+ * await client.tts.synthesizeJson({
65
+ * utterances: [{
66
+ * text: "Beauty is no quality in things themselves: It exists merely in the mind which contemplates them.",
67
+ * description: "Middle-aged masculine voice with a clear, rhythmic Scots lilt, rounded vowels, and a warm, steady tone with an articulate, academic quality."
68
+ * }],
69
+ * context: {
70
+ * utterances: [{
71
+ * text: "How can people see beauty so differently?",
72
+ * description: "A curious student with a clear and respectful tone, seeking clarification on Hume's ideas with a straightforward question."
73
+ * }]
74
+ * },
75
+ * format: {
76
+ * type: "mp3"
77
+ * },
78
+ * numGenerations: 1
79
+ * })
80
+ */
81
+ synthesizeJson(request, requestOptions) {
82
+ var _a, _b;
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
85
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/tts"),
86
+ method: "POST",
87
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.11", "User-Agent": "hume/0.9.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
88
+ contentType: "application/json",
89
+ requestType: "json",
90
+ body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
91
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
92
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
93
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
94
+ });
95
+ if (_response.ok) {
96
+ return serializers.tts.ReturnTts.parseOrThrow(_response.body, {
97
+ unrecognizedObjectKeys: "passthrough",
98
+ allowUnrecognizedUnionMembers: true,
99
+ allowUnrecognizedEnumValues: true,
100
+ breadcrumbsPrefix: ["response"],
101
+ });
102
+ }
103
+ if (_response.error.reason === "status-code") {
104
+ switch (_response.error.statusCode) {
105
+ case 422:
106
+ throw new Hume.tts.UnprocessableEntityError(serializers.tts.HttpValidationError.parseOrThrow(_response.error.body, {
107
+ unrecognizedObjectKeys: "passthrough",
108
+ allowUnrecognizedUnionMembers: true,
109
+ allowUnrecognizedEnumValues: true,
110
+ breadcrumbsPrefix: ["response"],
111
+ }));
112
+ default:
113
+ throw new errors.HumeError({
114
+ statusCode: _response.error.statusCode,
115
+ body: _response.error.body,
116
+ });
117
+ }
118
+ }
119
+ switch (_response.error.reason) {
120
+ case "non-json":
121
+ throw new errors.HumeError({
122
+ statusCode: _response.error.statusCode,
123
+ body: _response.error.rawBody,
124
+ });
125
+ case "timeout":
126
+ throw new errors.HumeTimeoutError();
127
+ case "unknown":
128
+ throw new errors.HumeError({
129
+ message: _response.error.errorMessage,
130
+ });
131
+ }
132
+ });
133
+ }
134
+ /**
135
+ * 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.
136
+ *
137
+ * The response contains the generated audio file in the requested format.
138
+ *
139
+ * @param {Hume.tts.PostedTts} request
140
+ * @param {Tts.RequestOptions} requestOptions - Request-specific configuration.
141
+ *
142
+ * @throws {@link Hume.tts.UnprocessableEntityError}
143
+ *
144
+ * @example
145
+ * await client.tts.synthesizeFile({
146
+ * utterances: [{
147
+ * text: "Beauty is no quality in things themselves: It exists merely in the mind which contemplates them.",
148
+ * description: "Middle-aged masculine voice with a clear, rhythmic Scots lilt, rounded vowels, and a warm, steady tone with an articulate, academic quality."
149
+ * }],
150
+ * context: {
151
+ * generationId: "09ad914d-8e7f-40f8-a279-e34f07f7dab2"
152
+ * },
153
+ * format: {
154
+ * type: "mp3"
155
+ * },
156
+ * numGenerations: 1
157
+ * })
158
+ */
159
+ synthesizeFile(request, requestOptions) {
160
+ var _a, _b;
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
163
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/tts/file"),
164
+ method: "POST",
165
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.11", "User-Agent": "hume/0.9.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
166
+ contentType: "application/json",
167
+ requestType: "json",
168
+ body: serializers.tts.PostedTts.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
169
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
170
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
171
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
172
+ });
173
+ if (_response.ok) {
174
+ return _response.body;
175
+ }
176
+ if (_response.error.reason === "status-code") {
177
+ switch (_response.error.statusCode) {
178
+ case 422:
179
+ throw new Hume.tts.UnprocessableEntityError(serializers.tts.HttpValidationError.parseOrThrow(_response.error.body, {
180
+ unrecognizedObjectKeys: "passthrough",
181
+ allowUnrecognizedUnionMembers: true,
182
+ allowUnrecognizedEnumValues: true,
183
+ breadcrumbsPrefix: ["response"],
184
+ }));
185
+ default:
186
+ throw new errors.HumeError({
187
+ statusCode: _response.error.statusCode,
188
+ body: _response.error.body,
189
+ });
190
+ }
191
+ }
192
+ switch (_response.error.reason) {
193
+ case "non-json":
194
+ throw new errors.HumeError({
195
+ statusCode: _response.error.statusCode,
196
+ body: _response.error.rawBody,
197
+ });
198
+ case "timeout":
199
+ throw new errors.HumeTimeoutError();
200
+ case "unknown":
201
+ throw new errors.HumeError({
202
+ message: _response.error.errorMessage,
203
+ });
204
+ }
205
+ });
206
+ }
207
+ get voices() {
208
+ var _a;
209
+ return ((_a = this._voices) !== null && _a !== void 0 ? _a : (this._voices = new Client_1.Voices(this._options)));
210
+ }
211
+ _getCustomAuthorizationHeaders() {
212
+ return __awaiter(this, void 0, void 0, function* () {
213
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
214
+ return { "X-Hume-Api-Key": apiKeyValue };
215
+ });
216
+ }
217
+ }
218
+ exports.Tts = Tts;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as errors from "../../../../errors/index";
5
+ import * as Hume from "../../../index";
6
+ export declare class UnprocessableEntityError extends errors.HumeError {
7
+ constructor(body: Hume.tts.HttpValidationError);
8
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.UnprocessableEntityError = void 0;
30
+ const errors = __importStar(require("../../../../errors/index"));
31
+ class UnprocessableEntityError extends errors.HumeError {
32
+ constructor(body) {
33
+ super({
34
+ message: "UnprocessableEntityError",
35
+ statusCode: 422,
36
+ body: body,
37
+ });
38
+ Object.setPrototypeOf(this, UnprocessableEntityError.prototype);
39
+ }
40
+ }
41
+ exports.UnprocessableEntityError = UnprocessableEntityError;
@@ -0,0 +1 @@
1
+ export * from "./UnprocessableEntityError";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./UnprocessableEntityError"), exports);
@@ -0,0 +1,4 @@
1
+ export * from "./types";
2
+ export * from "./errors";
3
+ export * from "./client";
4
+ export * from "./resources";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./errors"), exports);
19
+ __exportStar(require("./client"), exports);
20
+ __exportStar(require("./resources"), exports);
@@ -0,0 +1,2 @@
1
+ export * as voices from "./voices";
2
+ export * from "./voices/client/requests";
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.voices = void 0;
30
+ exports.voices = __importStar(require("./voices"));
31
+ __exportStar(require("./voices/client/requests"), exports);
@@ -0,0 +1,43 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../../../environments";
5
+ import * as core from "../../../../../../core";
6
+ import * as Hume from "../../../../../index";
7
+ export declare namespace Voices {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.HumeEnvironment | string>;
10
+ apiKey?: core.Supplier<string | undefined>;
11
+ fetcher?: core.FetchFunction;
12
+ }
13
+ interface RequestOptions {
14
+ /** The maximum time to wait for a response in seconds. */
15
+ timeoutInSeconds?: number;
16
+ /** The number of times to retry the request. Defaults to 2. */
17
+ maxRetries?: number;
18
+ /** A hook to abort the request. */
19
+ abortSignal?: AbortSignal;
20
+ }
21
+ }
22
+ export declare class Voices {
23
+ protected readonly _options: Voices.Options;
24
+ constructor(_options?: Voices.Options);
25
+ /**
26
+ * Creates a new voice from a specified TTS generation ID and saves it to your **Voice Library**. This allows for consistent speech style and prosody across multiple requests.
27
+ *
28
+ * @param {Hume.tts.PostedVoice} request
29
+ * @param {Voices.RequestOptions} requestOptions - Request-specific configuration.
30
+ *
31
+ * @throws {@link Hume.tts.UnprocessableEntityError}
32
+ *
33
+ * @example
34
+ * await client.tts.voices.create({
35
+ * generationId: "795c949a-1510-4a80-9646-7d0863b023ab",
36
+ * name: "David Hume"
37
+ * })
38
+ */
39
+ create(request: Hume.tts.PostedVoice, requestOptions?: Voices.RequestOptions): Promise<Hume.tts.ReturnVoice>;
40
+ protected _getCustomAuthorizationHeaders(): Promise<{
41
+ "X-Hume-Api-Key": string | undefined;
42
+ }>;
43
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
+ return new (P || (P = Promise))(function (resolve, reject) {
31
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
35
+ });
36
+ };
37
+ var __importDefault = (this && this.__importDefault) || function (mod) {
38
+ return (mod && mod.__esModule) ? mod : { "default": mod };
39
+ };
40
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.Voices = void 0;
42
+ const environments = __importStar(require("../../../../../../environments"));
43
+ const core = __importStar(require("../../../../../../core"));
44
+ const Hume = __importStar(require("../../../../../index"));
45
+ const serializers = __importStar(require("../../../../../../serialization/index"));
46
+ const url_join_1 = __importDefault(require("url-join"));
47
+ const errors = __importStar(require("../../../../../../errors/index"));
48
+ class Voices {
49
+ constructor(_options = {}) {
50
+ this._options = _options;
51
+ }
52
+ /**
53
+ * Creates a new voice from a specified TTS generation ID and saves it to your **Voice Library**. This allows for consistent speech style and prosody across multiple requests.
54
+ *
55
+ * @param {Hume.tts.PostedVoice} request
56
+ * @param {Voices.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link Hume.tts.UnprocessableEntityError}
59
+ *
60
+ * @example
61
+ * await client.tts.voices.create({
62
+ * generationId: "795c949a-1510-4a80-9646-7d0863b023ab",
63
+ * name: "David Hume"
64
+ * })
65
+ */
66
+ create(request, requestOptions) {
67
+ var _a, _b;
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
70
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, "v0/tts/voices"),
71
+ method: "POST",
72
+ headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.9.11", "User-Agent": "hume/0.9.11", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
73
+ contentType: "application/json",
74
+ requestType: "json",
75
+ body: serializers.tts.PostedVoice.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
76
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
77
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
78
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
79
+ });
80
+ if (_response.ok) {
81
+ return serializers.tts.ReturnVoice.parseOrThrow(_response.body, {
82
+ unrecognizedObjectKeys: "passthrough",
83
+ allowUnrecognizedUnionMembers: true,
84
+ allowUnrecognizedEnumValues: true,
85
+ breadcrumbsPrefix: ["response"],
86
+ });
87
+ }
88
+ if (_response.error.reason === "status-code") {
89
+ switch (_response.error.statusCode) {
90
+ case 422:
91
+ throw new Hume.tts.UnprocessableEntityError(serializers.tts.HttpValidationError.parseOrThrow(_response.error.body, {
92
+ unrecognizedObjectKeys: "passthrough",
93
+ allowUnrecognizedUnionMembers: true,
94
+ allowUnrecognizedEnumValues: true,
95
+ breadcrumbsPrefix: ["response"],
96
+ }));
97
+ default:
98
+ throw new errors.HumeError({
99
+ statusCode: _response.error.statusCode,
100
+ body: _response.error.body,
101
+ });
102
+ }
103
+ }
104
+ switch (_response.error.reason) {
105
+ case "non-json":
106
+ throw new errors.HumeError({
107
+ statusCode: _response.error.statusCode,
108
+ body: _response.error.rawBody,
109
+ });
110
+ case "timeout":
111
+ throw new errors.HumeTimeoutError();
112
+ case "unknown":
113
+ throw new errors.HumeError({
114
+ message: _response.error.errorMessage,
115
+ });
116
+ }
117
+ });
118
+ }
119
+ _getCustomAuthorizationHeaders() {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ const apiKeyValue = yield core.Supplier.get(this._options.apiKey);
122
+ return { "X-Hume-Api-Key": apiKeyValue };
123
+ });
124
+ }
125
+ }
126
+ exports.Voices = Voices;
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * generationId: "795c949a-1510-4a80-9646-7d0863b023ab",
8
+ * name: "David Hume"
9
+ * }
10
+ */
11
+ export interface PostedVoice {
12
+ /** Id of the TTS generation (as returned by the [/v0/tts endpoint](/reference/text-to-speech-evi/synthesize-json#response.body.generations.generation_id)) that should be saved as a voice. */
13
+ generationId: string;
14
+ /** Name of the voice in the `Voice Library`. */
15
+ name: string;
16
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { type PostedVoice } from "./PostedVoice";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client"), exports);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Hume from "../../../index";
5
+ export interface AudioEncoding {
6
+ /** Format for the output audio. */
7
+ format: Hume.tts.AudioFormatType;
8
+ /** Sample rate of the generated audio. */
9
+ sampleRate: number;
10
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export declare type AudioFormatType = "mp3" | "pcm" | "wav";
5
+ export declare const AudioFormatType: {
6
+ readonly Mp3: "mp3";
7
+ readonly Pcm: "pcm";
8
+ readonly Wav: "wav";
9
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AudioFormatType = void 0;
7
+ exports.AudioFormatType = {
8
+ Mp3: "mp3",
9
+ Pcm: "pcm",
10
+ Wav: "wav",
11
+ };