hume 0.12.1 → 0.13.0

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 (324) hide show
  1. package/.mock/definition/empathic-voice/__package__.yml +760 -711
  2. package/.mock/definition/empathic-voice/chat.yml +29 -23
  3. package/.mock/definition/empathic-voice/chatWebhooks.yml +3 -3
  4. package/.mock/definition/empathic-voice/configs.yml +10 -4
  5. package/.mock/definition/tts/__package__.yml +77 -125
  6. package/.mock/fern.config.json +1 -1
  7. package/api/resources/empathicVoice/resources/chatGroups/client/index.d.ts +1 -0
  8. package/api/resources/empathicVoice/resources/chats/client/index.d.ts +1 -0
  9. package/api/resources/empathicVoice/resources/configs/client/index.d.ts +1 -0
  10. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +5 -1
  11. package/api/resources/empathicVoice/resources/prompts/client/index.d.ts +1 -0
  12. package/api/resources/empathicVoice/resources/tools/client/index.d.ts +1 -0
  13. package/api/resources/empathicVoice/types/AssistantEnd.d.ts +2 -2
  14. package/api/resources/empathicVoice/types/AssistantInput.d.ts +2 -2
  15. package/api/resources/empathicVoice/types/AssistantMessage.d.ts +8 -8
  16. package/api/resources/empathicVoice/types/AssistantProsody.d.ts +6 -6
  17. package/api/resources/empathicVoice/types/AudioConfiguration.d.ts +2 -2
  18. package/api/resources/empathicVoice/types/AudioInput.d.ts +6 -6
  19. package/api/resources/empathicVoice/types/AudioOutput.d.ts +4 -4
  20. package/api/resources/empathicVoice/types/BuiltinToolConfig.d.ts +1 -1
  21. package/api/resources/empathicVoice/types/ChatMessage.d.ts +2 -2
  22. package/api/resources/empathicVoice/types/ChatMetadata.d.ts +8 -8
  23. package/api/resources/empathicVoice/types/Context.d.ts +8 -14
  24. package/api/resources/empathicVoice/types/ContextType.d.ts +2 -3
  25. package/api/resources/empathicVoice/types/ContextType.js +1 -2
  26. package/api/resources/empathicVoice/types/LanguageModelType.d.ts +20 -1
  27. package/api/resources/empathicVoice/types/LanguageModelType.js +19 -0
  28. package/api/resources/empathicVoice/types/ModelProviderEnum.d.ts +4 -1
  29. package/api/resources/empathicVoice/types/ModelProviderEnum.js +3 -0
  30. package/api/resources/empathicVoice/types/PauseAssistantMessage.d.ts +2 -2
  31. package/api/resources/empathicVoice/types/ResumeAssistantMessage.d.ts +2 -2
  32. package/api/resources/empathicVoice/types/ReturnChatEvent.d.ts +12 -17
  33. package/api/resources/empathicVoice/types/ReturnChatEventRole.d.ts +0 -4
  34. package/api/resources/empathicVoice/types/ReturnChatEventType.d.ts +22 -18
  35. package/api/resources/empathicVoice/types/ReturnChatEventType.js +9 -4
  36. package/api/resources/empathicVoice/types/ReturnConfig.d.ts +18 -14
  37. package/api/resources/empathicVoice/types/ReturnPrompt.d.ts +2 -2
  38. package/api/resources/empathicVoice/types/SessionSettings.d.ts +29 -29
  39. package/api/resources/empathicVoice/types/Tool.d.ts +6 -6
  40. package/api/resources/empathicVoice/types/ToolCallMessage.d.ts +6 -6
  41. package/api/resources/empathicVoice/types/ToolErrorMessage.d.ts +16 -16
  42. package/api/resources/empathicVoice/types/ToolResponseMessage.d.ts +8 -8
  43. package/api/resources/empathicVoice/types/UserInput.d.ts +2 -2
  44. package/api/resources/empathicVoice/types/UserInterruption.d.ts +4 -4
  45. package/api/resources/empathicVoice/types/UserMessage.d.ts +14 -7
  46. package/api/resources/empathicVoice/types/VoiceProvider.d.ts +2 -1
  47. package/api/resources/empathicVoice/types/VoiceProvider.js +1 -0
  48. package/api/resources/empathicVoice/types/WebSocketError.d.ts +10 -10
  49. package/api/resources/empathicVoice/types/WebhookEventChatEnded.d.ts +8 -8
  50. package/api/resources/empathicVoice/types/WebhookEventChatStarted.d.ts +6 -6
  51. package/api/resources/empathicVoice/types/index.d.ts +16 -16
  52. package/api/resources/empathicVoice/types/index.js +16 -16
  53. package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +2 -4
  54. package/api/resources/expressionMeasurement/resources/batch/client/Client.js +1 -1
  55. package/api/resources/expressionMeasurement/resources/batch/client/index.d.ts +1 -0
  56. package/api/resources/tts/client/Client.d.ts +21 -23
  57. package/api/resources/tts/client/Client.js +50 -58
  58. package/api/resources/tts/client/index.d.ts +1 -1
  59. package/api/resources/tts/client/index.js +0 -15
  60. package/api/resources/tts/resources/voices/client/index.d.ts +1 -0
  61. package/api/resources/tts/types/PostedTts.d.ts +8 -8
  62. package/api/resources/tts/types/PostedUtterance.d.ts +6 -6
  63. package/api/resources/tts/types/ReturnGeneration.d.ts +5 -5
  64. package/api/resources/tts/types/ReturnTts.d.ts +1 -1
  65. package/api/resources/tts/types/Snippet.d.ts +6 -6
  66. package/api/resources/tts/types/SnippetAudioChunk.d.ts +0 -16
  67. package/core/fetcher/BinaryResponse.d.ts +17 -0
  68. package/core/fetcher/BinaryResponse.js +14 -0
  69. package/core/fetcher/Fetcher.d.ts +1 -1
  70. package/core/fetcher/ResponseWithBody.d.ts +4 -0
  71. package/core/fetcher/ResponseWithBody.js +6 -0
  72. package/core/fetcher/getFetchFn.js +3 -3
  73. package/core/fetcher/getResponseBody.js +33 -32
  74. package/core/fetcher/index.d.ts +1 -0
  75. package/core/file.d.ts +1 -0
  76. package/core/form-data-utils/FormDataWrapper.d.ts +5 -52
  77. package/core/form-data-utils/FormDataWrapper.js +104 -124
  78. package/core/index.d.ts +1 -0
  79. package/core/index.js +1 -0
  80. package/dist/api/resources/empathicVoice/resources/chatGroups/client/index.d.ts +1 -0
  81. package/dist/api/resources/empathicVoice/resources/chats/client/index.d.ts +1 -0
  82. package/dist/api/resources/empathicVoice/resources/configs/client/index.d.ts +1 -0
  83. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +5 -1
  84. package/dist/api/resources/empathicVoice/resources/prompts/client/index.d.ts +1 -0
  85. package/dist/api/resources/empathicVoice/resources/tools/client/index.d.ts +1 -0
  86. package/dist/api/resources/empathicVoice/types/AssistantEnd.d.ts +2 -2
  87. package/dist/api/resources/empathicVoice/types/AssistantInput.d.ts +2 -2
  88. package/dist/api/resources/empathicVoice/types/AssistantMessage.d.ts +8 -8
  89. package/dist/api/resources/empathicVoice/types/AssistantProsody.d.ts +6 -6
  90. package/dist/api/resources/empathicVoice/types/AudioConfiguration.d.ts +2 -2
  91. package/dist/api/resources/empathicVoice/types/AudioInput.d.ts +6 -6
  92. package/dist/api/resources/empathicVoice/types/AudioOutput.d.ts +4 -4
  93. package/dist/api/resources/empathicVoice/types/BuiltinToolConfig.d.ts +1 -1
  94. package/dist/api/resources/empathicVoice/types/ChatMessage.d.ts +2 -2
  95. package/dist/api/resources/empathicVoice/types/ChatMetadata.d.ts +8 -8
  96. package/dist/api/resources/empathicVoice/types/Context.d.ts +8 -14
  97. package/dist/api/resources/empathicVoice/types/ContextType.d.ts +2 -3
  98. package/dist/api/resources/empathicVoice/types/ContextType.js +1 -2
  99. package/dist/api/resources/empathicVoice/types/LanguageModelType.d.ts +20 -1
  100. package/dist/api/resources/empathicVoice/types/LanguageModelType.js +19 -0
  101. package/dist/api/resources/empathicVoice/types/ModelProviderEnum.d.ts +4 -1
  102. package/dist/api/resources/empathicVoice/types/ModelProviderEnum.js +3 -0
  103. package/dist/api/resources/empathicVoice/types/PauseAssistantMessage.d.ts +2 -2
  104. package/dist/api/resources/empathicVoice/types/ResumeAssistantMessage.d.ts +2 -2
  105. package/dist/api/resources/empathicVoice/types/ReturnChatEvent.d.ts +12 -17
  106. package/dist/api/resources/empathicVoice/types/ReturnChatEventRole.d.ts +0 -4
  107. package/dist/api/resources/empathicVoice/types/ReturnChatEventType.d.ts +22 -18
  108. package/dist/api/resources/empathicVoice/types/ReturnChatEventType.js +9 -4
  109. package/dist/api/resources/empathicVoice/types/ReturnConfig.d.ts +18 -14
  110. package/dist/api/resources/empathicVoice/types/ReturnPrompt.d.ts +2 -2
  111. package/dist/api/resources/empathicVoice/types/SessionSettings.d.ts +29 -29
  112. package/dist/api/resources/empathicVoice/types/Tool.d.ts +6 -6
  113. package/dist/api/resources/empathicVoice/types/ToolCallMessage.d.ts +6 -6
  114. package/dist/api/resources/empathicVoice/types/ToolErrorMessage.d.ts +16 -16
  115. package/dist/api/resources/empathicVoice/types/ToolResponseMessage.d.ts +8 -8
  116. package/dist/api/resources/empathicVoice/types/UserInput.d.ts +2 -2
  117. package/dist/api/resources/empathicVoice/types/UserInterruption.d.ts +4 -4
  118. package/dist/api/resources/empathicVoice/types/UserMessage.d.ts +14 -7
  119. package/dist/api/resources/empathicVoice/types/VoiceProvider.d.ts +2 -1
  120. package/dist/api/resources/empathicVoice/types/VoiceProvider.js +1 -0
  121. package/dist/api/resources/empathicVoice/types/WebSocketError.d.ts +10 -10
  122. package/dist/api/resources/empathicVoice/types/WebhookEventChatEnded.d.ts +8 -8
  123. package/dist/api/resources/empathicVoice/types/WebhookEventChatStarted.d.ts +6 -6
  124. package/dist/api/resources/empathicVoice/types/index.d.ts +16 -16
  125. package/dist/api/resources/empathicVoice/types/index.js +16 -16
  126. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +2 -4
  127. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +1 -1
  128. package/dist/api/resources/expressionMeasurement/resources/batch/client/index.d.ts +1 -0
  129. package/dist/api/resources/tts/client/Client.d.ts +21 -23
  130. package/dist/api/resources/tts/client/Client.js +50 -58
  131. package/dist/api/resources/tts/client/index.d.ts +1 -1
  132. package/dist/api/resources/tts/client/index.js +0 -15
  133. package/dist/api/resources/tts/resources/voices/client/index.d.ts +1 -0
  134. package/dist/api/resources/tts/types/PostedTts.d.ts +8 -8
  135. package/dist/api/resources/tts/types/PostedUtterance.d.ts +6 -6
  136. package/dist/api/resources/tts/types/ReturnGeneration.d.ts +5 -5
  137. package/dist/api/resources/tts/types/ReturnTts.d.ts +1 -1
  138. package/dist/api/resources/tts/types/Snippet.d.ts +6 -6
  139. package/dist/api/resources/tts/types/SnippetAudioChunk.d.ts +0 -16
  140. package/dist/core/fetcher/BinaryResponse.d.ts +17 -0
  141. package/dist/core/fetcher/BinaryResponse.js +14 -0
  142. package/dist/core/fetcher/Fetcher.d.ts +1 -1
  143. package/dist/core/fetcher/ResponseWithBody.d.ts +4 -0
  144. package/dist/core/fetcher/ResponseWithBody.js +6 -0
  145. package/dist/core/fetcher/getFetchFn.js +3 -3
  146. package/dist/core/fetcher/getResponseBody.js +33 -32
  147. package/dist/core/fetcher/index.d.ts +1 -0
  148. package/dist/core/file.d.ts +1 -0
  149. package/dist/core/form-data-utils/FormDataWrapper.d.ts +5 -52
  150. package/dist/core/form-data-utils/FormDataWrapper.js +104 -124
  151. package/dist/core/index.d.ts +1 -0
  152. package/dist/core/index.js +1 -0
  153. package/dist/serialization/resources/empathicVoice/types/AssistantEnd.d.ts +1 -1
  154. package/dist/serialization/resources/empathicVoice/types/AssistantEnd.js +1 -1
  155. package/dist/serialization/resources/empathicVoice/types/AssistantInput.d.ts +1 -1
  156. package/dist/serialization/resources/empathicVoice/types/AssistantInput.js +1 -1
  157. package/dist/serialization/resources/empathicVoice/types/AssistantMessage.d.ts +2 -2
  158. package/dist/serialization/resources/empathicVoice/types/AssistantMessage.js +2 -2
  159. package/dist/serialization/resources/empathicVoice/types/AssistantProsody.d.ts +2 -2
  160. package/dist/serialization/resources/empathicVoice/types/AssistantProsody.js +2 -2
  161. package/dist/serialization/resources/empathicVoice/types/AudioConfiguration.d.ts +1 -1
  162. package/dist/serialization/resources/empathicVoice/types/AudioConfiguration.js +1 -1
  163. package/dist/serialization/resources/empathicVoice/types/AudioInput.d.ts +1 -1
  164. package/dist/serialization/resources/empathicVoice/types/AudioInput.js +1 -1
  165. package/dist/serialization/resources/empathicVoice/types/AudioOutput.d.ts +2 -2
  166. package/dist/serialization/resources/empathicVoice/types/AudioOutput.js +2 -2
  167. package/dist/serialization/resources/empathicVoice/types/BuiltinToolConfig.d.ts +1 -1
  168. package/dist/serialization/resources/empathicVoice/types/BuiltinToolConfig.js +1 -1
  169. package/dist/serialization/resources/empathicVoice/types/ChatMessage.d.ts +1 -1
  170. package/dist/serialization/resources/empathicVoice/types/ChatMessage.js +1 -1
  171. package/dist/serialization/resources/empathicVoice/types/ChatMetadata.d.ts +2 -2
  172. package/dist/serialization/resources/empathicVoice/types/ChatMetadata.js +2 -2
  173. package/dist/serialization/resources/empathicVoice/types/Context.d.ts +1 -1
  174. package/dist/serialization/resources/empathicVoice/types/Context.js +1 -1
  175. package/dist/serialization/resources/empathicVoice/types/ContextType.d.ts +1 -1
  176. package/dist/serialization/resources/empathicVoice/types/ContextType.js +1 -1
  177. package/dist/serialization/resources/empathicVoice/types/LanguageModelType.d.ts +1 -1
  178. package/dist/serialization/resources/empathicVoice/types/LanguageModelType.js +19 -0
  179. package/dist/serialization/resources/empathicVoice/types/ModelProviderEnum.d.ts +1 -1
  180. package/dist/serialization/resources/empathicVoice/types/ModelProviderEnum.js +3 -0
  181. package/dist/serialization/resources/empathicVoice/types/PauseAssistantMessage.d.ts +1 -1
  182. package/dist/serialization/resources/empathicVoice/types/PauseAssistantMessage.js +1 -1
  183. package/dist/serialization/resources/empathicVoice/types/ResumeAssistantMessage.d.ts +1 -1
  184. package/dist/serialization/resources/empathicVoice/types/ResumeAssistantMessage.js +1 -1
  185. package/dist/serialization/resources/empathicVoice/types/ReturnChatEventType.d.ts +1 -1
  186. package/dist/serialization/resources/empathicVoice/types/ReturnChatEventType.js +9 -4
  187. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +9 -9
  188. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.js +9 -9
  189. package/dist/serialization/resources/empathicVoice/types/ReturnPrompt.d.ts +1 -1
  190. package/dist/serialization/resources/empathicVoice/types/ReturnPrompt.js +1 -1
  191. package/dist/serialization/resources/empathicVoice/types/SessionSettings.d.ts +8 -8
  192. package/dist/serialization/resources/empathicVoice/types/SessionSettings.js +8 -8
  193. package/dist/serialization/resources/empathicVoice/types/Tool.d.ts +3 -3
  194. package/dist/serialization/resources/empathicVoice/types/Tool.js +3 -3
  195. package/dist/serialization/resources/empathicVoice/types/ToolCallMessage.d.ts +3 -3
  196. package/dist/serialization/resources/empathicVoice/types/ToolCallMessage.js +3 -3
  197. package/dist/serialization/resources/empathicVoice/types/ToolErrorMessage.d.ts +6 -6
  198. package/dist/serialization/resources/empathicVoice/types/ToolErrorMessage.js +6 -6
  199. package/dist/serialization/resources/empathicVoice/types/ToolResponseMessage.d.ts +2 -2
  200. package/dist/serialization/resources/empathicVoice/types/ToolResponseMessage.js +2 -2
  201. package/dist/serialization/resources/empathicVoice/types/UserInput.d.ts +1 -1
  202. package/dist/serialization/resources/empathicVoice/types/UserInput.js +1 -1
  203. package/dist/serialization/resources/empathicVoice/types/UserInterruption.d.ts +1 -1
  204. package/dist/serialization/resources/empathicVoice/types/UserInterruption.js +1 -1
  205. package/dist/serialization/resources/empathicVoice/types/UserMessage.d.ts +3 -3
  206. package/dist/serialization/resources/empathicVoice/types/UserMessage.js +3 -3
  207. package/dist/serialization/resources/empathicVoice/types/VoiceProvider.d.ts +1 -1
  208. package/dist/serialization/resources/empathicVoice/types/VoiceProvider.js +1 -1
  209. package/dist/serialization/resources/empathicVoice/types/WebSocketError.d.ts +3 -3
  210. package/dist/serialization/resources/empathicVoice/types/WebSocketError.js +3 -3
  211. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatEnded.d.ts +4 -4
  212. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatEnded.js +4 -4
  213. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStarted.d.ts +3 -3
  214. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStarted.js +3 -3
  215. package/dist/serialization/resources/empathicVoice/types/index.d.ts +16 -16
  216. package/dist/serialization/resources/empathicVoice/types/index.js +16 -16
  217. package/dist/serialization/resources/tts/types/PostedTts.d.ts +3 -3
  218. package/dist/serialization/resources/tts/types/PostedTts.js +3 -3
  219. package/dist/serialization/resources/tts/types/PostedUtterance.d.ts +2 -2
  220. package/dist/serialization/resources/tts/types/PostedUtterance.js +2 -2
  221. package/dist/serialization/resources/tts/types/ReturnGeneration.d.ts +3 -3
  222. package/dist/serialization/resources/tts/types/ReturnGeneration.js +3 -3
  223. package/dist/serialization/resources/tts/types/ReturnTts.d.ts +1 -1
  224. package/dist/serialization/resources/tts/types/ReturnTts.js +1 -1
  225. package/dist/serialization/resources/tts/types/Snippet.d.ts +3 -3
  226. package/dist/serialization/resources/tts/types/Snippet.js +3 -3
  227. package/dist/serialization/resources/tts/types/SnippetAudioChunk.d.ts +0 -8
  228. package/dist/serialization/resources/tts/types/SnippetAudioChunk.js +1 -10
  229. package/dist/version.d.ts +1 -1
  230. package/dist/version.js +1 -1
  231. package/jest.browser.config.mjs +10 -0
  232. package/jest.config.mjs +1 -0
  233. package/package.json +6 -7
  234. package/reference.md +25 -27
  235. package/serialization/resources/empathicVoice/types/AssistantEnd.d.ts +1 -1
  236. package/serialization/resources/empathicVoice/types/AssistantEnd.js +1 -1
  237. package/serialization/resources/empathicVoice/types/AssistantInput.d.ts +1 -1
  238. package/serialization/resources/empathicVoice/types/AssistantInput.js +1 -1
  239. package/serialization/resources/empathicVoice/types/AssistantMessage.d.ts +2 -2
  240. package/serialization/resources/empathicVoice/types/AssistantMessage.js +2 -2
  241. package/serialization/resources/empathicVoice/types/AssistantProsody.d.ts +2 -2
  242. package/serialization/resources/empathicVoice/types/AssistantProsody.js +2 -2
  243. package/serialization/resources/empathicVoice/types/AudioConfiguration.d.ts +1 -1
  244. package/serialization/resources/empathicVoice/types/AudioConfiguration.js +1 -1
  245. package/serialization/resources/empathicVoice/types/AudioInput.d.ts +1 -1
  246. package/serialization/resources/empathicVoice/types/AudioInput.js +1 -1
  247. package/serialization/resources/empathicVoice/types/AudioOutput.d.ts +2 -2
  248. package/serialization/resources/empathicVoice/types/AudioOutput.js +2 -2
  249. package/serialization/resources/empathicVoice/types/BuiltinToolConfig.d.ts +1 -1
  250. package/serialization/resources/empathicVoice/types/BuiltinToolConfig.js +1 -1
  251. package/serialization/resources/empathicVoice/types/ChatMessage.d.ts +1 -1
  252. package/serialization/resources/empathicVoice/types/ChatMessage.js +1 -1
  253. package/serialization/resources/empathicVoice/types/ChatMetadata.d.ts +2 -2
  254. package/serialization/resources/empathicVoice/types/ChatMetadata.js +2 -2
  255. package/serialization/resources/empathicVoice/types/Context.d.ts +1 -1
  256. package/serialization/resources/empathicVoice/types/Context.js +1 -1
  257. package/serialization/resources/empathicVoice/types/ContextType.d.ts +1 -1
  258. package/serialization/resources/empathicVoice/types/ContextType.js +1 -1
  259. package/serialization/resources/empathicVoice/types/LanguageModelType.d.ts +1 -1
  260. package/serialization/resources/empathicVoice/types/LanguageModelType.js +19 -0
  261. package/serialization/resources/empathicVoice/types/ModelProviderEnum.d.ts +1 -1
  262. package/serialization/resources/empathicVoice/types/ModelProviderEnum.js +3 -0
  263. package/serialization/resources/empathicVoice/types/PauseAssistantMessage.d.ts +1 -1
  264. package/serialization/resources/empathicVoice/types/PauseAssistantMessage.js +1 -1
  265. package/serialization/resources/empathicVoice/types/ResumeAssistantMessage.d.ts +1 -1
  266. package/serialization/resources/empathicVoice/types/ResumeAssistantMessage.js +1 -1
  267. package/serialization/resources/empathicVoice/types/ReturnChatEventType.d.ts +1 -1
  268. package/serialization/resources/empathicVoice/types/ReturnChatEventType.js +9 -4
  269. package/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +9 -9
  270. package/serialization/resources/empathicVoice/types/ReturnConfig.js +9 -9
  271. package/serialization/resources/empathicVoice/types/ReturnPrompt.d.ts +1 -1
  272. package/serialization/resources/empathicVoice/types/ReturnPrompt.js +1 -1
  273. package/serialization/resources/empathicVoice/types/SessionSettings.d.ts +8 -8
  274. package/serialization/resources/empathicVoice/types/SessionSettings.js +8 -8
  275. package/serialization/resources/empathicVoice/types/Tool.d.ts +3 -3
  276. package/serialization/resources/empathicVoice/types/Tool.js +3 -3
  277. package/serialization/resources/empathicVoice/types/ToolCallMessage.d.ts +3 -3
  278. package/serialization/resources/empathicVoice/types/ToolCallMessage.js +3 -3
  279. package/serialization/resources/empathicVoice/types/ToolErrorMessage.d.ts +6 -6
  280. package/serialization/resources/empathicVoice/types/ToolErrorMessage.js +6 -6
  281. package/serialization/resources/empathicVoice/types/ToolResponseMessage.d.ts +2 -2
  282. package/serialization/resources/empathicVoice/types/ToolResponseMessage.js +2 -2
  283. package/serialization/resources/empathicVoice/types/UserInput.d.ts +1 -1
  284. package/serialization/resources/empathicVoice/types/UserInput.js +1 -1
  285. package/serialization/resources/empathicVoice/types/UserInterruption.d.ts +1 -1
  286. package/serialization/resources/empathicVoice/types/UserInterruption.js +1 -1
  287. package/serialization/resources/empathicVoice/types/UserMessage.d.ts +3 -3
  288. package/serialization/resources/empathicVoice/types/UserMessage.js +3 -3
  289. package/serialization/resources/empathicVoice/types/VoiceProvider.d.ts +1 -1
  290. package/serialization/resources/empathicVoice/types/VoiceProvider.js +1 -1
  291. package/serialization/resources/empathicVoice/types/WebSocketError.d.ts +3 -3
  292. package/serialization/resources/empathicVoice/types/WebSocketError.js +3 -3
  293. package/serialization/resources/empathicVoice/types/WebhookEventChatEnded.d.ts +4 -4
  294. package/serialization/resources/empathicVoice/types/WebhookEventChatEnded.js +4 -4
  295. package/serialization/resources/empathicVoice/types/WebhookEventChatStarted.d.ts +3 -3
  296. package/serialization/resources/empathicVoice/types/WebhookEventChatStarted.js +3 -3
  297. package/serialization/resources/empathicVoice/types/index.d.ts +16 -16
  298. package/serialization/resources/empathicVoice/types/index.js +16 -16
  299. package/serialization/resources/tts/types/PostedTts.d.ts +3 -3
  300. package/serialization/resources/tts/types/PostedTts.js +3 -3
  301. package/serialization/resources/tts/types/PostedUtterance.d.ts +2 -2
  302. package/serialization/resources/tts/types/PostedUtterance.js +2 -2
  303. package/serialization/resources/tts/types/ReturnGeneration.d.ts +3 -3
  304. package/serialization/resources/tts/types/ReturnGeneration.js +3 -3
  305. package/serialization/resources/tts/types/ReturnTts.d.ts +1 -1
  306. package/serialization/resources/tts/types/ReturnTts.js +1 -1
  307. package/serialization/resources/tts/types/Snippet.d.ts +3 -3
  308. package/serialization/resources/tts/types/Snippet.js +3 -3
  309. package/serialization/resources/tts/types/SnippetAudioChunk.d.ts +0 -8
  310. package/serialization/resources/tts/types/SnippetAudioChunk.js +1 -10
  311. package/version.d.ts +1 -1
  312. package/version.js +1 -1
  313. package/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +0 -36
  314. package/api/resources/tts/client/requests/SynthesizeJsonRequest.js +0 -5
  315. package/api/resources/tts/client/requests/index.d.ts +0 -1
  316. package/core/form-data-utils/toReadableStream.d.ts +0 -1
  317. package/core/form-data-utils/toReadableStream.js +0 -50
  318. package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +0 -36
  319. package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.js +0 -5
  320. package/dist/api/resources/tts/client/requests/index.d.ts +0 -1
  321. package/dist/core/form-data-utils/toReadableStream.d.ts +0 -1
  322. package/dist/core/form-data-utils/toReadableStream.js +0 -50
  323. /package/{api/resources/tts/client/requests/index.js → core/file.js} +0 -0
  324. /package/dist/{api/resources/tts/client/requests/index.js → core/file.js} +0 -0
