@elevenlabs/elevenlabs-js 2.20.0 → 2.21.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 (530) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +9 -4
  3. package/api/resources/conversationalAi/conversation/Conversation.d.ts +2 -0
  4. package/api/resources/conversationalAi/conversation/Conversation.js +4 -0
  5. package/api/resources/conversationalAi/resources/conversations/client/Client.d.ts +2 -1
  6. package/api/resources/conversationalAi/resources/conversations/client/Client.js +6 -2
  7. package/api/resources/conversationalAi/resources/conversations/client/requests/ConversationsListRequest.d.ts +4 -1
  8. package/api/resources/conversationalAi/resources/index.d.ts +2 -1
  9. package/api/resources/conversationalAi/resources/index.js +3 -2
  10. package/api/resources/conversationalAi/resources/mcpServers/client/requests/McpServerConfigUpdateRequestModel.d.ts +4 -0
  11. package/api/resources/conversationalAi/resources/mcpServers/index.d.ts +1 -0
  12. package/api/resources/conversationalAi/resources/mcpServers/index.js +1 -0
  13. package/api/resources/conversationalAi/resources/mcpServers/types/McpServerConfigUpdateRequestModelRequestHeadersValue.d.ts +2 -0
  14. package/api/resources/conversationalAi/resources/mcpServers/types/index.d.ts +1 -0
  15. package/api/resources/conversationalAi/resources/mcpServers/types/index.js +17 -0
  16. package/api/resources/dubbing/client/Client.d.ts +1 -6
  17. package/api/resources/dubbing/client/Client.js +13 -10
  18. package/api/resources/dubbing/client/requests/BodyDubAVideoOrAnAudioFileV1DubbingPost.d.ts +5 -10
  19. package/api/resources/index.d.ts +1 -0
  20. package/api/resources/index.js +2 -1
  21. package/api/resources/music/client/requests/BodyComposeMusicV1MusicPost.d.ts +0 -6
  22. package/api/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +0 -6
  23. package/api/resources/music/client/requests/BodyStreamComposedMusicV1MusicStreamPost.d.ts +0 -6
  24. package/api/resources/pronunciationDictionaries/client/Client.d.ts +0 -1
  25. package/api/resources/pronunciationDictionaries/client/Client.js +3 -2
  26. package/api/resources/pronunciationDictionaries/client/requests/BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromFilePost.d.ts +1 -2
  27. package/api/resources/speechToText/client/Client.d.ts +0 -1
  28. package/api/resources/speechToText/client/Client.js +3 -2
  29. package/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +1 -3
  30. package/api/resources/studio/resources/projects/client/Client.d.ts +0 -1
  31. package/api/resources/studio/resources/projects/client/Client.js +3 -2
  32. package/api/resources/studio/resources/projects/client/requests/BodyCreateStudioProjectV1StudioProjectsPost.d.ts +1 -2
  33. package/api/resources/studio/resources/projects/resources/content/client/Client.d.ts +1 -3
  34. package/api/resources/studio/resources/projects/resources/content/client/Client.js +4 -4
  35. package/api/resources/studio/resources/projects/resources/content/client/requests/BodyUpdateStudioProjectContentV1StudioProjectsProjectIdContentPost.d.ts +2 -4
  36. package/api/resources/textToDialogue/client/Client.d.ts +27 -0
  37. package/api/resources/textToDialogue/client/Client.js +182 -0
  38. package/api/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.d.ts +32 -0
  39. package/api/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.d.ts +32 -0
  40. package/api/resources/textToDialogue/client/requests/index.d.ts +2 -0
  41. package/api/resources/textToDialogue/types/BodyTextToDialogueFullWithTimestampsApplyTextNormalization.d.ts +7 -0
  42. package/api/resources/textToDialogue/types/BodyTextToDialogueFullWithTimestampsApplyTextNormalization.js +10 -0
  43. package/api/resources/textToDialogue/types/BodyTextToDialogueStreamWithTimestampsApplyTextNormalization.d.ts +7 -0
  44. package/api/resources/textToDialogue/types/BodyTextToDialogueStreamWithTimestampsApplyTextNormalization.js +10 -0
  45. package/api/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.d.ts +25 -0
  46. package/api/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.js +28 -0
  47. package/api/resources/textToDialogue/types/TextToDialogueStreamWithTimestampsRequestOutputFormat.d.ts +25 -0
  48. package/api/resources/textToDialogue/types/TextToDialogueStreamWithTimestampsRequestOutputFormat.js +28 -0
  49. package/api/resources/textToDialogue/types/index.d.ts +4 -0
  50. package/api/resources/textToDialogue/types/index.js +4 -0
  51. package/api/resources/tokens/client/Client.d.ts +20 -0
  52. package/api/resources/tokens/client/Client.js +15 -0
  53. package/api/resources/tokens/client/index.d.ts +1 -0
  54. package/api/resources/tokens/client/index.js +2 -0
  55. package/api/resources/tokens/index.d.ts +2 -0
  56. package/api/resources/tokens/index.js +18 -0
  57. package/api/resources/tokens/resources/index.d.ts +1 -0
  58. package/api/resources/tokens/resources/index.js +37 -0
  59. package/api/resources/tokens/resources/singleUse/client/Client.d.ts +45 -0
  60. package/api/resources/tokens/resources/singleUse/client/Client.js +130 -0
  61. package/api/resources/tokens/resources/singleUse/client/index.d.ts +1 -0
  62. package/api/resources/tokens/resources/singleUse/client/index.js +2 -0
  63. package/api/resources/tokens/resources/singleUse/index.d.ts +1 -0
  64. package/api/resources/tokens/resources/singleUse/index.js +17 -0
  65. package/api/types/AudioWithTimestampsAndVoiceSegmentsResponseModel.d.ts +11 -0
  66. package/api/types/ClientToolConfigInput.d.ts +4 -0
  67. package/api/types/ClientToolConfigOutput.d.ts +4 -0
  68. package/api/types/CreateTwilioPhoneNumberRequest.d.ts +3 -0
  69. package/api/types/GuardrailsV1Input.d.ts +5 -0
  70. package/api/types/GuardrailsV1Output.d.ts +5 -0
  71. package/api/types/Llm.d.ts +2 -0
  72. package/api/types/Llm.js +2 -0
  73. package/api/types/McpServerConfigInput.d.ts +2 -0
  74. package/api/types/McpServerConfigInputRequestHeadersValue.d.ts +1 -1
  75. package/api/types/McpServerConfigOutput.d.ts +2 -0
  76. package/api/types/McpServerConfigOutputRequestHeadersValue.d.ts +1 -1
  77. package/api/types/MetricType.d.ts +1 -0
  78. package/api/types/MetricType.js +1 -0
  79. package/api/types/ModerationConfig.d.ts +14 -0
  80. package/api/types/ModerationConfig.js +3 -0
  81. package/api/types/ModerationGuardrailInput.d.ts +4 -0
  82. package/api/types/ModerationGuardrailInput.js +3 -0
  83. package/api/types/ModerationGuardrailOutput.d.ts +4 -0
  84. package/api/types/ModerationGuardrailOutput.js +3 -0
  85. package/api/types/ReferencedToolCommonModel.d.ts +1 -1
  86. package/api/types/ReferencedToolCommonModelType.d.ts +8 -0
  87. package/api/types/ReferencedToolCommonModelType.js +11 -0
  88. package/api/types/RegionConfigRequest.d.ts +9 -0
  89. package/api/types/RegionConfigRequest.js +3 -0
  90. package/api/types/SingleUseTokenResponseModel.d.ts +4 -0
  91. package/api/types/SingleUseTokenResponseModel.js +3 -0
  92. package/api/types/SingleUseTokenType.d.ts +1 -0
  93. package/api/types/SingleUseTokenType.js +3 -0
  94. package/api/types/SongSection.d.ts +1 -1
  95. package/api/types/StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel.d.ts +11 -0
  96. package/api/types/StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel.js +3 -0
  97. package/api/types/SystemToolConfigInput.d.ts +4 -0
  98. package/api/types/SystemToolConfigOutput.d.ts +4 -0
  99. package/api/types/ThresholdGuardrail.d.ts +4 -0
  100. package/api/types/ThresholdGuardrail.js +3 -0
  101. package/api/types/ToolCallSoundBehavior.d.ts +6 -0
  102. package/api/types/ToolCallSoundBehavior.js +9 -0
  103. package/api/types/ToolCallSoundType.d.ts +9 -0
  104. package/api/types/ToolCallSoundType.js +12 -0
  105. package/api/types/ToolRequestModelToolConfig.d.ts +1 -5
  106. package/api/types/TurnConfig.d.ts +2 -2
  107. package/api/types/TurnConfigWorkflowOverride.d.ts +2 -2
  108. package/api/types/TurnEagerness.d.ts +7 -0
  109. package/api/types/TurnEagerness.js +10 -0
  110. package/api/types/TwilioEdgeLocation.d.ts +13 -0
  111. package/api/types/TwilioEdgeLocation.js +16 -0
  112. package/api/types/TwilioRegionId.d.ts +7 -0
  113. package/api/types/TwilioRegionId.js +10 -0
  114. package/api/types/User.d.ts +0 -2
  115. package/api/types/VadConfig.d.ts +0 -2
  116. package/api/types/VadConfigWorkflowOverride.d.ts +0 -2
  117. package/api/types/VoiceSegment.d.ts +12 -0
  118. package/api/types/VoiceSegment.js +3 -0
  119. package/api/types/WebhookToolConfigInput.d.ts +4 -0
  120. package/api/types/WebhookToolConfigOutput.d.ts +4 -0
  121. package/api/types/WorkspaceResourceType.d.ts +2 -0
  122. package/api/types/WorkspaceResourceType.js +2 -0
  123. package/api/types/index.d.ts +18 -5
  124. package/api/types/index.js +18 -5
  125. package/dist/Client.d.ts +3 -0
  126. package/dist/Client.js +9 -4
  127. package/dist/api/resources/conversationalAi/conversation/Conversation.d.ts +2 -0
  128. package/dist/api/resources/conversationalAi/conversation/Conversation.js +4 -0
  129. package/dist/api/resources/conversationalAi/resources/conversations/client/Client.d.ts +2 -1
  130. package/dist/api/resources/conversationalAi/resources/conversations/client/Client.js +6 -2
  131. package/dist/api/resources/conversationalAi/resources/conversations/client/requests/ConversationsListRequest.d.ts +4 -1
  132. package/dist/api/resources/conversationalAi/resources/index.d.ts +2 -1
  133. package/dist/api/resources/conversationalAi/resources/index.js +3 -2
  134. package/dist/api/resources/conversationalAi/resources/mcpServers/client/requests/McpServerConfigUpdateRequestModel.d.ts +4 -0
  135. package/dist/api/resources/conversationalAi/resources/mcpServers/index.d.ts +1 -0
  136. package/dist/api/resources/conversationalAi/resources/mcpServers/index.js +1 -0
  137. package/dist/api/resources/conversationalAi/resources/mcpServers/types/McpServerConfigUpdateRequestModelRequestHeadersValue.d.ts +2 -0
  138. package/dist/api/resources/conversationalAi/resources/mcpServers/types/McpServerConfigUpdateRequestModelRequestHeadersValue.js +3 -0
  139. package/dist/api/resources/conversationalAi/resources/mcpServers/types/index.d.ts +1 -0
  140. package/dist/api/resources/conversationalAi/resources/mcpServers/types/index.js +17 -0
  141. package/dist/api/resources/dubbing/client/Client.d.ts +1 -6
  142. package/dist/api/resources/dubbing/client/Client.js +13 -10
  143. package/dist/api/resources/dubbing/client/requests/BodyDubAVideoOrAnAudioFileV1DubbingPost.d.ts +5 -10
  144. package/dist/api/resources/index.d.ts +1 -0
  145. package/dist/api/resources/index.js +2 -1
  146. package/dist/api/resources/music/client/requests/BodyComposeMusicV1MusicPost.d.ts +0 -6
  147. package/dist/api/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +0 -6
  148. package/dist/api/resources/music/client/requests/BodyStreamComposedMusicV1MusicStreamPost.d.ts +0 -6
  149. package/dist/api/resources/pronunciationDictionaries/client/Client.d.ts +0 -1
  150. package/dist/api/resources/pronunciationDictionaries/client/Client.js +3 -2
  151. package/dist/api/resources/pronunciationDictionaries/client/requests/BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFromFilePost.d.ts +1 -2
  152. package/dist/api/resources/speechToText/client/Client.d.ts +0 -1
  153. package/dist/api/resources/speechToText/client/Client.js +3 -2
  154. package/dist/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +1 -3
  155. package/dist/api/resources/studio/resources/projects/client/Client.d.ts +0 -1
  156. package/dist/api/resources/studio/resources/projects/client/Client.js +3 -2
  157. package/dist/api/resources/studio/resources/projects/client/requests/BodyCreateStudioProjectV1StudioProjectsPost.d.ts +1 -2
  158. package/dist/api/resources/studio/resources/projects/resources/content/client/Client.d.ts +1 -3
  159. package/dist/api/resources/studio/resources/projects/resources/content/client/Client.js +4 -4
  160. package/dist/api/resources/studio/resources/projects/resources/content/client/requests/BodyUpdateStudioProjectContentV1StudioProjectsProjectIdContentPost.d.ts +2 -4
  161. package/dist/api/resources/textToDialogue/client/Client.d.ts +27 -0
  162. package/dist/api/resources/textToDialogue/client/Client.js +182 -0
  163. package/dist/api/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.d.ts +32 -0
  164. package/dist/api/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.js +3 -0
  165. package/dist/api/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.d.ts +32 -0
  166. package/dist/api/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.js +3 -0
  167. package/dist/api/resources/textToDialogue/client/requests/index.d.ts +2 -0
  168. package/dist/api/resources/textToDialogue/types/BodyTextToDialogueFullWithTimestampsApplyTextNormalization.d.ts +7 -0
  169. package/dist/api/resources/textToDialogue/types/BodyTextToDialogueFullWithTimestampsApplyTextNormalization.js +10 -0
  170. package/dist/api/resources/textToDialogue/types/BodyTextToDialogueStreamWithTimestampsApplyTextNormalization.d.ts +7 -0
  171. package/dist/api/resources/textToDialogue/types/BodyTextToDialogueStreamWithTimestampsApplyTextNormalization.js +10 -0
  172. package/dist/api/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.d.ts +25 -0
  173. package/dist/api/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.js +28 -0
  174. package/dist/api/resources/textToDialogue/types/TextToDialogueStreamWithTimestampsRequestOutputFormat.d.ts +25 -0
  175. package/dist/api/resources/textToDialogue/types/TextToDialogueStreamWithTimestampsRequestOutputFormat.js +28 -0
  176. package/dist/api/resources/textToDialogue/types/index.d.ts +4 -0
  177. package/dist/api/resources/textToDialogue/types/index.js +4 -0
  178. package/dist/api/resources/tokens/client/Client.d.ts +20 -0
  179. package/dist/api/resources/tokens/client/Client.js +15 -0
  180. package/dist/api/resources/tokens/client/index.d.ts +1 -0
  181. package/dist/api/resources/tokens/client/index.js +2 -0
  182. package/dist/api/resources/tokens/index.d.ts +2 -0
  183. package/dist/api/resources/tokens/index.js +18 -0
  184. package/dist/api/resources/tokens/resources/index.d.ts +1 -0
  185. package/dist/api/resources/tokens/resources/index.js +37 -0
  186. package/dist/api/resources/tokens/resources/singleUse/client/Client.d.ts +45 -0
  187. package/dist/api/resources/tokens/resources/singleUse/client/Client.js +130 -0
  188. package/dist/api/resources/tokens/resources/singleUse/client/index.d.ts +1 -0
  189. package/dist/api/resources/tokens/resources/singleUse/client/index.js +2 -0
  190. package/dist/api/resources/tokens/resources/singleUse/index.d.ts +1 -0
  191. package/dist/api/resources/tokens/resources/singleUse/index.js +17 -0
  192. package/dist/api/types/AudioWithTimestampsAndVoiceSegmentsResponseModel.d.ts +11 -0
  193. package/dist/api/types/AudioWithTimestampsAndVoiceSegmentsResponseModel.js +3 -0
  194. package/dist/api/types/ClientToolConfigInput.d.ts +4 -0
  195. package/dist/api/types/ClientToolConfigOutput.d.ts +4 -0
  196. package/dist/api/types/CreateTwilioPhoneNumberRequest.d.ts +3 -0
  197. package/dist/api/types/GuardrailsV1Input.d.ts +5 -0
  198. package/dist/api/types/GuardrailsV1Input.js +3 -0
  199. package/dist/api/types/GuardrailsV1Output.d.ts +5 -0
  200. package/dist/api/types/GuardrailsV1Output.js +3 -0
  201. package/dist/api/types/Llm.d.ts +2 -0
  202. package/dist/api/types/Llm.js +2 -0
  203. package/dist/api/types/McpServerConfigInput.d.ts +2 -0
  204. package/dist/api/types/McpServerConfigInputRequestHeadersValue.d.ts +1 -1
  205. package/dist/api/types/McpServerConfigOutput.d.ts +2 -0
  206. package/dist/api/types/McpServerConfigOutputRequestHeadersValue.d.ts +1 -1
  207. package/dist/api/types/MetricType.d.ts +1 -0
  208. package/dist/api/types/MetricType.js +1 -0
  209. package/dist/api/types/ModerationConfig.d.ts +14 -0
  210. package/dist/api/types/ModerationConfig.js +3 -0
  211. package/dist/api/types/ModerationGuardrailInput.d.ts +4 -0
  212. package/dist/api/types/ModerationGuardrailInput.js +3 -0
  213. package/dist/api/types/ModerationGuardrailOutput.d.ts +4 -0
  214. package/dist/api/types/ModerationGuardrailOutput.js +3 -0
  215. package/dist/api/types/ReferencedToolCommonModel.d.ts +1 -1
  216. package/dist/api/types/ReferencedToolCommonModelType.d.ts +8 -0
  217. package/dist/api/types/ReferencedToolCommonModelType.js +11 -0
  218. package/dist/api/types/RegionConfigRequest.d.ts +9 -0
  219. package/dist/api/types/RegionConfigRequest.js +3 -0
  220. package/dist/api/types/SingleUseTokenResponseModel.d.ts +4 -0
  221. package/dist/api/types/SingleUseTokenResponseModel.js +3 -0
  222. package/dist/api/types/SingleUseTokenType.d.ts +1 -0
  223. package/dist/api/types/SingleUseTokenType.js +3 -0
  224. package/dist/api/types/SongSection.d.ts +1 -1
  225. package/dist/api/types/StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel.d.ts +11 -0
  226. package/dist/api/types/StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel.js +3 -0
  227. package/dist/api/types/SystemToolConfigInput.d.ts +4 -0
  228. package/dist/api/types/SystemToolConfigOutput.d.ts +4 -0
  229. package/dist/api/types/ThresholdGuardrail.d.ts +4 -0
  230. package/dist/api/types/ThresholdGuardrail.js +3 -0
  231. package/dist/api/types/ToolCallSoundBehavior.d.ts +6 -0
  232. package/dist/api/types/ToolCallSoundBehavior.js +9 -0
  233. package/dist/api/types/ToolCallSoundType.d.ts +9 -0
  234. package/dist/api/types/ToolCallSoundType.js +12 -0
  235. package/dist/api/types/ToolRequestModelToolConfig.d.ts +1 -5
  236. package/dist/api/types/TurnConfig.d.ts +2 -2
  237. package/dist/api/types/TurnConfigWorkflowOverride.d.ts +2 -2
  238. package/dist/api/types/TurnEagerness.d.ts +7 -0
  239. package/dist/api/types/TurnEagerness.js +10 -0
  240. package/dist/api/types/TwilioEdgeLocation.d.ts +13 -0
  241. package/dist/api/types/TwilioEdgeLocation.js +16 -0
  242. package/dist/api/types/TwilioRegionId.d.ts +7 -0
  243. package/dist/api/types/TwilioRegionId.js +10 -0
  244. package/dist/api/types/User.d.ts +0 -2
  245. package/dist/api/types/VadConfig.d.ts +0 -2
  246. package/dist/api/types/VadConfigWorkflowOverride.d.ts +0 -2
  247. package/dist/api/types/VoiceSegment.d.ts +12 -0
  248. package/dist/api/types/VoiceSegment.js +3 -0
  249. package/dist/api/types/WebhookToolConfigInput.d.ts +4 -0
  250. package/dist/api/types/WebhookToolConfigOutput.d.ts +4 -0
  251. package/dist/api/types/WorkspaceResourceType.d.ts +2 -0
  252. package/dist/api/types/WorkspaceResourceType.js +2 -0
  253. package/dist/api/types/index.d.ts +18 -5
  254. package/dist/api/types/index.js +18 -5
  255. package/dist/serialization/resources/conversationalAi/resources/index.d.ts +2 -1
  256. package/dist/serialization/resources/conversationalAi/resources/index.js +3 -2
  257. package/dist/serialization/resources/conversationalAi/resources/mcpServers/client/requests/McpServerConfigUpdateRequestModel.d.ts +4 -0
  258. package/dist/serialization/resources/conversationalAi/resources/mcpServers/client/requests/McpServerConfigUpdateRequestModel.js +6 -0
  259. package/dist/serialization/resources/conversationalAi/resources/mcpServers/index.d.ts +1 -0
  260. package/dist/serialization/resources/conversationalAi/resources/mcpServers/index.js +1 -0
  261. package/dist/serialization/resources/conversationalAi/resources/mcpServers/types/McpServerConfigUpdateRequestModelRequestHeadersValue.d.ts +9 -0
  262. package/dist/serialization/resources/conversationalAi/resources/mcpServers/types/McpServerConfigUpdateRequestModelRequestHeadersValue.js +41 -0
  263. package/dist/serialization/resources/conversationalAi/resources/mcpServers/types/index.d.ts +1 -0
  264. package/dist/serialization/resources/conversationalAi/resources/mcpServers/types/index.js +17 -0
  265. package/dist/serialization/resources/music/client/requests/BodyComposeMusicV1MusicPost.d.ts +0 -2
  266. package/dist/serialization/resources/music/client/requests/BodyComposeMusicV1MusicPost.js +0 -2
  267. package/dist/serialization/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +0 -2
  268. package/dist/serialization/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +0 -2
  269. package/dist/serialization/resources/music/client/requests/BodyStreamComposedMusicV1MusicStreamPost.d.ts +0 -2
  270. package/dist/serialization/resources/music/client/requests/BodyStreamComposedMusicV1MusicStreamPost.js +0 -2
  271. package/dist/serialization/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.d.ts +19 -0
  272. package/dist/serialization/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.js +51 -0
  273. package/dist/serialization/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.d.ts +19 -0
  274. package/dist/serialization/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.js +51 -0
  275. package/dist/serialization/resources/textToDialogue/client/requests/index.d.ts +2 -0
  276. package/dist/serialization/resources/textToDialogue/client/requests/index.js +5 -1
  277. package/dist/serialization/resources/textToDialogue/types/BodyTextToDialogueFullWithTimestampsApplyTextNormalization.d.ts +7 -0
  278. package/dist/serialization/resources/textToDialogue/types/BodyTextToDialogueFullWithTimestampsApplyTextNormalization.js +39 -0
  279. package/dist/serialization/resources/textToDialogue/types/BodyTextToDialogueStreamWithTimestampsApplyTextNormalization.d.ts +7 -0
  280. package/dist/serialization/resources/textToDialogue/types/BodyTextToDialogueStreamWithTimestampsApplyTextNormalization.js +39 -0
  281. package/dist/serialization/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.d.ts +7 -0
  282. package/dist/serialization/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.js +61 -0
  283. package/dist/serialization/resources/textToDialogue/types/TextToDialogueStreamWithTimestampsRequestOutputFormat.d.ts +7 -0
  284. package/dist/serialization/resources/textToDialogue/types/TextToDialogueStreamWithTimestampsRequestOutputFormat.js +61 -0
  285. package/dist/serialization/resources/textToDialogue/types/index.d.ts +4 -0
  286. package/dist/serialization/resources/textToDialogue/types/index.js +4 -0
  287. package/dist/serialization/types/AudioWithTimestampsAndVoiceSegmentsResponseModel.d.ts +14 -0
  288. package/dist/serialization/types/AudioWithTimestampsAndVoiceSegmentsResponseModel.js +46 -0
  289. package/dist/serialization/types/ClientToolConfigInput.d.ts +4 -0
  290. package/dist/serialization/types/ClientToolConfigInput.js +4 -0
  291. package/dist/serialization/types/ClientToolConfigOutput.d.ts +4 -0
  292. package/dist/serialization/types/ClientToolConfigOutput.js +4 -0
  293. package/dist/serialization/types/CreateTwilioPhoneNumberRequest.d.ts +2 -0
  294. package/dist/serialization/types/CreateTwilioPhoneNumberRequest.js +2 -0
  295. package/dist/serialization/types/GuardrailsV1Input.d.ts +11 -0
  296. package/dist/serialization/types/GuardrailsV1Input.js +43 -0
  297. package/dist/serialization/types/GuardrailsV1Output.d.ts +11 -0
  298. package/dist/serialization/types/GuardrailsV1Output.js +43 -0
  299. package/dist/serialization/types/Llm.d.ts +1 -1
  300. package/dist/serialization/types/Llm.js +2 -0
  301. package/dist/serialization/types/McpServerConfigInput.d.ts +2 -0
  302. package/dist/serialization/types/McpServerConfigInput.js +2 -0
  303. package/dist/serialization/types/McpServerConfigInputRequestHeadersValue.d.ts +2 -1
  304. package/dist/serialization/types/McpServerConfigInputRequestHeadersValue.js +2 -1
  305. package/dist/serialization/types/McpServerConfigOutput.d.ts +2 -0
  306. package/dist/serialization/types/McpServerConfigOutput.js +2 -0
  307. package/dist/serialization/types/McpServerConfigOutputRequestHeadersValue.d.ts +2 -1
  308. package/dist/serialization/types/McpServerConfigOutputRequestHeadersValue.js +2 -1
  309. package/dist/serialization/types/MetricType.d.ts +1 -1
  310. package/dist/serialization/types/MetricType.js +1 -0
  311. package/dist/serialization/types/ModerationConfig.d.ts +20 -0
  312. package/{serialization/types/SubscriptionUsageResponseModel.js → dist/serialization/types/ModerationConfig.js} +14 -10
  313. package/dist/serialization/types/ModerationGuardrailInput.d.ts +10 -0
  314. package/dist/serialization/types/ModerationGuardrailInput.js +42 -0
  315. package/dist/serialization/types/ModerationGuardrailOutput.d.ts +10 -0
  316. package/dist/serialization/types/ModerationGuardrailOutput.js +42 -0
  317. package/dist/serialization/types/ReferencedToolCommonModel.d.ts +2 -2
  318. package/dist/serialization/types/ReferencedToolCommonModel.js +2 -2
  319. package/dist/serialization/types/ReferencedToolCommonModelType.d.ts +7 -0
  320. package/dist/serialization/types/{ModerationStatusResponseModelWarningStatus.js → ReferencedToolCommonModelType.js} +2 -2
  321. package/dist/serialization/types/RegionConfigRequest.d.ts +13 -0
  322. package/dist/serialization/types/RegionConfigRequest.js +45 -0
  323. package/dist/serialization/types/SingleUseTokenResponseModel.d.ts +9 -0
  324. package/{serialization/types/ModerationStatusResponseModelWarningStatus.js → dist/serialization/types/SingleUseTokenResponseModel.js} +4 -2
  325. package/dist/serialization/types/SingleUseTokenType.d.ts +7 -0
  326. package/dist/serialization/types/{ModerationStatusResponseModelSafetyStatus.js → SingleUseTokenType.js} +2 -2
  327. package/dist/serialization/types/StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel.d.ts +14 -0
  328. package/dist/serialization/types/StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel.js +46 -0
  329. package/dist/serialization/types/SystemToolConfigInput.d.ts +4 -0
  330. package/dist/serialization/types/SystemToolConfigInput.js +4 -0
  331. package/dist/serialization/types/SystemToolConfigOutput.d.ts +4 -0
  332. package/dist/serialization/types/SystemToolConfigOutput.js +4 -0
  333. package/dist/serialization/types/ThresholdGuardrail.d.ts +10 -0
  334. package/dist/serialization/types/ThresholdGuardrail.js +42 -0
  335. package/dist/serialization/types/ToolCallSoundBehavior.d.ts +7 -0
  336. package/{serialization/types/ModerationStatusResponseModelSafetyStatus.js → dist/serialization/types/ToolCallSoundBehavior.js} +2 -2
  337. package/dist/serialization/types/ToolCallSoundType.d.ts +7 -0
  338. package/dist/serialization/types/ToolCallSoundType.js +39 -0
  339. package/dist/serialization/types/ToolRequestModelToolConfig.d.ts +1 -5
  340. package/dist/serialization/types/ToolRequestModelToolConfig.js +0 -3
  341. package/dist/serialization/types/TurnConfig.d.ts +2 -2
  342. package/dist/serialization/types/TurnConfig.js +2 -2
  343. package/dist/serialization/types/TurnConfigWorkflowOverride.d.ts +2 -2
  344. package/dist/serialization/types/TurnConfigWorkflowOverride.js +2 -2
  345. package/dist/serialization/types/TurnEagerness.d.ts +7 -0
  346. package/dist/serialization/types/TurnEagerness.js +39 -0
  347. package/dist/serialization/types/TwilioEdgeLocation.d.ts +7 -0
  348. package/dist/serialization/types/TwilioEdgeLocation.js +49 -0
  349. package/dist/serialization/types/TwilioRegionId.d.ts +7 -0
  350. package/dist/serialization/types/TwilioRegionId.js +39 -0
  351. package/dist/serialization/types/User.d.ts +0 -2
  352. package/dist/serialization/types/User.js +0 -2
  353. package/dist/serialization/types/VadConfig.d.ts +0 -1
  354. package/dist/serialization/types/VadConfig.js +1 -3
  355. package/dist/serialization/types/VadConfigWorkflowOverride.d.ts +0 -1
  356. package/dist/serialization/types/VadConfigWorkflowOverride.js +1 -3
  357. package/dist/serialization/types/VoiceSegment.d.ts +13 -0
  358. package/dist/serialization/types/VoiceSegment.js +45 -0
  359. package/dist/serialization/types/WebhookToolConfigInput.d.ts +4 -0
  360. package/dist/serialization/types/WebhookToolConfigInput.js +4 -0
  361. package/dist/serialization/types/WebhookToolConfigOutput.d.ts +4 -0
  362. package/dist/serialization/types/WebhookToolConfigOutput.js +4 -0
  363. package/dist/serialization/types/WorkspaceResourceType.d.ts +1 -1
  364. package/dist/serialization/types/WorkspaceResourceType.js +2 -0
  365. package/dist/serialization/types/index.d.ts +18 -5
  366. package/dist/serialization/types/index.js +18 -5
  367. package/dist/version.d.ts +1 -1
  368. package/dist/version.js +1 -1
  369. package/dist/wrapper/ElevenLabsClient.js +1 -1
  370. package/dist/wrapper/music.d.ts +74 -3
  371. package/dist/wrapper/music.js +127 -14
  372. package/dist/wrapper/realtime/connection.js +0 -1
  373. package/dist/wrapper/realtime/scribe.d.ts +5 -0
  374. package/dist/wrapper/realtime/scribe.js +3 -0
  375. package/package.json +3 -2
  376. package/reference.md +221 -18
  377. package/serialization/resources/conversationalAi/resources/index.d.ts +2 -1
  378. package/serialization/resources/conversationalAi/resources/index.js +3 -2
  379. package/serialization/resources/conversationalAi/resources/mcpServers/client/requests/McpServerConfigUpdateRequestModel.d.ts +4 -0
  380. package/serialization/resources/conversationalAi/resources/mcpServers/client/requests/McpServerConfigUpdateRequestModel.js +6 -0
  381. package/serialization/resources/conversationalAi/resources/mcpServers/index.d.ts +1 -0
  382. package/serialization/resources/conversationalAi/resources/mcpServers/index.js +1 -0
  383. package/serialization/resources/conversationalAi/resources/mcpServers/types/McpServerConfigUpdateRequestModelRequestHeadersValue.d.ts +9 -0
  384. package/serialization/resources/conversationalAi/resources/mcpServers/types/McpServerConfigUpdateRequestModelRequestHeadersValue.js +41 -0
  385. package/serialization/resources/conversationalAi/resources/mcpServers/types/index.d.ts +1 -0
  386. package/serialization/resources/conversationalAi/resources/mcpServers/types/index.js +17 -0
  387. package/serialization/resources/music/client/requests/BodyComposeMusicV1MusicPost.d.ts +0 -2
  388. package/serialization/resources/music/client/requests/BodyComposeMusicV1MusicPost.js +0 -2
  389. package/serialization/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +0 -2
  390. package/serialization/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +0 -2
  391. package/serialization/resources/music/client/requests/BodyStreamComposedMusicV1MusicStreamPost.d.ts +0 -2
  392. package/serialization/resources/music/client/requests/BodyStreamComposedMusicV1MusicStreamPost.js +0 -2
  393. package/serialization/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.d.ts +19 -0
  394. package/serialization/resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.js +51 -0
  395. package/serialization/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.d.ts +19 -0
  396. package/serialization/resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.js +51 -0
  397. package/serialization/resources/textToDialogue/client/requests/index.d.ts +2 -0
  398. package/serialization/resources/textToDialogue/client/requests/index.js +5 -1
  399. package/serialization/resources/textToDialogue/types/BodyTextToDialogueFullWithTimestampsApplyTextNormalization.d.ts +7 -0
  400. package/serialization/resources/textToDialogue/types/BodyTextToDialogueFullWithTimestampsApplyTextNormalization.js +39 -0
  401. package/serialization/resources/textToDialogue/types/BodyTextToDialogueStreamWithTimestampsApplyTextNormalization.d.ts +7 -0
  402. package/serialization/resources/textToDialogue/types/BodyTextToDialogueStreamWithTimestampsApplyTextNormalization.js +39 -0
  403. package/serialization/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.d.ts +7 -0
  404. package/serialization/resources/textToDialogue/types/TextToDialogueConvertWithTimestampsRequestOutputFormat.js +61 -0
  405. package/serialization/resources/textToDialogue/types/TextToDialogueStreamWithTimestampsRequestOutputFormat.d.ts +7 -0
  406. package/serialization/resources/textToDialogue/types/TextToDialogueStreamWithTimestampsRequestOutputFormat.js +61 -0
  407. package/serialization/resources/textToDialogue/types/index.d.ts +4 -0
  408. package/serialization/resources/textToDialogue/types/index.js +4 -0
  409. package/serialization/types/AudioWithTimestampsAndVoiceSegmentsResponseModel.d.ts +14 -0
  410. package/serialization/types/AudioWithTimestampsAndVoiceSegmentsResponseModel.js +46 -0
  411. package/serialization/types/ClientToolConfigInput.d.ts +4 -0
  412. package/serialization/types/ClientToolConfigInput.js +4 -0
  413. package/serialization/types/ClientToolConfigOutput.d.ts +4 -0
  414. package/serialization/types/ClientToolConfigOutput.js +4 -0
  415. package/serialization/types/CreateTwilioPhoneNumberRequest.d.ts +2 -0
  416. package/serialization/types/CreateTwilioPhoneNumberRequest.js +2 -0
  417. package/serialization/types/GuardrailsV1Input.d.ts +11 -0
  418. package/serialization/types/GuardrailsV1Input.js +43 -0
  419. package/serialization/types/GuardrailsV1Output.d.ts +11 -0
  420. package/serialization/types/GuardrailsV1Output.js +43 -0
  421. package/serialization/types/Llm.d.ts +1 -1
  422. package/serialization/types/Llm.js +2 -0
  423. package/serialization/types/McpServerConfigInput.d.ts +2 -0
  424. package/serialization/types/McpServerConfigInput.js +2 -0
  425. package/serialization/types/McpServerConfigInputRequestHeadersValue.d.ts +2 -1
  426. package/serialization/types/McpServerConfigInputRequestHeadersValue.js +2 -1
  427. package/serialization/types/McpServerConfigOutput.d.ts +2 -0
  428. package/serialization/types/McpServerConfigOutput.js +2 -0
  429. package/serialization/types/McpServerConfigOutputRequestHeadersValue.d.ts +2 -1
  430. package/serialization/types/McpServerConfigOutputRequestHeadersValue.js +2 -1
  431. package/serialization/types/MetricType.d.ts +1 -1
  432. package/serialization/types/MetricType.js +1 -0
  433. package/serialization/types/ModerationConfig.d.ts +20 -0
  434. package/{dist/serialization/types/SubscriptionUsageResponseModel.js → serialization/types/ModerationConfig.js} +14 -10
  435. package/serialization/types/ModerationGuardrailInput.d.ts +10 -0
  436. package/serialization/types/ModerationGuardrailInput.js +42 -0
  437. package/serialization/types/ModerationGuardrailOutput.d.ts +10 -0
  438. package/serialization/types/ModerationGuardrailOutput.js +42 -0
  439. package/serialization/types/ReferencedToolCommonModel.d.ts +2 -2
  440. package/serialization/types/ReferencedToolCommonModel.js +2 -2
  441. package/serialization/types/ReferencedToolCommonModelType.d.ts +7 -0
  442. package/serialization/types/ReferencedToolCommonModelType.js +39 -0
  443. package/serialization/types/RegionConfigRequest.d.ts +13 -0
  444. package/serialization/types/RegionConfigRequest.js +45 -0
  445. package/serialization/types/SingleUseTokenResponseModel.d.ts +9 -0
  446. package/serialization/types/SingleUseTokenResponseModel.js +41 -0
  447. package/serialization/types/SingleUseTokenType.d.ts +7 -0
  448. package/serialization/types/SingleUseTokenType.js +39 -0
  449. package/serialization/types/StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel.d.ts +14 -0
  450. package/serialization/types/StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel.js +46 -0
  451. package/serialization/types/SystemToolConfigInput.d.ts +4 -0
  452. package/serialization/types/SystemToolConfigInput.js +4 -0
  453. package/serialization/types/SystemToolConfigOutput.d.ts +4 -0
  454. package/serialization/types/SystemToolConfigOutput.js +4 -0
  455. package/serialization/types/ThresholdGuardrail.d.ts +10 -0
  456. package/serialization/types/ThresholdGuardrail.js +42 -0
  457. package/serialization/types/ToolCallSoundBehavior.d.ts +7 -0
  458. package/serialization/types/ToolCallSoundBehavior.js +39 -0
  459. package/serialization/types/ToolCallSoundType.d.ts +7 -0
  460. package/serialization/types/ToolCallSoundType.js +39 -0
  461. package/serialization/types/ToolRequestModelToolConfig.d.ts +1 -5
  462. package/serialization/types/ToolRequestModelToolConfig.js +0 -3
  463. package/serialization/types/TurnConfig.d.ts +2 -2
  464. package/serialization/types/TurnConfig.js +2 -2
  465. package/serialization/types/TurnConfigWorkflowOverride.d.ts +2 -2
  466. package/serialization/types/TurnConfigWorkflowOverride.js +2 -2
  467. package/serialization/types/TurnEagerness.d.ts +7 -0
  468. package/serialization/types/TurnEagerness.js +39 -0
  469. package/serialization/types/TwilioEdgeLocation.d.ts +7 -0
  470. package/serialization/types/TwilioEdgeLocation.js +49 -0
  471. package/serialization/types/TwilioRegionId.d.ts +7 -0
  472. package/serialization/types/TwilioRegionId.js +39 -0
  473. package/serialization/types/User.d.ts +0 -2
  474. package/serialization/types/User.js +0 -2
  475. package/serialization/types/VadConfig.d.ts +0 -1
  476. package/serialization/types/VadConfig.js +1 -3
  477. package/serialization/types/VadConfigWorkflowOverride.d.ts +0 -1
  478. package/serialization/types/VadConfigWorkflowOverride.js +1 -3
  479. package/serialization/types/VoiceSegment.d.ts +13 -0
  480. package/serialization/types/VoiceSegment.js +45 -0
  481. package/serialization/types/WebhookToolConfigInput.d.ts +4 -0
  482. package/serialization/types/WebhookToolConfigInput.js +4 -0
  483. package/serialization/types/WebhookToolConfigOutput.d.ts +4 -0
  484. package/serialization/types/WebhookToolConfigOutput.js +4 -0
  485. package/serialization/types/WorkspaceResourceType.d.ts +1 -1
  486. package/serialization/types/WorkspaceResourceType.js +2 -0
  487. package/serialization/types/index.d.ts +18 -5
  488. package/serialization/types/index.js +18 -5
  489. package/version.d.ts +1 -1
  490. package/version.js +1 -1
  491. package/wrapper/ElevenLabsClient.js +1 -1
  492. package/wrapper/music.d.ts +74 -3
  493. package/wrapper/music.js +127 -14
  494. package/wrapper/realtime/connection.js +0 -1
  495. package/wrapper/realtime/scribe.d.ts +5 -0
  496. package/wrapper/realtime/scribe.js +3 -0
  497. package/api/types/ModerationStatusResponseModel.d.ts +0 -21
  498. package/api/types/ModerationStatusResponseModelSafetyStatus.d.ts +0 -6
  499. package/api/types/ModerationStatusResponseModelSafetyStatus.js +0 -9
  500. package/api/types/ModerationStatusResponseModelWarningStatus.d.ts +0 -5
  501. package/api/types/ModerationStatusResponseModelWarningStatus.js +0 -8
  502. package/api/types/SubscriptionExtrasResponseModel.d.ts +0 -27
  503. package/api/types/SubscriptionUsageResponseModel.d.ts +0 -18
  504. package/dist/api/types/ModerationStatusResponseModel.d.ts +0 -21
  505. package/dist/api/types/ModerationStatusResponseModelSafetyStatus.d.ts +0 -6
  506. package/dist/api/types/ModerationStatusResponseModelSafetyStatus.js +0 -9
  507. package/dist/api/types/ModerationStatusResponseModelWarningStatus.d.ts +0 -5
  508. package/dist/api/types/ModerationStatusResponseModelWarningStatus.js +0 -8
  509. package/dist/api/types/SubscriptionExtrasResponseModel.d.ts +0 -27
  510. package/dist/api/types/SubscriptionUsageResponseModel.d.ts +0 -18
  511. package/dist/serialization/types/ModerationStatusResponseModel.d.ts +0 -19
  512. package/dist/serialization/types/ModerationStatusResponseModel.js +0 -51
  513. package/dist/serialization/types/ModerationStatusResponseModelSafetyStatus.d.ts +0 -7
  514. package/dist/serialization/types/ModerationStatusResponseModelWarningStatus.d.ts +0 -7
  515. package/dist/serialization/types/SubscriptionExtrasResponseModel.d.ts +0 -22
  516. package/dist/serialization/types/SubscriptionExtrasResponseModel.js +0 -54
  517. package/dist/serialization/types/SubscriptionUsageResponseModel.d.ts +0 -16
  518. package/serialization/types/ModerationStatusResponseModel.d.ts +0 -19
  519. package/serialization/types/ModerationStatusResponseModel.js +0 -51
  520. package/serialization/types/ModerationStatusResponseModelSafetyStatus.d.ts +0 -7
  521. package/serialization/types/ModerationStatusResponseModelWarningStatus.d.ts +0 -7
  522. package/serialization/types/SubscriptionExtrasResponseModel.d.ts +0 -22
  523. package/serialization/types/SubscriptionExtrasResponseModel.js +0 -54
  524. package/serialization/types/SubscriptionUsageResponseModel.d.ts +0 -16
  525. /package/api/{types/ModerationStatusResponseModel.js → resources/conversationalAi/resources/mcpServers/types/McpServerConfigUpdateRequestModelRequestHeadersValue.js} +0 -0
  526. /package/api/{types/SubscriptionExtrasResponseModel.js → resources/textToDialogue/client/requests/BodyTextToDialogueFullWithTimestamps.js} +0 -0
  527. /package/api/{types/SubscriptionUsageResponseModel.js → resources/textToDialogue/client/requests/BodyTextToDialogueStreamWithTimestamps.js} +0 -0
  528. /package/{dist/api/types/ModerationStatusResponseModel.js → api/types/AudioWithTimestampsAndVoiceSegmentsResponseModel.js} +0 -0
  529. /package/{dist/api/types/SubscriptionExtrasResponseModel.js → api/types/GuardrailsV1Input.js} +0 -0
  530. /package/{dist/api/types/SubscriptionUsageResponseModel.js → api/types/GuardrailsV1Output.js} +0 -0