@@ -41,51 +41,110 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
41
41
  step((generator = generator.apply(thisArg, _arguments || [])).next());
42
42
  });
43
43
  };
44
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
45
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
46
+ var m = o[Symbol.asyncIterator], i;
47
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
48
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
49
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
50
+ };
44
51
  Object.defineProperty(exports, "__esModule", { value: true });
45
- exports.WebFormData = exports.Node16FormData = exports.Node18FormData = void 0;
52
+ exports.FormDataWrapper = void 0;
46
53
  exports.newFormData = newFormData;
54
+ const json_js_1 = require("../../core/json.js");
47
55
  const index_js_1 = require("../runtime/index.js");
48
- const toReadableStream_js_1 = require("./toReadableStream.js");
49
56
  function isNamedValue(value) {
50
57
  return typeof value === "object" && value != null && "name" in value;
51
58
  }
52
59
  function isPathedValue(value) {
53
60
  return typeof value === "object" && value != null && "path" in value;
54
61
  }
62
+ function isStreamLike(value) {
63
+ return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
64
+ }
65
+ function isReadableStream(value) {
66
+ return typeof value === "object" && value != null && "getReader" in value;
67
+ }
68
+ function isBuffer(value) {
69
+ return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
70
+ }
71
+ function isArrayBufferView(value) {
72
+ return ArrayBuffer.isView(value);
73
+ }
55
74
  function getLastPathSegment(pathStr) {
56
75
  const lastForwardSlash = pathStr.lastIndexOf("/");
57
76
  const lastBackSlash = pathStr.lastIndexOf("\\");
58
77
  const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
59
78
  return lastSlashIndex >= 0 ? pathStr.substring(lastSlashIndex + 1) : pathStr;
60
79
  }
61
- function newFormData() {
80
+ function streamToBuffer(stream) {
62
81
  return __awaiter(this, void 0, void 0, function* () {
63
- let formdata;
64
- if (index_js_1.RUNTIME.type === "node" && index_js_1.RUNTIME.parsedVersion != null && index_js_1.RUNTIME.parsedVersion >= 18) {
65
- formdata = new Node18FormData();
66
- }
67
- else if (index_js_1.RUNTIME.type === "node") {
68
- formdata = new Node16FormData();
82
+ var _a, stream_1, stream_1_1;
83
+ var _b, e_1, _c, _d;
84
+ if (index_js_1.RUNTIME.type === "node") {
85
+ const { Readable } = yield Promise.resolve().then(() => __importStar(require("stream")));
86
+ if (stream instanceof Readable) {
87
+ const chunks = [];
88
+ try {
89
+ for (_a = true, stream_1 = __asyncValues(stream); stream_1_1 = yield stream_1.next(), _b = stream_1_1.done, !_b; _a = true) {
90
+ _d = stream_1_1.value;
91
+ _a = false;
92
+ const chunk = _d;
93
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
94
+ }
95
+ }
96
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
97
+ finally {
98
+ try {
99
+ if (!_a && !_b && (_c = stream_1.return)) yield _c.call(stream_1);
100
+ }
101
+ finally { if (e_1) throw e_1.error; }
102
+ }
103
+ return Buffer.concat(chunks);
104
+ }
69
105
  }
70
- else {
71
- formdata = new WebFormData();
106
+ if (isReadableStream(stream)) {
107
+ const reader = stream.getReader();
108
+ const chunks = [];
109
+ try {
110
+ while (true) {
111
+ const { done, value } = yield reader.read();
112
+ if (done)
113
+ break;
114
+ chunks.push(value);
115
+ }
116
+ }
117
+ finally {
118
+ reader.releaseLock();
119
+ }
120
+ const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
121
+ const result = new Uint8Array(totalLength);
122
+ let offset = 0;
123
+ for (const chunk of chunks) {
124
+ result.set(chunk, offset);
125
+ offset += chunk.length;
126
+ }
127
+ return Buffer.from(result);
72
128
  }
73
- yield formdata.setup();
74
- return formdata;
129
+ throw new Error("Unsupported stream type: " + typeof stream + ". Expected Node.js Readable stream or Web ReadableStream.");
130
+ });
131
+ }
132
+ function newFormData() {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ return new FormDataWrapper();
75
135
  });
76
136
  }
77
- /**
78
- * Form Data Implementation for Node.js 18+
79
- */
80
- class Node18FormData {
137
+ class FormDataWrapper {
138
+ constructor() {
139
+ this.fd = new FormData();
140
+ }
81
141
  setup() {
82
142
  return __awaiter(this, void 0, void 0, function* () {
83
- this.fd = new (yield Promise.resolve().then(() => __importStar(require("formdata-node")))).FormData();
143
+ // noop
84
144
  });
85
145
  }
86
146
  append(key, value) {
87
- var _a;
88
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
147
+ this.fd.append(key, String(value));
89
148
  }
90
149
  getFileName(value, filename) {
91
150
  if (filename != null) {
@@ -99,130 +158,51 @@ class Node18FormData {
99
158
  }
100
159
  return undefined;
101
160
  }
102
- appendFile(key, value, fileName) {
161
+ convertToBlob(value) {
103
162
  return __awaiter(this, void 0, void 0, function* () {
104
- var _a, _b;
105
- fileName = this.getFileName(value, fileName);
163
+ if (isStreamLike(value) || isReadableStream(value)) {
164
+ const buffer = yield streamToBuffer(value);
165
+ return new Blob([buffer]);
166
+ }
106
167
  if (value instanceof Blob) {
107
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value, fileName);
168
+ return value;
108
169
  }
109
- else {
110
- (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, {
111
- type: undefined,
112
- name: fileName,
113
- [Symbol.toStringTag]: "File",
114
- stream() {
115
- return value;
116
- },
117
- });
170
+ if (isBuffer(value)) {
171
+ return new Blob([value]);
118
172
  }
119
- });
120
- }
121
- getRequest() {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- const encoder = new (yield Promise.resolve().then(() => __importStar(require("form-data-encoder")))).FormDataEncoder(this.fd);
124
- return {
125
- body: yield (0, toReadableStream_js_1.toReadableStream)(encoder),
126
- headers: encoder.headers,
127
- duplex: "half",
128
- };
129
- });
130
- }
131
- }
132
- exports.Node18FormData = Node18FormData;
133
- /**
134
- * Form Data Implementation for Node.js 16-18
135
- */
136
- class Node16FormData {
137
- setup() {
138
- return __awaiter(this, void 0, void 0, function* () {
139
- this.fd = new (yield Promise.resolve().then(() => __importStar(require("form-data")))).default();
140
- });
141
- }
142
- append(key, value) {
143
- var _a;
144
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
145
- }
146
- getFileName(value, filename) {
147
- if (filename != null) {
148
- return filename;
149
- }
150
- if (isNamedValue(value)) {
151
- return value.name;
152
- }
153
- if (isPathedValue(value) && value.path) {
154
- return getLastPathSegment(value.path.toString());
155
- }
156
- return undefined;
157
- }
158
- appendFile(key, value, fileName) {
159
- return __awaiter(this, void 0, void 0, function* () {
160
- var _a, _b;
161
- fileName = this.getFileName(value, fileName);
162
- let bufferedValue;
163
- if (value instanceof Blob) {
164
- bufferedValue = Buffer.from(yield value.arrayBuffer());
173
+ if (value instanceof ArrayBuffer) {
174
+ return new Blob([value]);
165
175
  }
166
- else {
167
- bufferedValue = value;
176
+ if (isArrayBufferView(value)) {
177
+ return new Blob([value]);
168
178
  }
169
- if (fileName == null) {
170
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, bufferedValue);
179
+ if (typeof value === "string") {
180
+ return new Blob([value]);
171
181
  }
172
- else {
173
- (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, bufferedValue, { filename: fileName });
182
+ if (typeof value === "object" && value !== null) {
183
+ return new Blob([(0, json_js_1.toJson)(value)], { type: "application/json" });
174
184
  }
185
+ return new Blob([String(value)]);
175
186
  });
176
187
  }
177
- getRequest() {
178
- return {
179
- body: this.fd,
180
- headers: this.fd ? this.fd.getHeaders() : {},
181
- };
182
- }
183
- }
184
- exports.Node16FormData = Node16FormData;
185
- /**
186
- * Form Data Implementation for Web
187
- */
188
- class WebFormData {
189
- setup() {
190
- return __awaiter(this, void 0, void 0, function* () {
191
- this.fd = new FormData();
192
- });
193
- }
194
- append(key, value) {
195
- var _a;
196
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
197
- }
198
- getFileName(value, filename) {
199
- if (filename != null) {
200
- return filename;
201
- }
202
- if (isNamedValue(value)) {
203
- return value.name;
204
- }
205
- if (isPathedValue(value) && value.path) {
206
- return getLastPathSegment(value.path.toString());
207
- }
208
- return undefined;
209
- }
210
188
  appendFile(key, value, fileName) {
211
189
  return __awaiter(this, void 0, void 0, function* () {
212
- var _a, _b;
213
190
  fileName = this.getFileName(value, fileName);
214
- if (value instanceof Blob) {
215
- (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value, fileName);
216
- return;
191
+ const blob = yield this.convertToBlob(value);
192
+ if (fileName) {
193
+ this.fd.append(key, blob, fileName);
194
+ }
195
+ else {
196
+ this.fd.append(key, blob);
217
197
  }
218
- (_b = this.fd) === null || _b === void 0 ? void 0 : _b.append(key, new Blob([value]), fileName);
219
198
  });
220
199
  }
221
200
  getRequest() {
222
201
  return {
223
202
  body: this.fd,
224
203
  headers: {},
204
+ duplex: "half",
225
205
  };
226
206
  }
227
207
  }
228
- exports.WebFormData = WebFormData;
208
+ exports.FormDataWrapper = FormDataWrapper;
package/core/index.d.ts CHANGED
@@ -5,5 +5,6 @@ export * from "./stream";
5
5
  export * from "./utils";
6
6
  export * from "./pagination";
7
7
  export * from "./form-data-utils";
8
+ export * from "./file";
8
9
  export * as serialization from "./schemas";
9
10
  export * from "./websocket";
package/core/index.js CHANGED
@@ -44,6 +44,7 @@ __exportStar(require("./stream"), exports);
44
44
  __exportStar(require("./utils"), exports);
45
45
  __exportStar(require("./pagination"), exports);
46
46
  __exportStar(require("./form-data-utils"), exports);
47
+ __exportStar(require("./file"), exports);
47
48
  exports.serialization = __importStar(require("./schemas"));
48
49
  // This one is manually added
49
50
  __exportStar(require("./websocket"), exports);
@@ -1 +1,2 @@
1
+ export {};
1
2
  export * from "./requests";
@@ -1 +1,2 @@
1
+ export {};
1
2
  export * from "./requests";
@@ -1 +1,2 @@
1
+ export {};
1
2
  export * from "./requests";
@@ -37,7 +37,11 @@ import * as Hume from "../../../../../../index";
37
37
  * }
38
38
  */
39
39
  export interface PostedConfig {
40
- /** Specifies the EVI version to use. Use `"1"` for version 1, or `"2"` for the latest enhanced version. For a detailed comparison of the two versions, refer to our [guide](/docs/speech-to-speech-evi/configuration/evi-version). */
40
+ /**
41
+ * Specifies the EVI version to use. See our [EVI Version Guide](/docs/speech-to-speech-evi/configuration/evi-version) for differences between versions.
42
+ *
43
+ * **We're officially sunsetting EVI versions 1 and 2 on August 30, 2025**. To keep things running smoothly, be sure to [migrate to EVI 3](/docs/speech-to-speech-evi/configuration/evi-version#migrating-to-evi-3) before then.
44
+ */
41
45
  eviVersion: string;
42
46
  /** Name applied to all versions of a particular Config. */
43
47
  name: string;
@@ -1 +1,2 @@
1
+ export {};
1
2
  export * from "./requests";
@@ -1 +1,2 @@
1
+ export {};
1
2
  export * from "./requests";
@@ -5,12 +5,12 @@
5
5
  * When provided, the output is an assistant end message.
6
6
  */
7
7
  export interface AssistantEnd {
8
- /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
9
- customSessionId?: string;
10
8
  /**
11
9
  * The type of message sent through the socket; for an Assistant End message, this must be `assistant_end`.
12
10
  *
13
11
  * This message indicates the conclusion of the assistant’s response, signaling that the assistant has finished speaking for the current conversational turn.
14
12
  */
15
13
  type: "assistant_end";
14
+ /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
15
+ customSessionId?: string;
16
16
  }
@@ -5,6 +5,8 @@
5
5
  * When provided, the input is spoken by EVI.
6
6
  */
7
7
  export interface AssistantInput {
8
+ /** The type of message sent through the socket; must be `assistant_input` for our server to correctly identify and process it as an Assistant Input message. */
9
+ type: "assistant_input";
8
10
  /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
9
11
  customSessionId?: string;
10
12
  /**
@@ -13,6 +15,4 @@ export interface AssistantInput {
13
15
  * EVI uses this text to generate spoken audio using our proprietary expressive text-to-speech model. Our model adds appropriate emotional inflections and tones to the text based on the user’s expressions and the context of the conversation. The synthesized audio is streamed back to the user as an [Assistant Message](/reference/empathic-voice-interface-evi/chat/chat#receive.AssistantMessage.type).
14
16
  */
15
17
  text: string;
16
- /** The type of message sent through the socket; must be `assistant_input` for our server to correctly identify and process it as an Assistant Input message. */
17
- type: "assistant_input";
18
18
  }
@@ -6,20 +6,20 @@ import * as Hume from "../../../index";
6
6
  * When provided, the output is an assistant message.
7
7
  */
8
8
  export interface AssistantMessage {
9
+ /**
10
+ * The type of message sent through the socket; for an Assistant Message, this must be `assistant_message`.
11
+ *
12
+ * This message contains both a transcript of the assistant’s response and the expression measurement predictions of the assistant’s audio output.
13
+ */
14
+ type: "assistant_message";
9
15
  /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
10
16
  customSessionId?: string;
11
- /** Indicates if this message was inserted into the conversation as text from an [Assistant Input message](/reference/empathic-voice-interface-evi/chat/chat#send.AssistantInput.text). */
12
- fromText: boolean;
13
17
  /** ID of the assistant message. Allows the Assistant Message to be tracked and referenced. */
14
18
  id?: string;
15
19
  /** Transcript of the message. */
16
20
  message: Hume.empathicVoice.ChatMessage;
17
21
  /** Inference model results. */
18
22
  models: Hume.empathicVoice.Inference;
19
- /**
20
- * The type of message sent through the socket; for an Assistant Message, this must be `assistant_message`.
21
- *
22
- * This message contains both a transcript of the assistant’s response and the expression measurement predictions of the assistant’s audio output.
23
- */
24
- type: "assistant_message";
23
+ /** Indicates if this message was inserted into the conversation as text from an [Assistant Input message](/reference/empathic-voice-interface-evi/chat/chat#send.AssistantInput.text). */
24
+ fromText: boolean;
25
25
  }
@@ -6,16 +6,16 @@ import * as Hume from "../../../index";
6
6
  * When provided, the output is an Assistant Prosody message.
7
7
  */
8
8
  export interface AssistantProsody {
9
- /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
10
- customSessionId?: string;
11
- /** Unique identifier for the segment. */
12
- id?: string;
13
- /** Inference model results. */
14
- models: Hume.empathicVoice.Inference;
15
9
  /**
16
10
  * The type of message sent through the socket; for an Assistant Prosody message, this must be `assistant_PROSODY`.
17
11
  *
18
12
  * This message the expression measurement predictions of the assistant's audio output.
19
13
  */
20
14
  type: "assistant_prosody";
15
+ /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
16
+ customSessionId?: string;
17
+ /** Inference model results. */
18
+ models: Hume.empathicVoice.Inference;
19
+ /** Unique identifier for the segment. */
20
+ id?: string;
21
21
  }
@@ -3,10 +3,10 @@
3
3
  */
4
4
  import * as Hume from "../../../index";
5
5
  export interface AudioConfiguration {
6
- /** Number of audio channels. */
7
- channels: number;
8
6
  /** Encoding format of the audio input, such as `linear16`. */
9
7
  encoding: Hume.empathicVoice.Encoding;
8
+ /** Number of audio channels. */
9
+ channels: number;
10
10
  /** Audio sample rate. Number of samples per second in the audio input, measured in Hertz. */
11
11
  sampleRate: number;
12
12
  }
@@ -5,6 +5,12 @@
5
5
  * When provided, the input is audio.
6
6
  */
7
7
  export interface AudioInput {
8
+ /**
9
+ * The type of message sent through the socket; must be `audio_input` for our server to correctly identify and process it as an Audio Input message.
10
+ *
11
+ * This message is used for sending audio input data to EVI for processing and expression measurement. Audio data should be sent as a continuous stream, encoded in Base64.
12
+ */
13
+ type: "audio_input";
8
14
  /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
9
15
  customSessionId?: string;
10
16
  /**
@@ -17,10 +23,4 @@ export interface AudioInput {
17
23
  * Hume recommends streaming audio with a buffer window of 20 milliseconds (ms), or 100 milliseconds (ms) for web applications.
18
24
  */
19
25
  data: string;
20
- /**
21
- * The type of message sent through the socket; must be `audio_input` for our server to correctly identify and process it as an Audio Input message.
22
- *
23
- * This message is used for sending audio input data to EVI for processing and expression measurement. Audio data should be sent as a continuous stream, encoded in Base64.
24
- */
25
- type: "audio_input";
26
26
  }
@@ -5,14 +5,14 @@
5
5
  * The type of message sent through the socket; for an Audio Output message, this must be `audio_output`.
6
6
  */
7
7
  export interface AudioOutput {
8
+ /** The type of message sent through the socket; for an Audio Output message, this must be `audio_output`. */
9
+ type: "audio_output";
8
10
  /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
9
11
  customSessionId?: string;
10
- /** Base64 encoded audio output. This encoded audio is transmitted to the client, where it can be decoded and played back as part of the user interaction. */
11
- data: string;
12
12
  /** ID of the audio output. Allows the Audio Output message to be tracked and referenced. */
13
13
  id: string;
14
14
  /** Index of the chunk of audio relative to the whole audio segment. */
15
15
  index: number;
16
- /** The type of message sent through the socket; for an Audio Output message, this must be `audio_output`. */
17
- type: "audio_output";
16
+ /** Base64 encoded audio output. This encoded audio is transmitted to the client, where it can be decoded and played back as part of the user interaction. */
17
+ data: string;
18
18
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import * as Hume from "../../../index";
5
5
  export interface BuiltinToolConfig {
6
+ name: Hume.empathicVoice.BuiltInTool;
6
7
  /** Optional text passed to the supplemental LLM if the tool call fails. The LLM then uses this text to generate a response back to the user, ensuring continuity in the conversation. */
7
8
  fallbackContent?: string;
8
- name: Hume.empathicVoice.BuiltInTool;
9
9
  }
@@ -3,10 +3,10 @@
3
3
  */
4
4
  import * as Hume from "../../../index";
5
5
  export interface ChatMessage {
6
- /** Transcript of the message. */
7
- content?: string;
8
6
  /** Role of who is providing the message. */
9
7
  role: Hume.empathicVoice.Role;
8
+ /** Transcript of the message. */
9
+ content?: string;
10
10
  /** Function call name and arguments. */
11
11
  toolCall?: Hume.empathicVoice.ToolCallMessage;
12
12
  /** Function call response from client. */
@@ -5,6 +5,14 @@
5
5
  * When provided, the output is a chat metadata message.
6
6
  */
7
7
  export interface ChatMetadata {
8
+ /**
9
+ * The type of message sent through the socket; for a Chat Metadata message, this must be `chat_metadata`.
10
+ *
11
+ * The Chat Metadata message is the first message you receive after establishing a connection with EVI and contains important identifiers for the current Chat session.
12
+ */
13
+ type: "chat_metadata";
14
+ /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
15
+ customSessionId?: string;
8
16
  /**
9
17
  * ID of the Chat Group.
10
18
  *
@@ -15,14 +23,6 @@ export interface ChatMetadata {
15
23
  chatGroupId: string;
16
24
  /** ID of the Chat session. Allows the Chat session to be tracked and referenced. */
17
25
  chatId: string;
18
- /** Used to manage conversational state, correlate frontend and backend data, and persist conversations across EVI sessions. */
19
- customSessionId?: string;
20
26
  /** ID of the initiating request. */
21
27
  requestId?: string;
22
- /**
23
- * The type of message sent through the socket; for a Chat Metadata message, this must be `chat_metadata`.
24
- *
25
- * The Chat Metadata message is the first message you receive after establishing a connection with EVI and contains important identifiers for the current Chat session.
26
- */
27
- type: "chat_metadata";
28
28
  }
@@ -3,24 +3,18 @@
3
3
  */
4
4
  import * as Hume from "../../../index";
5
5
  export interface Context {
6
- /**
7
- * The context to be injected into the conversation. Helps inform the LLM's response by providing relevant information about the ongoing conversation.
8
- *
9
- * This text will be appended to the end of user messages based on the chosen persistence level. For example, if you want to remind EVI of its role as a helpful weather assistant, the context you insert will be appended to the end of user messages as `{Context: You are a helpful weather assistant}`.
10
- */
11
- text: string;
12
6
  /**
13
7
  * The persistence level of the injected context. Specifies how long the injected context will remain active in the session.
14
8
  *
15
- * There are three possible context types:
16
- *
17
- * - **Persistent**: The context is appended to all user messages for the duration of the session.
18
- *
19
- * - **Temporary**: The context is appended only to the next user message.
9
+ * - **Temporary**: Context that is only applied to the following assistant response.
20
10
  *
21
- * - **Editable**: The original context is updated to reflect the new context.
22
- *
23
- * If the type is not specified, it will default to `temporary`.
11
+ * - **Persistent**: Context that is applied to all subsequent assistant responses for the remainder of the Chat.
24
12
  */
25
13
  type?: Hume.empathicVoice.ContextType;
14
+ /**
15
+ * The context to be injected into the conversation. Helps inform the LLM's response by providing relevant information about the ongoing conversation.
16
+ *
17
+ * This text will be appended to the end of [user_messages](/reference/speech-to-speech-evi/chat#receive.UserMessage.message.content) based on the chosen persistence level. For example, if you want to remind EVI of its role as a helpful weather assistant, the context you insert will be appended to the end of user messages as `{Context: You are a helpful weather assistant}`.
18
+ */
19
+ text: string;
26
20
  }
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export type ContextType = "editable" | "persistent" | "temporary";
4
+ export type ContextType = "temporary" | "persistent";
5
5
  export declare const ContextType: {
6
- readonly Editable: "editable";
7
- readonly Persistent: "persistent";
8
6
  readonly Temporary: "temporary";
7
+ readonly Persistent: "persistent";
9
8
  };
@@ -5,7 +5,6 @@
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ContextType = void 0;
7
7
  exports.ContextType = {
8
- Editable: "editable",
9
- Persistent: "persistent",
10
8
  Temporary: "temporary",
9
+ Persistent: "persistent",
11
10
  };