@@ -182,12 +182,7 @@ class Dubbing {
182
182
  *
183
183
  * @example
184
184
  * import { createReadStream } from "fs";
185
- * await client.dubbing.create({
186
- * file: fs.createReadStream("/path/to/your/file"),
187
- * csvFile: fs.createReadStream("/path/to/your/file"),
188
- * foregroundAudioFile: fs.createReadStream("/path/to/your/file"),
189
- * backgroundAudioFile: fs.createReadStream("/path/to/your/file")
190
- * })
185
+ * await client.dubbing.create({})
191
186
  */
192
187
  create(request, requestOptions) {
193
188
  return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
@@ -196,10 +191,18 @@ class Dubbing {
196
191
  return __awaiter(this, void 0, void 0, function* () {
197
192
  var _a, _b, _c, _d, _e;
198
193
  const _request = yield core.newFormData();
199
- yield _request.appendFile("file", request.file);
200
- yield _request.appendFile("csv_file", request.csvFile);
201
- yield _request.appendFile("foreground_audio_file", request.foregroundAudioFile);
202
- yield _request.appendFile("background_audio_file", request.backgroundAudioFile);
194
+ if (request.file != null) {
195
+ yield _request.appendFile("file", request.file);
196
+ }
197
+ if (request.csvFile != null) {
198
+ yield _request.appendFile("csv_file", request.csvFile);
199
+ }
200
+ if (request.foregroundAudioFile != null) {
201
+ yield _request.appendFile("foreground_audio_file", request.foregroundAudioFile);
202
+ }
203
+ if (request.backgroundAudioFile != null) {
204
+ yield _request.appendFile("background_audio_file", request.backgroundAudioFile);
205
+ }
203
206
  if (request.name != null) {
204
207
  _request.append("name", request.name);
205
208
  }
@@ -2,22 +2,17 @@ import * as core from "../../../../../core";
2
2
  import * as ElevenLabs from "../../../../index";
3
3
  /**
4
4
  * @example
5
- * {
6
- * file: fs.createReadStream("/path/to/your/file"),
7
- * csvFile: fs.createReadStream("/path/to/your/file"),
8
- * foregroundAudioFile: fs.createReadStream("/path/to/your/file"),
9
- * backgroundAudioFile: fs.createReadStream("/path/to/your/file")
10
- * }
5
+ * {}
11
6
  */
12
7
  export interface BodyDubAVideoOrAnAudioFileV1DubbingPost {
13
8
  /** A list of file paths to audio recordings intended for voice cloning */
14
- file: core.file.Uploadable.FileLike;
9
+ file?: core.file.Uploadable.FileLike | undefined;
15
10
  /** CSV file containing transcription/translation metadata */
16
- csvFile: core.file.Uploadable.FileLike;
11
+ csvFile?: core.file.Uploadable.FileLike | undefined;
17
12
  /** For use only with csv input */
18
- foregroundAudioFile: core.file.Uploadable.FileLike;
13
+ foregroundAudioFile?: core.file.Uploadable.FileLike | undefined;
19
14
  /** For use only with csv input */
20
- backgroundAudioFile: core.file.Uploadable.FileLike;
15
+ backgroundAudioFile?: core.file.Uploadable.FileLike | undefined;
21
16
  /** Name of the dubbing project. */
22
17
  name?: string;
23
18
  /** URL of the source video/audio file. */
@@ -39,6 +39,7 @@ export * as models from "./models";
39
39
  export * as usage from "./usage";
40
40
  export * as webhooks from "./webhooks";
41
41
  export * as forcedAlignment from "./forcedAlignment";
42
+ export * as tokens from "./tokens";
42
43
  export * from "./history/client/requests";
43
44
  export * from "./textToSoundEffects/client/requests";
44
45
  export * from "./audioIsolation/client/requests";
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.forcedAlignment = exports.webhooks = exports.usage = exports.models = exports.user = exports.samples = exports.workspace = exports.serviceAccounts = exports.conversationalAi = exports.v1TextToSpeechVoiceIdMultiStreamInput = exports.v1TextToSpeechVoiceIdStreamInput = exports.music = exports.speechToText = exports.pronunciationDictionaries = exports.audioNative = exports.dubbing = exports.studio = exports.voices = exports.textToVoice = exports.speechToSpeech = exports.textToDialogue = exports.textToSpeech = exports.audioIsolation = exports.textToSoundEffects = exports.history = void 0;
39
+ exports.tokens = exports.forcedAlignment = exports.webhooks = exports.usage = exports.models = exports.user = exports.samples = exports.workspace = exports.serviceAccounts = exports.conversationalAi = exports.v1TextToSpeechVoiceIdMultiStreamInput = exports.v1TextToSpeechVoiceIdStreamInput = exports.music = exports.speechToText = exports.pronunciationDictionaries = exports.audioNative = exports.dubbing = exports.studio = exports.voices = exports.textToVoice = exports.speechToSpeech = exports.textToDialogue = exports.textToSpeech = exports.audioIsolation = exports.textToSoundEffects = exports.history = void 0;
40
40
  exports.history = __importStar(require("./history"));
41
41
  __exportStar(require("./history/types"), exports);
42
42
  exports.textToSoundEffects = __importStar(require("./textToSoundEffects"));
@@ -78,6 +78,7 @@ exports.models = __importStar(require("./models"));
78
78
  exports.usage = __importStar(require("./usage"));
79
79
  exports.webhooks = __importStar(require("./webhooks"));
80
80
  exports.forcedAlignment = __importStar(require("./forcedAlignment"));
81
+ exports.tokens = __importStar(require("./tokens"));
81
82
  __exportStar(require("./history/client/requests"), exports);
82
83
  __exportStar(require("./textToSoundEffects/client/requests"), exports);
83
84
  __exportStar(require("./audioIsolation/client/requests"), exports);
@@ -3,11 +3,9 @@ import * as ElevenLabs from "../../../../index";
3
3
  * @example
4
4
  * {
5
5
  * prompt: undefined,
6
- * musicPrompt: undefined,
7
6
  * compositionPlan: undefined,
8
7
  * musicLengthMs: undefined,
9
8
  * modelId: undefined,
10
- * seed: undefined,
11
9
  * forceInstrumental: undefined,
12
10
  * respectSectionsDurations: undefined,
13
11
  * storeForInpainting: undefined
@@ -18,16 +16,12 @@ export interface BodyComposeMusicV1MusicPost {
18
16
  outputFormat?: ElevenLabs.MusicComposeRequestOutputFormat;
19
17
  /** A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. */
20
18
  prompt?: string;
21
- /** A music prompt. Deprecated. Use `composition_plan` instead. */
22
- musicPrompt?: ElevenLabs.MusicPrompt;
23
19
  /** A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. */
24
20
  compositionPlan?: ElevenLabs.MusicPrompt;
25
21
  /** The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 300000ms. Optional - if not provided, the model will choose a length based on the prompt. */
26
22
  musicLengthMs?: number;
27
23
  /** The model to use for the generation. */
28
24
  modelId?: "music_v1";
29
- /** The seed to use for the generation. */
30
- seed?: number;
31
25
  /** If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. */
32
26
  forceInstrumental?: boolean;
33
27
  /** Controls how strictly section durations in the `composition_plan` are enforced. Only used with `composition_plan`. When set to true, the model will precisely respect each section's `duration_ms` from the plan. When set to false, the model may adjust individual section durations which will generally lead to better generation quality and improved latency, while always preserving the total song duration from the plan. */
@@ -3,11 +3,9 @@ import * as ElevenLabs from "../../../../index";
3
3
  * @example
4
4
  * {
5
5
  * prompt: undefined,
6
- * musicPrompt: undefined,
7
6
  * compositionPlan: undefined,
8
7
  * musicLengthMs: undefined,
9
8
  * modelId: undefined,
10
- * seed: undefined,
11
9
  * forceInstrumental: undefined,
12
10
  * storeForInpainting: undefined
13
11
  * }
@@ -17,16 +15,12 @@ export interface BodyComposeMusicWithADetailedResponseV1MusicDetailedPost {
17
15
  outputFormat?: ElevenLabs.MusicComposeDetailedRequestOutputFormat;
18
16
  /** A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. */
19
17
  prompt?: string;
20
- /** A music prompt. Deprecated. Use `composition_plan` instead. */
21
- musicPrompt?: ElevenLabs.MusicPrompt;
22
18
  /** A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. */
23
19
  compositionPlan?: ElevenLabs.MusicPrompt;
24
20
  /** The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 300000ms. Optional - if not provided, the model will choose a length based on the prompt. */
25
21
  musicLengthMs?: number;
26
22
  /** The model to use for the generation. */
27
23
  modelId?: "music_v1";
28
- /** The seed to use for the generation. */
29
- seed?: number;
30
24
  /** If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. */
31
25
  forceInstrumental?: boolean;
32
26
  /** Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. */
@@ -3,11 +3,9 @@ import * as ElevenLabs from "../../../../index";
3
3
  * @example
4
4
  * {
5
5
  * prompt: undefined,
6
- * musicPrompt: undefined,
7
6
  * compositionPlan: undefined,
8
7
  * musicLengthMs: undefined,
9
8
  * modelId: undefined,
10
- * seed: undefined,
11
9
  * forceInstrumental: undefined,
12
10
  * storeForInpainting: undefined
13
11
  * }
@@ -17,16 +15,12 @@ export interface BodyStreamComposedMusicV1MusicStreamPost {
17
15
  outputFormat?: ElevenLabs.MusicStreamRequestOutputFormat;
18
16
  /** A simple text prompt to generate a song from. Cannot be used in conjunction with `composition_plan`. */
19
17
  prompt?: string;
20
- /** A music prompt. Deprecated. Use `composition_plan` instead. */
21
- musicPrompt?: ElevenLabs.MusicPrompt;
22
18
  /** A detailed composition plan to guide music generation. Cannot be used in conjunction with `prompt`. */
23
19
  compositionPlan?: ElevenLabs.MusicPrompt;
24
20
  /** The length of the song to generate in milliseconds. Used only in conjunction with `prompt`. Must be between 3000ms and 300000ms. Optional - if not provided, the model will choose a length based on the prompt. */
25
21
  musicLengthMs?: number;
26
22
  /** The model to use for the generation. */
27
23
  modelId?: "music_v1";
28
- /** The seed to use for the generation. */
29
- seed?: number;
30
24
  /** If true, guarantees that the generated song will be instrumental. If false, the song may or may not be instrumental depending on the `prompt`. Can only be used with `prompt`. */
31
25
  forceInstrumental?: boolean;
32
26
  /** Whether to store the generated song for inpainting. Only available to enterprise clients with access to the inpainting API. */
@@ -43,7 +43,6 @@ export declare class PronunciationDictionaries {
43
43
  * @example
44
44
  * import { createReadStream } from "fs";
45
45
  * await client.pronunciationDictionaries.createFromFile({
46
- * file: fs.createReadStream("/path/to/your/file"),
47
46
  * name: "name"
48
47
  * })
49
48
  */
@@ -70,7 +70,6 @@ class PronunciationDictionaries {
70
70
  * @example
71
71
  * import { createReadStream } from "fs";
72
72
  * await client.pronunciationDictionaries.createFromFile({
73
- * file: fs.createReadStream("/path/to/your/file"),
74
73
  * name: "name"
75
74
  * })
76
75
  */
@@ -82,7 +81,9 @@ class PronunciationDictionaries {
82
81
  var _a, _b, _c, _d, _e;
83
82
  const _request = yield core.newFormData();
84
83
  _request.append("name", request.name);
85
- yield _request.appendFile("file", request.file);
84
+ if (request.file != null) {
85
+ yield _request.appendFile("file", request.file);
86
+ }
86
87
  if (request.description != null) {
87
88
  _request.append("description", request.description);
88
89
  }
@@ -3,7 +3,6 @@ import * as ElevenLabs from "../../../../index";
3
3
  /**
4
4
  * @example
5
5
  * {
6
- * file: fs.createReadStream("/path/to/your/file"),
7
6
  * name: "name"
8
7
  * }
9
8
  */
@@ -11,7 +10,7 @@ export interface BodyAddAPronunciationDictionaryV1PronunciationDictionariesAddFr
11
10
  /** The name of the pronunciation dictionary, used for identification only. */
12
11
  name: string;
13
12
  /** A lexicon .pls file which we will use to initialize the project with. */
14
- file: core.file.Uploadable.FileLike;
13
+ file?: core.file.Uploadable.FileLike | undefined;
15
14
  /** A description of the pronunciation dictionary, used for identification only. */
16
15
  description?: string;
17
16
  /** Should be one of 'admin', 'editor' or 'viewer'. If not provided, defaults to no access. */
@@ -43,7 +43,6 @@ export declare class SpeechToText {
43
43
  * @example
44
44
  * import { createReadStream } from "fs";
45
45
  * await client.speechToText.convert({
46
- * file: fs.createReadStream("/path/to/your/file"),
47
46
  * enableLogging: true,
48
47
  * modelId: "model_id"
49
48
  * })
@@ -71,7 +71,6 @@ class SpeechToText {
71
71
  * @example
72
72
  * import { createReadStream } from "fs";
73
73
  * await client.speechToText.convert({
74
- * file: fs.createReadStream("/path/to/your/file"),
75
74
  * enableLogging: true,
76
75
  * modelId: "model_id"
77
76
  * })
@@ -88,7 +87,9 @@ class SpeechToText {
88
87
  }
89
88
  const _request = yield core.newFormData();
90
89
  _request.append("model_id", request.modelId);
91
- yield _request.appendFile("file", request.file);
90
+ if (request.file != null) {
91
+ yield _request.appendFile("file", request.file);
92
+ }
92
93
  if (request.languageCode != null) {
93
94
  _request.append("language_code", request.languageCode);
94
95
  }
@@ -3,14 +3,12 @@ import * as ElevenLabs from "../../../../index";
3
3
  /**
4
4
  * @example
5
5
  * {
6
- * file: fs.createReadStream("/path/to/your/file"),
7
6
  * enableLogging: true,
8
7
  * modelId: "model_id"
9
8
  * }
10
9
  *
11
10
  * @example
12
11
  * {
13
- * file: fs.createReadStream("/path/to/your/file"),
14
12
  * enableLogging: true,
15
13
  * modelId: "model_id"
16
14
  * }
@@ -21,7 +19,7 @@ export interface BodySpeechToTextV1SpeechToTextPost {
21
19
  /** The ID of the model to use for transcription, currently only 'scribe_v1' and 'scribe_v1_experimental' are available. */
22
20
  modelId: string;
23
21
  /** The file to transcribe. All major audio and video formats are supported. Exactly one of the file or cloud_storage_url parameters must be provided. The file size must be less than 3.0GB. */
24
- file: core.file.Uploadable.FileLike;
22
+ file?: core.file.Uploadable.FileLike | undefined;
25
23
  /** An ISO-639-1 or ISO-639-3 language_code corresponding to the language of the audio file. Can sometimes improve transcription performance if known beforehand. Defaults to null, in this case the language is predicted automatically. */
26
24
  languageCode?: string;
27
25
  /** Whether to tag audio events like (laughter), (footsteps), etc. in the transcription. */
@@ -64,7 +64,6 @@ export declare class Projects {
64
64
  * @example
65
65
  * import { createReadStream } from "fs";
66
66
  * await client.studio.projects.create({
67
- * fromDocument: fs.createReadStream("/path/to/your/file"),
68
67
  * name: "name"
69
68
  * })
70
69
  */
@@ -156,7 +156,6 @@ class Projects {
156
156
  * @example
157
157
  * import { createReadStream } from "fs";
158
158
  * await client.studio.projects.create({
159
- * fromDocument: fs.createReadStream("/path/to/your/file"),
160
159
  * name: "name"
161
160
  * })
162
161
  */
@@ -180,7 +179,9 @@ class Projects {
180
179
  if (request.fromUrl != null) {
181
180
  _request.append("from_url", request.fromUrl);
182
181
  }
183
- yield _request.appendFile("from_document", request.fromDocument);
182
+ if (request.fromDocument != null) {
183
+ yield _request.appendFile("from_document", request.fromDocument);
184
+ }
184
185
  if (request.fromContentJson != null) {
185
186
  _request.append("from_content_json", request.fromContentJson);
186
187
  }
@@ -3,7 +3,6 @@ import * as ElevenLabs from "../../../../../../index";
3
3
  /**
4
4
  * @example
5
5
  * {
6
- * fromDocument: fs.createReadStream("/path/to/your/file"),
7
6
  * name: "name"
8
7
  * }
9
8
  */
@@ -19,7 +18,7 @@ export interface BodyCreateStudioProjectV1StudioProjectsPost {
19
18
  /** An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. */
20
19
  fromUrl?: string;
21
20
  /** An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. */
22
- fromDocument: core.file.Uploadable.FileLike;
21
+ fromDocument?: core.file.Uploadable.FileLike | undefined;
23
22
  /**
24
23
  * An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank.
25
24
  *
@@ -40,9 +40,7 @@ export declare class Content {
40
40
  *
41
41
  * @example
42
42
  * import { createReadStream } from "fs";
43
- * await client.studio.projects.content.update("21m00Tcm4TlvDq8ikWAM", {
44
- * fromDocument: fs.createReadStream("/path/to/your/file")
45
- * })
43
+ * await client.studio.projects.content.update("21m00Tcm4TlvDq8ikWAM", {})
46
44
  */
47
45
  update(projectId: string, request: ElevenLabs.studio.projects.BodyUpdateStudioProjectContentV1StudioProjectsProjectIdContentPost, requestOptions?: Content.RequestOptions): core.HttpResponsePromise<ElevenLabs.EditProjectResponseModel>;
48
46
  private __update;
@@ -65,9 +65,7 @@ class Content {
65
65
  *
66
66
  * @example
67
67
  * import { createReadStream } from "fs";
68
- * await client.studio.projects.content.update("21m00Tcm4TlvDq8ikWAM", {
69
- * fromDocument: fs.createReadStream("/path/to/your/file")
70
- * })
68
+ * await client.studio.projects.content.update("21m00Tcm4TlvDq8ikWAM", {})
71
69
  */
72
70
  update(projectId, request, requestOptions) {
73
71
  return core.HttpResponsePromise.fromPromise(this.__update(projectId, request, requestOptions));
@@ -79,7 +77,9 @@ class Content {
79
77
  if (request.fromUrl != null) {
80
78
  _request.append("from_url", request.fromUrl);
81
79
  }
82
- yield _request.appendFile("from_document", request.fromDocument);
80
+ if (request.fromDocument != null) {
81
+ yield _request.appendFile("from_document", request.fromDocument);
82
+ }
83
83
  if (request.fromContentJson != null) {
84
84
  _request.append("from_content_json", request.fromContentJson);
85
85
  }
@@ -1,15 +1,13 @@
1
1
  import * as core from "../../../../../../../../../core";
2
2
  /**
3
3
  * @example
4
- * {
5
- * fromDocument: fs.createReadStream("/path/to/your/file")
6
- * }
4
+ * {}
7
5
  */
8
6
  export interface BodyUpdateStudioProjectContentV1StudioProjectsProjectIdContentPost {
9
7
  /** An optional URL from which we will extract content to initialize the Studio project. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. */
10
8
  fromUrl?: string;
11
9
  /** An optional .epub, .pdf, .txt or similar file can be provided. If provided, we will initialize the Studio project with its content. If this is set, 'from_url' and 'from_content' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank. */
12
- fromDocument: core.file.Uploadable.FileLike;
10
+ fromDocument?: core.file.Uploadable.FileLike | undefined;
13
11
  /**
14
12
  * An optional content to initialize the Studio project with. If this is set, 'from_url' and 'from_document' must be null. If neither 'from_url', 'from_document', 'from_content' are provided we will initialize the Studio project as blank.
15
13
  *
@@ -41,4 +41,31 @@ export declare class TextToDialogue {
41
41
  */
42
42
  stream(request: ElevenLabs.BodyTextToDialogueMultiVoiceStreamingV1TextToDialogueStreamPost, requestOptions?: TextToDialogue.RequestOptions): core.HttpResponsePromise<ReadableStream<Uint8Array>>;
43
43
  private __stream;
44
+ /**
45
+ * Converts a list of text and voice ID pairs into speech (dialogue) and returns a stream of JSON blobs containing audio as a base64 encoded string and timestamps
46
+ */
47
+ streamWithTimestamps(request: ElevenLabs.BodyTextToDialogueStreamWithTimestamps, requestOptions?: TextToDialogue.RequestOptions): core.HttpResponsePromise<core.Stream<ElevenLabs.StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel>>;
48
+ private __streamWithTimestamps;
49
+ /**
50
+ * Generate dialogue from text with precise character-level timing information for audio-text synchronization.
51
+ *
52
+ * @param {ElevenLabs.BodyTextToDialogueFullWithTimestamps} request
53
+ * @param {TextToDialogue.RequestOptions} requestOptions - Request-specific configuration.
54
+ *
55
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
56
+ *
57
+ * @example
58
+ * await client.textToDialogue.convertWithTimestamps({
59
+ * outputFormat: "mp3_22050_32",
60
+ * inputs: [{
61
+ * text: "Hello, how are you?",
62
+ * voiceId: "bYTqZQo3Jz7LQtmGTgwi"
63
+ * }, {
64
+ * text: "I'm doing well, thank you!",
65
+ * voiceId: "6lCwbsX1yVjD49QmpkTR"
66
+ * }]
67
+ * })
68
+ */
69
+ convertWithTimestamps(request: ElevenLabs.BodyTextToDialogueFullWithTimestamps, requestOptions?: TextToDialogue.RequestOptions): core.HttpResponsePromise<ElevenLabs.AudioWithTimestampsAndVoiceSegmentsResponseModel>;
70
+ private __convertWithTimestamps;
44
71
  }
@@ -201,5 +201,187 @@ class TextToDialogue {
201
201
  }
202
202
  });
203
203
  }
204
+ /**
205
+ * Converts a list of text and voice ID pairs into speech (dialogue) and returns a stream of JSON blobs containing audio as a base64 encoded string and timestamps
206
+ */
207
+ streamWithTimestamps(request, requestOptions) {
208
+ return core.HttpResponsePromise.fromPromise(this.__streamWithTimestamps(request, requestOptions));
209
+ }
210
+ __streamWithTimestamps(request, requestOptions) {
211
+ return __awaiter(this, void 0, void 0, function* () {
212
+ var _a, _b, _c, _d, _e;
213
+ const { outputFormat } = request, _body = __rest(request, ["outputFormat"]);
214
+ const _queryParams = {};
215
+ if (outputFormat != null) {
216
+ _queryParams["output_format"] =
217
+ serializers.TextToDialogueStreamWithTimestampsRequestOutputFormat.jsonOrThrow(outputFormat, {
218
+ unrecognizedObjectKeys: "strip",
219
+ });
220
+ }
221
+ let _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
222
+ const _response = yield core.fetcher({
223
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ElevenLabsEnvironment.Production, "v1/text-to-dialogue/stream/with-timestamps"),
224
+ method: "POST",
225
+ headers: _headers,
226
+ contentType: "application/json",
227
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
228
+ requestType: "json",
229
+ body: serializers.BodyTextToDialogueStreamWithTimestamps.jsonOrThrow(_body, {
230
+ unrecognizedObjectKeys: "strip",
231
+ }),
232
+ responseType: "sse",
233
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
234
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
235
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
236
+ });
237
+ if (_response.ok) {
238
+ return {
239
+ data: new core.Stream({
240
+ stream: _response.body,
241
+ parse: (data) => __awaiter(this, void 0, void 0, function* () {
242
+ return serializers.StreamingAudioChunkWithTimestampsAndVoiceSegmentsResponseModel.parseOrThrow(data, {
243
+ unrecognizedObjectKeys: "passthrough",
244
+ allowUnrecognizedUnionMembers: true,
245
+ allowUnrecognizedEnumValues: true,
246
+ breadcrumbsPrefix: ["response"],
247
+ });
248
+ }),
249
+ signal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
250
+ eventShape: {
251
+ type: "json",
252
+ messageTerminator: "\n",
253
+ },
254
+ }),
255
+ rawResponse: _response.rawResponse,
256
+ };
257
+ }
258
+ if (_response.error.reason === "status-code") {
259
+ switch (_response.error.statusCode) {
260
+ case 422:
261
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
262
+ unrecognizedObjectKeys: "passthrough",
263
+ allowUnrecognizedUnionMembers: true,
264
+ allowUnrecognizedEnumValues: true,
265
+ breadcrumbsPrefix: ["response"],
266
+ }), _response.rawResponse);
267
+ default:
268
+ throw new errors.ElevenLabsError({
269
+ statusCode: _response.error.statusCode,
270
+ body: _response.error.body,
271
+ rawResponse: _response.rawResponse,
272
+ });
273
+ }
274
+ }
275
+ switch (_response.error.reason) {
276
+ case "non-json":
277
+ throw new errors.ElevenLabsError({
278
+ statusCode: _response.error.statusCode,
279
+ body: _response.error.rawBody,
280
+ rawResponse: _response.rawResponse,
281
+ });
282
+ case "timeout":
283
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/text-to-dialogue/stream/with-timestamps.");
284
+ case "unknown":
285
+ throw new errors.ElevenLabsError({
286
+ message: _response.error.errorMessage,
287
+ rawResponse: _response.rawResponse,
288
+ });
289
+ }
290
+ });
291
+ }
292
+ /**
293
+ * Generate dialogue from text with precise character-level timing information for audio-text synchronization.
294
+ *
295
+ * @param {ElevenLabs.BodyTextToDialogueFullWithTimestamps} request
296
+ * @param {TextToDialogue.RequestOptions} requestOptions - Request-specific configuration.
297
+ *
298
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
299
+ *
300
+ * @example
301
+ * await client.textToDialogue.convertWithTimestamps({
302
+ * outputFormat: "mp3_22050_32",
303
+ * inputs: [{
304
+ * text: "Hello, how are you?",
305
+ * voiceId: "bYTqZQo3Jz7LQtmGTgwi"
306
+ * }, {
307
+ * text: "I'm doing well, thank you!",
308
+ * voiceId: "6lCwbsX1yVjD49QmpkTR"
309
+ * }]
310
+ * })
311
+ */
312
+ convertWithTimestamps(request, requestOptions) {
313
+ return core.HttpResponsePromise.fromPromise(this.__convertWithTimestamps(request, requestOptions));
314
+ }
315
+ __convertWithTimestamps(request, requestOptions) {
316
+ return __awaiter(this, void 0, void 0, function* () {
317
+ var _a, _b, _c, _d, _e;
318
+ const { outputFormat } = request, _body = __rest(request, ["outputFormat"]);
319
+ const _queryParams = {};
320
+ if (outputFormat != null) {
321
+ _queryParams["output_format"] =
322
+ serializers.TextToDialogueConvertWithTimestampsRequestOutputFormat.jsonOrThrow(outputFormat, {
323
+ unrecognizedObjectKeys: "strip",
324
+ });
325
+ }
326
+ let _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
327
+ const _response = yield core.fetcher({
328
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ElevenLabsEnvironment.Production, "v1/text-to-dialogue/with-timestamps"),
329
+ method: "POST",
330
+ headers: _headers,
331
+ contentType: "application/json",
332
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
333
+ requestType: "json",
334
+ body: serializers.BodyTextToDialogueFullWithTimestamps.jsonOrThrow(_body, {
335
+ unrecognizedObjectKeys: "strip",
336
+ }),
337
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
338
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
339
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
340
+ });
341
+ if (_response.ok) {
342
+ return {
343
+ data: serializers.AudioWithTimestampsAndVoiceSegmentsResponseModel.parseOrThrow(_response.body, {
344
+ unrecognizedObjectKeys: "passthrough",
345
+ allowUnrecognizedUnionMembers: true,
346
+ allowUnrecognizedEnumValues: true,
347
+ breadcrumbsPrefix: ["response"],
348
+ }),
349
+ rawResponse: _response.rawResponse,
350
+ };
351
+ }
352
+ if (_response.error.reason === "status-code") {
353
+ switch (_response.error.statusCode) {
354
+ case 422:
355
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
356
+ unrecognizedObjectKeys: "passthrough",
357
+ allowUnrecognizedUnionMembers: true,
358
+ allowUnrecognizedEnumValues: true,
359
+ breadcrumbsPrefix: ["response"],
360
+ }), _response.rawResponse);
361
+ default:
362
+ throw new errors.ElevenLabsError({
363
+ statusCode: _response.error.statusCode,
364
+ body: _response.error.body,
365
+ rawResponse: _response.rawResponse,
366
+ });
367
+ }
368
+ }
369
+ switch (_response.error.reason) {
370
+ case "non-json":
371
+ throw new errors.ElevenLabsError({
372
+ statusCode: _response.error.statusCode,
373
+ body: _response.error.rawBody,
374
+ rawResponse: _response.rawResponse,
375
+ });
376
+ case "timeout":
377
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/text-to-dialogue/with-timestamps.");
378
+ case "unknown":
379
+ throw new errors.ElevenLabsError({
380
+ message: _response.error.errorMessage,
381
+ rawResponse: _response.rawResponse,
382
+ });
383
+ }
384
+ });
385
+ }
204
386
  }
205
387
  exports.TextToDialogue = TextToDialogue;