@elevenlabs/elevenlabs-js 2.10.0 → 2.12.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 (520) hide show
  1. package/Client.d.ts +160 -0
  2. package/Client.js +687 -2
  3. package/api/client/index.d.ts +1 -0
  4. package/api/client/index.js +17 -0
  5. package/api/client/requests/CreateUnitTestRequest.d.ts +37 -0
  6. package/api/client/requests/ListChatResponseTestsRouteRequest.d.ts +21 -0
  7. package/api/client/requests/ListTestsByIdsRequestModel.d.ts +13 -0
  8. package/api/client/requests/ListTestsByIdsRequestModel.js +5 -0
  9. package/api/client/requests/ResubmitTestsRequestModel.d.ts +19 -0
  10. package/api/client/requests/ResubmitTestsRequestModel.js +5 -0
  11. package/api/client/requests/RunAgentTestsRequestModel.d.ts +18 -0
  12. package/api/client/requests/RunAgentTestsRequestModel.js +5 -0
  13. package/api/client/requests/UpdateUnitTestRequest.d.ts +37 -0
  14. package/api/client/requests/UpdateUnitTestRequest.js +5 -0
  15. package/api/client/requests/index.d.ts +6 -0
  16. package/api/client/requests/index.js +2 -0
  17. package/api/index.d.ts +1 -0
  18. package/api/index.js +1 -0
  19. package/api/resources/conversationalAi/resources/tools/client/Client.d.ts +1 -1
  20. package/api/resources/conversationalAi/resources/tools/client/Client.js +1 -1
  21. package/api/resources/music/client/Client.d.ts +6 -0
  22. package/api/resources/music/client/Client.js +67 -0
  23. package/api/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +5 -1
  24. package/api/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +5 -0
  25. package/api/resources/music/client/requests/index.d.ts +1 -0
  26. package/api/resources/music/types/MusicComposeDetailedRequestOutputFormat.d.ts +28 -0
  27. package/api/resources/music/types/MusicComposeDetailedRequestOutputFormat.js +27 -0
  28. package/api/resources/music/types/index.d.ts +1 -0
  29. package/api/resources/music/types/index.js +1 -0
  30. package/api/resources/pronunciationDictionaries/client/Client.d.ts +20 -6
  31. package/api/resources/pronunciationDictionaries/client/Client.js +90 -16
  32. package/api/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.d.ts +13 -0
  33. package/api/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.js +5 -0
  34. package/api/resources/pronunciationDictionaries/client/requests/index.d.ts +1 -0
  35. package/api/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.d.ts +4 -1
  36. package/api/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.js +3 -0
  37. package/api/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.d.ts +4 -1
  38. package/api/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.js +3 -0
  39. package/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +1 -1
  40. package/api/resources/textToDialogue/client/Client.d.ts +2 -2
  41. package/api/resources/textToDialogue/client/Client.js +2 -2
  42. package/api/resources/textToSoundEffects/client/requests/CreateSoundEffectRequest.d.ts +1 -1
  43. package/api/types/AdhocAgentConfigOverrideForTestRequestModel.d.ts +8 -0
  44. package/api/types/AdhocAgentConfigOverrideForTestRequestModel.js +5 -0
  45. package/api/types/AgentFailureResponseExample.d.ts +7 -0
  46. package/api/types/AgentFailureResponseExample.js +5 -0
  47. package/api/types/AgentSuccessfulResponseExample.d.ts +7 -0
  48. package/api/types/AgentSuccessfulResponseExample.js +5 -0
  49. package/api/types/AgentTestingSettings.d.ts +2 -1
  50. package/api/types/AttachedTestModel.d.ts +6 -0
  51. package/api/types/AttachedTestModel.js +5 -0
  52. package/api/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.d.ts +4 -1
  53. package/api/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +4 -0
  54. package/api/types/CreateUnitTestRequestDynamicVariablesValue.js +5 -0
  55. package/api/types/CreateUnitTestResponseModel.d.ts +6 -0
  56. package/api/types/CreateUnitTestResponseModel.js +5 -0
  57. package/api/types/DetailedMusicResponse.d.ts +13 -0
  58. package/api/types/DetailedMusicResponse.js +5 -0
  59. package/api/types/ExactParameterEvaluationStrategy.d.ts +7 -0
  60. package/api/types/ExactParameterEvaluationStrategy.js +5 -0
  61. package/api/types/ExtendedSubscriptionResponseModelPendingChange.d.ts +8 -0
  62. package/api/types/ExtendedSubscriptionResponseModelPendingChange.js +5 -0
  63. package/api/types/FeaturesUsageCommonModel.d.ts +1 -0
  64. package/api/types/GetTestSuiteInvocationResponseModel.d.ts +9 -0
  65. package/api/types/GetTestSuiteInvocationResponseModel.js +5 -0
  66. package/api/types/GetTestsPageResponseModel.d.ts +9 -0
  67. package/api/types/GetTestsPageResponseModel.js +5 -0
  68. package/api/types/GetTestsSummariesByIdsResponseModel.d.ts +8 -0
  69. package/api/types/GetTestsSummariesByIdsResponseModel.js +5 -0
  70. package/api/types/GetUnitTestResponseModel.d.ts +19 -0
  71. package/api/types/GetUnitTestResponseModel.js +5 -0
  72. package/api/types/GetUnitTestResponseModelDynamicVariablesValue.d.ts +4 -0
  73. package/api/types/GetUnitTestResponseModelDynamicVariablesValue.js +5 -0
  74. package/api/types/Llm.d.ts +3 -3
  75. package/api/types/Llm.js +2 -2
  76. package/api/types/LlmParameterEvaluationStrategy.d.ts +7 -0
  77. package/api/types/LlmParameterEvaluationStrategy.js +5 -0
  78. package/api/types/MultipartMusicResponse.d.ts +13 -0
  79. package/api/types/MultipartMusicResponse.js +5 -0
  80. package/api/types/PendingCancellationResponseModel.d.ts +8 -0
  81. package/api/types/PendingCancellationResponseModel.js +5 -0
  82. package/api/types/PendingSubscriptionSwitchResponseModel.d.ts +11 -0
  83. package/api/types/PendingSubscriptionSwitchResponseModel.js +5 -0
  84. package/api/types/PendingSubscriptionSwitchResponseModelNextTier.d.ts +19 -0
  85. package/api/types/PendingSubscriptionSwitchResponseModelNextTier.js +18 -0
  86. package/api/types/ReferencedToolCommonModel.d.ts +13 -0
  87. package/api/types/ReferencedToolCommonModel.js +5 -0
  88. package/api/types/RegexParameterEvaluationStrategy.d.ts +7 -0
  89. package/api/types/RegexParameterEvaluationStrategy.js +5 -0
  90. package/api/types/SingleTestRunRequestModel.d.ts +7 -0
  91. package/api/types/SingleTestRunRequestModel.js +5 -0
  92. package/api/types/SongMetadata.d.ts +15 -0
  93. package/api/types/SongMetadata.js +5 -0
  94. package/api/types/Subscription.d.ts +2 -0
  95. package/api/types/TestConditionRationaleCommonModel.d.ts +12 -0
  96. package/api/types/TestConditionRationaleCommonModel.js +5 -0
  97. package/api/types/TestConditionResultCommonModel.d.ts +8 -0
  98. package/api/types/TestConditionResultCommonModel.js +5 -0
  99. package/api/types/TestRunStatus.d.ts +9 -0
  100. package/api/types/TestRunStatus.js +11 -0
  101. package/api/types/TestToolResultModel.d.ts +7 -0
  102. package/api/types/TestToolResultModel.js +5 -0
  103. package/api/types/UnitTestRunResponseModel.d.ts +13 -0
  104. package/api/types/UnitTestRunResponseModel.js +5 -0
  105. package/api/types/UnitTestSummaryResponseModel.d.ts +16 -0
  106. package/api/types/UnitTestSummaryResponseModel.js +5 -0
  107. package/api/types/UnitTestToolCallEvaluationModelInput.d.ts +10 -0
  108. package/api/types/UnitTestToolCallEvaluationModelInput.js +5 -0
  109. package/api/types/UnitTestToolCallEvaluationModelOutput.d.ts +10 -0
  110. package/api/types/UnitTestToolCallEvaluationModelOutput.js +5 -0
  111. package/api/types/UnitTestToolCallParameter.d.ts +8 -0
  112. package/api/types/UnitTestToolCallParameter.js +5 -0
  113. package/api/types/UnitTestToolCallParameterEval.d.ts +16 -0
  114. package/api/types/UnitTestToolCallParameterEval.js +5 -0
  115. package/api/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +4 -0
  116. package/api/types/UpdateUnitTestRequestDynamicVariablesValue.js +5 -0
  117. package/api/types/User.d.ts +3 -1
  118. package/api/types/WebhookAuthMethodType.d.ts +2 -1
  119. package/api/types/WebhookAuthMethodType.js +1 -0
  120. package/api/types/WorkflowFeaturesUsageCommonModel.d.ts +8 -0
  121. package/api/types/WorkflowFeaturesUsageCommonModel.js +5 -0
  122. package/api/types/WorkspaceApiKeyResponseModelPermissionsItem.d.ts +4 -1
  123. package/api/types/WorkspaceApiKeyResponseModelPermissionsItem.js +3 -0
  124. package/api/types/WorkspaceResourceType.d.ts +1 -2
  125. package/api/types/WorkspaceResourceType.js +0 -1
  126. package/api/types/index.d.ts +35 -1
  127. package/api/types/index.js +35 -1
  128. package/dist/Client.d.ts +160 -0
  129. package/dist/Client.js +687 -2
  130. package/dist/api/client/index.d.ts +1 -0
  131. package/dist/api/client/index.js +17 -0
  132. package/dist/api/client/requests/CreateUnitTestRequest.d.ts +37 -0
  133. package/dist/api/client/requests/CreateUnitTestRequest.js +5 -0
  134. package/dist/api/client/requests/ListChatResponseTestsRouteRequest.d.ts +21 -0
  135. package/dist/api/client/requests/ListChatResponseTestsRouteRequest.js +5 -0
  136. package/dist/api/client/requests/ListTestsByIdsRequestModel.d.ts +13 -0
  137. package/dist/api/client/requests/ListTestsByIdsRequestModel.js +5 -0
  138. package/dist/api/client/requests/ResubmitTestsRequestModel.d.ts +19 -0
  139. package/dist/api/client/requests/ResubmitTestsRequestModel.js +5 -0
  140. package/dist/api/client/requests/RunAgentTestsRequestModel.d.ts +18 -0
  141. package/dist/api/client/requests/RunAgentTestsRequestModel.js +5 -0
  142. package/dist/api/client/requests/UpdateUnitTestRequest.d.ts +37 -0
  143. package/dist/api/client/requests/UpdateUnitTestRequest.js +5 -0
  144. package/dist/api/client/requests/index.d.ts +6 -0
  145. package/dist/api/client/requests/index.js +2 -0
  146. package/dist/api/index.d.ts +1 -0
  147. package/dist/api/index.js +1 -0
  148. package/dist/api/resources/conversationalAi/resources/tools/client/Client.d.ts +1 -1
  149. package/dist/api/resources/conversationalAi/resources/tools/client/Client.js +1 -1
  150. package/dist/api/resources/music/client/Client.d.ts +6 -0
  151. package/dist/api/resources/music/client/Client.js +67 -0
  152. package/dist/api/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +5 -1
  153. package/dist/api/resources/music/client/requests/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +5 -0
  154. package/dist/api/resources/music/client/requests/index.d.ts +1 -0
  155. package/dist/api/resources/music/types/MusicComposeDetailedRequestOutputFormat.d.ts +28 -0
  156. package/dist/api/resources/music/types/MusicComposeDetailedRequestOutputFormat.js +27 -0
  157. package/dist/api/resources/music/types/index.d.ts +1 -0
  158. package/dist/api/resources/music/types/index.js +1 -0
  159. package/dist/api/resources/pronunciationDictionaries/client/Client.d.ts +20 -6
  160. package/dist/api/resources/pronunciationDictionaries/client/Client.js +90 -16
  161. package/dist/api/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.d.ts +13 -0
  162. package/dist/api/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.js +5 -0
  163. package/dist/api/resources/pronunciationDictionaries/client/requests/index.d.ts +1 -0
  164. package/dist/api/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.d.ts +4 -1
  165. package/dist/api/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.js +3 -0
  166. package/dist/api/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.d.ts +4 -1
  167. package/dist/api/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.js +3 -0
  168. package/dist/api/resources/speechToText/client/requests/BodySpeechToTextV1SpeechToTextPost.d.ts +1 -1
  169. package/dist/api/resources/textToDialogue/client/Client.d.ts +2 -2
  170. package/dist/api/resources/textToDialogue/client/Client.js +2 -2
  171. package/dist/api/resources/textToSoundEffects/client/requests/CreateSoundEffectRequest.d.ts +1 -1
  172. package/dist/api/types/AdhocAgentConfigOverrideForTestRequestModel.d.ts +8 -0
  173. package/dist/api/types/AdhocAgentConfigOverrideForTestRequestModel.js +5 -0
  174. package/dist/api/types/AgentFailureResponseExample.d.ts +7 -0
  175. package/dist/api/types/AgentFailureResponseExample.js +5 -0
  176. package/dist/api/types/AgentSuccessfulResponseExample.d.ts +7 -0
  177. package/dist/api/types/AgentSuccessfulResponseExample.js +5 -0
  178. package/dist/api/types/AgentTestingSettings.d.ts +2 -1
  179. package/dist/api/types/AttachedTestModel.d.ts +6 -0
  180. package/dist/api/types/AttachedTestModel.js +5 -0
  181. package/dist/api/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.d.ts +4 -1
  182. package/dist/api/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +4 -0
  183. package/dist/api/types/CreateUnitTestRequestDynamicVariablesValue.js +5 -0
  184. package/dist/api/types/CreateUnitTestResponseModel.d.ts +6 -0
  185. package/dist/api/types/CreateUnitTestResponseModel.js +5 -0
  186. package/dist/api/types/DetailedMusicResponse.d.ts +13 -0
  187. package/dist/api/types/DetailedMusicResponse.js +5 -0
  188. package/dist/api/types/ExactParameterEvaluationStrategy.d.ts +7 -0
  189. package/dist/api/types/ExactParameterEvaluationStrategy.js +5 -0
  190. package/dist/api/types/ExtendedSubscriptionResponseModelPendingChange.d.ts +8 -0
  191. package/dist/api/types/ExtendedSubscriptionResponseModelPendingChange.js +5 -0
  192. package/dist/api/types/FeaturesUsageCommonModel.d.ts +1 -0
  193. package/dist/api/types/GetTestSuiteInvocationResponseModel.d.ts +9 -0
  194. package/dist/api/types/GetTestSuiteInvocationResponseModel.js +5 -0
  195. package/dist/api/types/GetTestsPageResponseModel.d.ts +9 -0
  196. package/dist/api/types/GetTestsPageResponseModel.js +5 -0
  197. package/dist/api/types/GetTestsSummariesByIdsResponseModel.d.ts +8 -0
  198. package/dist/api/types/GetTestsSummariesByIdsResponseModel.js +5 -0
  199. package/dist/api/types/GetUnitTestResponseModel.d.ts +19 -0
  200. package/dist/api/types/GetUnitTestResponseModel.js +5 -0
  201. package/dist/api/types/GetUnitTestResponseModelDynamicVariablesValue.d.ts +4 -0
  202. package/dist/api/types/GetUnitTestResponseModelDynamicVariablesValue.js +5 -0
  203. package/dist/api/types/Llm.d.ts +3 -3
  204. package/dist/api/types/Llm.js +2 -2
  205. package/dist/api/types/LlmParameterEvaluationStrategy.d.ts +7 -0
  206. package/dist/api/types/LlmParameterEvaluationStrategy.js +5 -0
  207. package/dist/api/types/MultipartMusicResponse.d.ts +13 -0
  208. package/dist/api/types/MultipartMusicResponse.js +5 -0
  209. package/dist/api/types/PendingCancellationResponseModel.d.ts +8 -0
  210. package/dist/api/types/PendingCancellationResponseModel.js +5 -0
  211. package/dist/api/types/PendingSubscriptionSwitchResponseModel.d.ts +11 -0
  212. package/dist/api/types/PendingSubscriptionSwitchResponseModel.js +5 -0
  213. package/dist/api/types/PendingSubscriptionSwitchResponseModelNextTier.d.ts +19 -0
  214. package/dist/api/types/PendingSubscriptionSwitchResponseModelNextTier.js +18 -0
  215. package/dist/api/types/ReferencedToolCommonModel.d.ts +13 -0
  216. package/dist/api/types/ReferencedToolCommonModel.js +5 -0
  217. package/dist/api/types/RegexParameterEvaluationStrategy.d.ts +7 -0
  218. package/dist/api/types/RegexParameterEvaluationStrategy.js +5 -0
  219. package/dist/api/types/SingleTestRunRequestModel.d.ts +7 -0
  220. package/dist/api/types/SingleTestRunRequestModel.js +5 -0
  221. package/dist/api/types/SongMetadata.d.ts +15 -0
  222. package/dist/api/types/SongMetadata.js +5 -0
  223. package/dist/api/types/Subscription.d.ts +2 -0
  224. package/dist/api/types/TestConditionRationaleCommonModel.d.ts +12 -0
  225. package/dist/api/types/TestConditionRationaleCommonModel.js +5 -0
  226. package/dist/api/types/TestConditionResultCommonModel.d.ts +8 -0
  227. package/dist/api/types/TestConditionResultCommonModel.js +5 -0
  228. package/dist/api/types/TestRunStatus.d.ts +9 -0
  229. package/dist/api/types/TestRunStatus.js +11 -0
  230. package/dist/api/types/TestToolResultModel.d.ts +7 -0
  231. package/dist/api/types/TestToolResultModel.js +5 -0
  232. package/dist/api/types/UnitTestRunResponseModel.d.ts +13 -0
  233. package/dist/api/types/UnitTestRunResponseModel.js +5 -0
  234. package/dist/api/types/UnitTestSummaryResponseModel.d.ts +16 -0
  235. package/dist/api/types/UnitTestSummaryResponseModel.js +5 -0
  236. package/dist/api/types/UnitTestToolCallEvaluationModelInput.d.ts +10 -0
  237. package/dist/api/types/UnitTestToolCallEvaluationModelInput.js +5 -0
  238. package/dist/api/types/UnitTestToolCallEvaluationModelOutput.d.ts +10 -0
  239. package/dist/api/types/UnitTestToolCallEvaluationModelOutput.js +5 -0
  240. package/dist/api/types/UnitTestToolCallParameter.d.ts +8 -0
  241. package/dist/api/types/UnitTestToolCallParameter.js +5 -0
  242. package/dist/api/types/UnitTestToolCallParameterEval.d.ts +16 -0
  243. package/dist/api/types/UnitTestToolCallParameterEval.js +5 -0
  244. package/dist/api/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +4 -0
  245. package/dist/api/types/UpdateUnitTestRequestDynamicVariablesValue.js +5 -0
  246. package/dist/api/types/User.d.ts +3 -1
  247. package/dist/api/types/WebhookAuthMethodType.d.ts +2 -1
  248. package/dist/api/types/WebhookAuthMethodType.js +1 -0
  249. package/dist/api/types/WorkflowFeaturesUsageCommonModel.d.ts +8 -0
  250. package/dist/api/types/WorkflowFeaturesUsageCommonModel.js +5 -0
  251. package/dist/api/types/WorkspaceApiKeyResponseModelPermissionsItem.d.ts +4 -1
  252. package/dist/api/types/WorkspaceApiKeyResponseModelPermissionsItem.js +3 -0
  253. package/dist/api/types/WorkspaceResourceType.d.ts +1 -2
  254. package/dist/api/types/WorkspaceResourceType.js +0 -1
  255. package/dist/api/types/index.d.ts +35 -1
  256. package/dist/api/types/index.js +35 -1
  257. package/dist/serialization/client/index.d.ts +1 -0
  258. package/dist/serialization/client/index.js +17 -0
  259. package/dist/serialization/client/requests/CreateUnitTestRequest.d.ts +23 -0
  260. package/dist/serialization/client/requests/CreateUnitTestRequest.js +56 -0
  261. package/dist/serialization/client/requests/ListTestsByIdsRequestModel.d.ts +12 -0
  262. package/dist/serialization/client/requests/ListTestsByIdsRequestModel.js +43 -0
  263. package/dist/serialization/client/requests/ResubmitTestsRequestModel.d.ts +15 -0
  264. package/dist/serialization/client/requests/ResubmitTestsRequestModel.js +46 -0
  265. package/dist/serialization/client/requests/RunAgentTestsRequestModel.d.ts +15 -0
  266. package/dist/serialization/client/requests/RunAgentTestsRequestModel.js +46 -0
  267. package/dist/serialization/client/requests/UpdateUnitTestRequest.d.ts +23 -0
  268. package/dist/serialization/client/requests/UpdateUnitTestRequest.js +56 -0
  269. package/dist/serialization/client/requests/index.d.ts +5 -0
  270. package/dist/serialization/client/requests/index.js +13 -0
  271. package/dist/serialization/index.d.ts +1 -0
  272. package/dist/serialization/index.js +1 -0
  273. package/dist/serialization/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +5 -5
  274. package/dist/serialization/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +2 -2
  275. package/dist/serialization/resources/music/client/requests/index.d.ts +1 -0
  276. package/dist/serialization/resources/music/client/requests/index.js +3 -1
  277. package/dist/serialization/resources/music/types/MusicComposeDetailedRequestOutputFormat.d.ts +10 -0
  278. package/dist/serialization/resources/music/types/MusicComposeDetailedRequestOutputFormat.js +61 -0
  279. package/dist/serialization/resources/music/types/index.d.ts +1 -0
  280. package/dist/serialization/resources/music/types/index.js +1 -0
  281. package/dist/serialization/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.d.ts +13 -0
  282. package/dist/serialization/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.js +44 -0
  283. package/dist/serialization/resources/pronunciationDictionaries/client/requests/index.d.ts +1 -0
  284. package/dist/serialization/resources/pronunciationDictionaries/client/requests/index.js +3 -1
  285. package/dist/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.d.ts +1 -1
  286. package/dist/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.js +3 -0
  287. package/dist/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.d.ts +1 -1
  288. package/dist/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.js +3 -0
  289. package/dist/serialization/types/AdhocAgentConfigOverrideForTestRequestModel.d.ts +15 -0
  290. package/dist/serialization/types/AdhocAgentConfigOverrideForTestRequestModel.js +46 -0
  291. package/dist/serialization/types/AgentFailureResponseExample.d.ts +13 -0
  292. package/dist/serialization/types/AgentFailureResponseExample.js +44 -0
  293. package/dist/serialization/types/AgentSuccessfulResponseExample.d.ts +13 -0
  294. package/dist/serialization/types/AgentSuccessfulResponseExample.js +44 -0
  295. package/dist/serialization/types/AgentTestingSettings.d.ts +2 -1
  296. package/dist/serialization/types/AgentTestingSettings.js +2 -1
  297. package/dist/serialization/types/AttachedTestModel.d.ts +12 -0
  298. package/dist/serialization/types/AttachedTestModel.js +43 -0
  299. package/dist/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.d.ts +5 -1
  300. package/dist/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.js +2 -0
  301. package/dist/serialization/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
  302. package/dist/serialization/types/CreateUnitTestRequestDynamicVariablesValue.js +46 -0
  303. package/dist/serialization/types/CreateUnitTestResponseModel.d.ts +12 -0
  304. package/dist/serialization/types/CreateUnitTestResponseModel.js +43 -0
  305. package/dist/serialization/types/DetailedMusicResponse.d.ts +15 -0
  306. package/dist/serialization/types/DetailedMusicResponse.js +46 -0
  307. package/dist/serialization/types/ExactParameterEvaluationStrategy.d.ts +12 -0
  308. package/dist/serialization/types/ExactParameterEvaluationStrategy.js +43 -0
  309. package/dist/serialization/types/ExtendedSubscriptionResponseModelPendingChange.d.ts +12 -0
  310. package/dist/serialization/types/ExtendedSubscriptionResponseModelPendingChange.js +43 -0
  311. package/dist/serialization/types/FeaturesUsageCommonModel.d.ts +2 -0
  312. package/dist/serialization/types/FeaturesUsageCommonModel.js +2 -0
  313. package/dist/serialization/types/GetTestSuiteInvocationResponseModel.d.ts +15 -0
  314. package/dist/serialization/types/GetTestSuiteInvocationResponseModel.js +46 -0
  315. package/dist/serialization/types/GetTestsPageResponseModel.d.ts +15 -0
  316. package/dist/serialization/types/GetTestsPageResponseModel.js +46 -0
  317. package/dist/serialization/types/GetTestsSummariesByIdsResponseModel.d.ts +13 -0
  318. package/dist/serialization/types/GetTestsSummariesByIdsResponseModel.js +44 -0
  319. package/dist/serialization/types/GetUnitTestResponseModel.d.ts +24 -0
  320. package/dist/serialization/types/GetUnitTestResponseModel.js +57 -0
  321. package/dist/serialization/types/GetUnitTestResponseModelDynamicVariablesValue.d.ts +10 -0
  322. package/dist/serialization/types/GetUnitTestResponseModelDynamicVariablesValue.js +46 -0
  323. package/dist/serialization/types/Llm.d.ts +1 -1
  324. package/dist/serialization/types/Llm.js +2 -2
  325. package/dist/serialization/types/LlmParameterEvaluationStrategy.d.ts +12 -0
  326. package/dist/serialization/types/LlmParameterEvaluationStrategy.js +43 -0
  327. package/dist/serialization/types/MultipartMusicResponse.d.ts +14 -0
  328. package/dist/serialization/types/MultipartMusicResponse.js +45 -0
  329. package/dist/serialization/types/PendingCancellationResponseModel.d.ts +13 -0
  330. package/dist/serialization/types/PendingCancellationResponseModel.js +44 -0
  331. package/dist/serialization/types/PendingSubscriptionSwitchResponseModel.d.ts +15 -0
  332. package/dist/serialization/types/PendingSubscriptionSwitchResponseModel.js +46 -0
  333. package/dist/serialization/types/PendingSubscriptionSwitchResponseModelNextTier.d.ts +10 -0
  334. package/dist/serialization/types/PendingSubscriptionSwitchResponseModelNextTier.js +52 -0
  335. package/dist/serialization/types/ReferencedToolCommonModel.d.ts +14 -0
  336. package/dist/serialization/types/ReferencedToolCommonModel.js +45 -0
  337. package/dist/serialization/types/RegexParameterEvaluationStrategy.d.ts +12 -0
  338. package/dist/serialization/types/RegexParameterEvaluationStrategy.js +43 -0
  339. package/dist/serialization/types/SingleTestRunRequestModel.d.ts +12 -0
  340. package/dist/serialization/types/SingleTestRunRequestModel.js +43 -0
  341. package/dist/serialization/types/SongMetadata.d.ts +16 -0
  342. package/dist/serialization/types/SongMetadata.js +47 -0
  343. package/dist/serialization/types/Subscription.d.ts +2 -0
  344. package/dist/serialization/types/Subscription.js +2 -0
  345. package/dist/serialization/types/TestConditionRationaleCommonModel.d.ts +13 -0
  346. package/dist/serialization/types/TestConditionRationaleCommonModel.js +44 -0
  347. package/dist/serialization/types/TestConditionResultCommonModel.d.ts +15 -0
  348. package/dist/serialization/types/TestConditionResultCommonModel.js +46 -0
  349. package/dist/serialization/types/TestRunStatus.d.ts +10 -0
  350. package/dist/serialization/types/TestRunStatus.js +41 -0
  351. package/dist/serialization/types/TestToolResultModel.d.ts +13 -0
  352. package/dist/serialization/types/TestToolResultModel.js +44 -0
  353. package/dist/serialization/types/UnitTestRunResponseModel.d.ts +21 -0
  354. package/dist/serialization/types/UnitTestRunResponseModel.js +52 -0
  355. package/dist/serialization/types/UnitTestSummaryResponseModel.d.ts +17 -0
  356. package/dist/serialization/types/UnitTestSummaryResponseModel.js +48 -0
  357. package/dist/serialization/types/UnitTestToolCallEvaluationModelInput.d.ts +15 -0
  358. package/dist/serialization/types/UnitTestToolCallEvaluationModelInput.js +46 -0
  359. package/dist/serialization/types/UnitTestToolCallEvaluationModelOutput.d.ts +15 -0
  360. package/dist/serialization/types/UnitTestToolCallEvaluationModelOutput.js +46 -0
  361. package/dist/serialization/types/UnitTestToolCallParameter.d.ts +14 -0
  362. package/dist/serialization/types/UnitTestToolCallParameter.js +45 -0
  363. package/dist/serialization/types/UnitTestToolCallParameterEval.d.ts +22 -0
  364. package/dist/serialization/types/UnitTestToolCallParameterEval.js +53 -0
  365. package/dist/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
  366. package/dist/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.js +46 -0
  367. package/dist/serialization/types/User.d.ts +1 -0
  368. package/dist/serialization/types/User.js +1 -0
  369. package/dist/serialization/types/WebhookAuthMethodType.d.ts +1 -1
  370. package/dist/serialization/types/WebhookAuthMethodType.js +1 -1
  371. package/dist/serialization/types/WorkflowFeaturesUsageCommonModel.d.ts +14 -0
  372. package/dist/serialization/types/WorkflowFeaturesUsageCommonModel.js +45 -0
  373. package/dist/serialization/types/WorkspaceApiKeyResponseModelPermissionsItem.d.ts +1 -1
  374. package/dist/serialization/types/WorkspaceApiKeyResponseModelPermissionsItem.js +3 -0
  375. package/dist/serialization/types/WorkspaceResourceType.d.ts +1 -1
  376. package/dist/serialization/types/WorkspaceResourceType.js +0 -1
  377. package/dist/serialization/types/index.d.ts +35 -1
  378. package/dist/serialization/types/index.js +35 -1
  379. package/dist/version.d.ts +1 -1
  380. package/dist/version.js +1 -1
  381. package/dist/wrapper/ElevenLabsClient.d.ts +3 -0
  382. package/dist/wrapper/ElevenLabsClient.js +8 -0
  383. package/dist/wrapper/index.d.ts +1 -0
  384. package/dist/wrapper/index.js +3 -1
  385. package/dist/wrapper/music.d.ts +43 -0
  386. package/dist/wrapper/music.js +162 -0
  387. package/package.json +1 -1
  388. package/reference.md +74 -3
  389. package/serialization/client/index.d.ts +1 -0
  390. package/serialization/client/index.js +17 -0
  391. package/serialization/client/requests/CreateUnitTestRequest.d.ts +23 -0
  392. package/serialization/client/requests/CreateUnitTestRequest.js +56 -0
  393. package/serialization/client/requests/ListTestsByIdsRequestModel.d.ts +12 -0
  394. package/serialization/client/requests/ListTestsByIdsRequestModel.js +43 -0
  395. package/serialization/client/requests/ResubmitTestsRequestModel.d.ts +15 -0
  396. package/serialization/client/requests/ResubmitTestsRequestModel.js +46 -0
  397. package/serialization/client/requests/RunAgentTestsRequestModel.d.ts +15 -0
  398. package/serialization/client/requests/RunAgentTestsRequestModel.js +46 -0
  399. package/serialization/client/requests/UpdateUnitTestRequest.d.ts +23 -0
  400. package/serialization/client/requests/UpdateUnitTestRequest.js +56 -0
  401. package/serialization/client/requests/index.d.ts +5 -0
  402. package/serialization/client/requests/index.js +13 -0
  403. package/serialization/index.d.ts +1 -0
  404. package/serialization/index.js +1 -0
  405. package/serialization/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.d.ts +5 -5
  406. package/serialization/{types → resources/music/client/requests}/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js +2 -2
  407. package/serialization/resources/music/client/requests/index.d.ts +1 -0
  408. package/serialization/resources/music/client/requests/index.js +3 -1
  409. package/serialization/resources/music/types/MusicComposeDetailedRequestOutputFormat.d.ts +10 -0
  410. package/serialization/resources/music/types/MusicComposeDetailedRequestOutputFormat.js +61 -0
  411. package/serialization/resources/music/types/index.d.ts +1 -0
  412. package/serialization/resources/music/types/index.js +1 -0
  413. package/serialization/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.d.ts +13 -0
  414. package/serialization/resources/pronunciationDictionaries/client/requests/BodyUpdatePronunciationDictionaryV1PronunciationDictionariesPronunciationDictionaryIdPatch.js +44 -0
  415. package/serialization/resources/pronunciationDictionaries/client/requests/index.d.ts +1 -0
  416. package/serialization/resources/pronunciationDictionaries/client/requests/index.js +3 -1
  417. package/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.d.ts +1 -1
  418. package/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPostPermissionsItem.js +3 -0
  419. package/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.d.ts +1 -1
  420. package/serialization/resources/serviceAccounts/resources/apiKeys/types/BodyEditServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysApiKeyIdPatchPermissionsItem.js +3 -0
  421. package/serialization/types/AdhocAgentConfigOverrideForTestRequestModel.d.ts +15 -0
  422. package/serialization/types/AdhocAgentConfigOverrideForTestRequestModel.js +46 -0
  423. package/serialization/types/AgentFailureResponseExample.d.ts +13 -0
  424. package/serialization/types/AgentFailureResponseExample.js +44 -0
  425. package/serialization/types/AgentSuccessfulResponseExample.d.ts +13 -0
  426. package/serialization/types/AgentSuccessfulResponseExample.js +44 -0
  427. package/serialization/types/AgentTestingSettings.d.ts +2 -1
  428. package/serialization/types/AgentTestingSettings.js +2 -1
  429. package/serialization/types/AttachedTestModel.d.ts +12 -0
  430. package/serialization/types/AttachedTestModel.js +43 -0
  431. package/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.d.ts +5 -1
  432. package/serialization/types/ConversationHistoryTranscriptSystemToolResultCommonModelResult.js +2 -0
  433. package/serialization/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
  434. package/serialization/types/CreateUnitTestRequestDynamicVariablesValue.js +46 -0
  435. package/serialization/types/CreateUnitTestResponseModel.d.ts +12 -0
  436. package/serialization/types/CreateUnitTestResponseModel.js +43 -0
  437. package/serialization/types/DetailedMusicResponse.d.ts +15 -0
  438. package/serialization/types/DetailedMusicResponse.js +46 -0
  439. package/serialization/types/ExactParameterEvaluationStrategy.d.ts +12 -0
  440. package/serialization/types/ExactParameterEvaluationStrategy.js +43 -0
  441. package/serialization/types/ExtendedSubscriptionResponseModelPendingChange.d.ts +12 -0
  442. package/serialization/types/ExtendedSubscriptionResponseModelPendingChange.js +43 -0
  443. package/serialization/types/FeaturesUsageCommonModel.d.ts +2 -0
  444. package/serialization/types/FeaturesUsageCommonModel.js +2 -0
  445. package/serialization/types/GetTestSuiteInvocationResponseModel.d.ts +15 -0
  446. package/serialization/types/GetTestSuiteInvocationResponseModel.js +46 -0
  447. package/serialization/types/GetTestsPageResponseModel.d.ts +15 -0
  448. package/serialization/types/GetTestsPageResponseModel.js +46 -0
  449. package/serialization/types/GetTestsSummariesByIdsResponseModel.d.ts +13 -0
  450. package/serialization/types/GetTestsSummariesByIdsResponseModel.js +44 -0
  451. package/serialization/types/GetUnitTestResponseModel.d.ts +24 -0
  452. package/serialization/types/GetUnitTestResponseModel.js +57 -0
  453. package/serialization/types/GetUnitTestResponseModelDynamicVariablesValue.d.ts +10 -0
  454. package/serialization/types/GetUnitTestResponseModelDynamicVariablesValue.js +46 -0
  455. package/serialization/types/Llm.d.ts +1 -1
  456. package/serialization/types/Llm.js +2 -2
  457. package/serialization/types/LlmParameterEvaluationStrategy.d.ts +12 -0
  458. package/serialization/types/LlmParameterEvaluationStrategy.js +43 -0
  459. package/serialization/types/MultipartMusicResponse.d.ts +14 -0
  460. package/serialization/types/MultipartMusicResponse.js +45 -0
  461. package/serialization/types/PendingCancellationResponseModel.d.ts +13 -0
  462. package/serialization/types/PendingCancellationResponseModel.js +44 -0
  463. package/serialization/types/PendingSubscriptionSwitchResponseModel.d.ts +15 -0
  464. package/serialization/types/PendingSubscriptionSwitchResponseModel.js +46 -0
  465. package/serialization/types/PendingSubscriptionSwitchResponseModelNextTier.d.ts +10 -0
  466. package/serialization/types/PendingSubscriptionSwitchResponseModelNextTier.js +52 -0
  467. package/serialization/types/ReferencedToolCommonModel.d.ts +14 -0
  468. package/serialization/types/ReferencedToolCommonModel.js +45 -0
  469. package/serialization/types/RegexParameterEvaluationStrategy.d.ts +12 -0
  470. package/serialization/types/RegexParameterEvaluationStrategy.js +43 -0
  471. package/serialization/types/SingleTestRunRequestModel.d.ts +12 -0
  472. package/serialization/types/SingleTestRunRequestModel.js +43 -0
  473. package/serialization/types/SongMetadata.d.ts +16 -0
  474. package/serialization/types/SongMetadata.js +47 -0
  475. package/serialization/types/Subscription.d.ts +2 -0
  476. package/serialization/types/Subscription.js +2 -0
  477. package/serialization/types/TestConditionRationaleCommonModel.d.ts +13 -0
  478. package/serialization/types/TestConditionRationaleCommonModel.js +44 -0
  479. package/serialization/types/TestConditionResultCommonModel.d.ts +15 -0
  480. package/serialization/types/TestConditionResultCommonModel.js +46 -0
  481. package/serialization/types/TestRunStatus.d.ts +10 -0
  482. package/serialization/types/TestRunStatus.js +41 -0
  483. package/serialization/types/TestToolResultModel.d.ts +13 -0
  484. package/serialization/types/TestToolResultModel.js +44 -0
  485. package/serialization/types/UnitTestRunResponseModel.d.ts +21 -0
  486. package/serialization/types/UnitTestRunResponseModel.js +52 -0
  487. package/serialization/types/UnitTestSummaryResponseModel.d.ts +17 -0
  488. package/serialization/types/UnitTestSummaryResponseModel.js +48 -0
  489. package/serialization/types/UnitTestToolCallEvaluationModelInput.d.ts +15 -0
  490. package/serialization/types/UnitTestToolCallEvaluationModelInput.js +46 -0
  491. package/serialization/types/UnitTestToolCallEvaluationModelOutput.d.ts +15 -0
  492. package/serialization/types/UnitTestToolCallEvaluationModelOutput.js +46 -0
  493. package/serialization/types/UnitTestToolCallParameter.d.ts +14 -0
  494. package/serialization/types/UnitTestToolCallParameter.js +45 -0
  495. package/serialization/types/UnitTestToolCallParameterEval.d.ts +22 -0
  496. package/serialization/types/UnitTestToolCallParameterEval.js +53 -0
  497. package/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
  498. package/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.js +46 -0
  499. package/serialization/types/User.d.ts +1 -0
  500. package/serialization/types/User.js +1 -0
  501. package/serialization/types/WebhookAuthMethodType.d.ts +1 -1
  502. package/serialization/types/WebhookAuthMethodType.js +1 -1
  503. package/serialization/types/WorkflowFeaturesUsageCommonModel.d.ts +14 -0
  504. package/serialization/types/WorkflowFeaturesUsageCommonModel.js +45 -0
  505. package/serialization/types/WorkspaceApiKeyResponseModelPermissionsItem.d.ts +1 -1
  506. package/serialization/types/WorkspaceApiKeyResponseModelPermissionsItem.js +3 -0
  507. package/serialization/types/WorkspaceResourceType.d.ts +1 -1
  508. package/serialization/types/WorkspaceResourceType.js +0 -1
  509. package/serialization/types/index.d.ts +35 -1
  510. package/serialization/types/index.js +35 -1
  511. package/version.d.ts +1 -1
  512. package/version.js +1 -1
  513. package/wrapper/ElevenLabsClient.d.ts +3 -0
  514. package/wrapper/ElevenLabsClient.js +8 -0
  515. package/wrapper/index.d.ts +1 -0
  516. package/wrapper/index.js +3 -1
  517. package/wrapper/music.d.ts +43 -0
  518. package/wrapper/music.js +162 -0
  519. /package/api/{types/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js → client/requests/CreateUnitTestRequest.js} +0 -0
  520. /package/{dist/api/types/BodyComposeMusicWithADetailedResponseV1MusicDetailedPost.js → api/client/requests/ListChatResponseTestsRouteRequest.js} +0 -0
package/dist/Client.js CHANGED
@@ -49,6 +49,8 @@ exports.ElevenLabsClient = void 0;
49
49
  const environments = __importStar(require("./environments"));
50
50
  const core = __importStar(require("./core"));
51
51
  const headers_1 = require("./core/headers");
52
+ const ElevenLabs = __importStar(require("./api/index"));
53
+ const serializers = __importStar(require("./serialization/index"));
52
54
  const errors = __importStar(require("./errors/index"));
53
55
  const Client_1 = require("./api/resources/history/client/Client");
54
56
  const Client_2 = require("./api/resources/textToSoundEffects/client/Client");
@@ -79,8 +81,8 @@ class ElevenLabsClient {
79
81
  "xi-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
80
82
  "X-Fern-Language": "JavaScript",
81
83
  "X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
82
- "X-Fern-SDK-Version": "v2.10.0",
83
- "User-Agent": "@elevenlabs/elevenlabs-js/v2.10.0",
84
+ "X-Fern-SDK-Version": "v2.12.0",
85
+ "User-Agent": "@elevenlabs/elevenlabs-js/v2.12.0",
84
86
  "X-Fern-Runtime": core.RUNTIME.type,
85
87
  "X-Fern-Runtime-Version": core.RUNTIME.version,
86
88
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -177,6 +179,689 @@ class ElevenLabsClient {
177
179
  var _a;
178
180
  return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new Client_23.Workspace(this._options)));
179
181
  }
182
+ /**
183
+ * Creates a new agent response test.
184
+ *
185
+ * @param {ElevenLabs.CreateUnitTestRequest} request
186
+ * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
187
+ *
188
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
189
+ *
190
+ * @example
191
+ * await client.createAgentResponseTestRoute({
192
+ * chatHistory: [{
193
+ * role: "user",
194
+ * timeInCallSecs: 1
195
+ * }],
196
+ * successCondition: "success_condition",
197
+ * successExamples: [{
198
+ * response: "response",
199
+ * type: "success"
200
+ * }],
201
+ * failureExamples: [{
202
+ * response: "response",
203
+ * type: "failure"
204
+ * }],
205
+ * name: "name"
206
+ * })
207
+ */
208
+ createAgentResponseTestRoute(request, requestOptions) {
209
+ return core.HttpResponsePromise.fromPromise(this.__createAgentResponseTestRoute(request, requestOptions));
210
+ }
211
+ __createAgentResponseTestRoute(request, requestOptions) {
212
+ return __awaiter(this, void 0, void 0, function* () {
213
+ var _a, _b, _c;
214
+ const _response = yield core.fetcher({
215
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, "v1/convai/agent-testing/create"),
216
+ method: "POST",
217
+ headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
218
+ contentType: "application/json",
219
+ requestType: "json",
220
+ body: serializers.CreateUnitTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
221
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
222
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
223
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
224
+ });
225
+ if (_response.ok) {
226
+ return {
227
+ data: serializers.CreateUnitTestResponseModel.parseOrThrow(_response.body, {
228
+ unrecognizedObjectKeys: "passthrough",
229
+ allowUnrecognizedUnionMembers: true,
230
+ allowUnrecognizedEnumValues: true,
231
+ breadcrumbsPrefix: ["response"],
232
+ }),
233
+ rawResponse: _response.rawResponse,
234
+ };
235
+ }
236
+ if (_response.error.reason === "status-code") {
237
+ switch (_response.error.statusCode) {
238
+ case 422:
239
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
240
+ unrecognizedObjectKeys: "passthrough",
241
+ allowUnrecognizedUnionMembers: true,
242
+ allowUnrecognizedEnumValues: true,
243
+ breadcrumbsPrefix: ["response"],
244
+ }), _response.rawResponse);
245
+ default:
246
+ throw new errors.ElevenLabsError({
247
+ statusCode: _response.error.statusCode,
248
+ body: _response.error.body,
249
+ rawResponse: _response.rawResponse,
250
+ });
251
+ }
252
+ }
253
+ switch (_response.error.reason) {
254
+ case "non-json":
255
+ throw new errors.ElevenLabsError({
256
+ statusCode: _response.error.statusCode,
257
+ body: _response.error.rawBody,
258
+ rawResponse: _response.rawResponse,
259
+ });
260
+ case "timeout":
261
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agent-testing/create.");
262
+ case "unknown":
263
+ throw new errors.ElevenLabsError({
264
+ message: _response.error.errorMessage,
265
+ rawResponse: _response.rawResponse,
266
+ });
267
+ }
268
+ });
269
+ }
270
+ /**
271
+ * Gets an agent response test by ID.
272
+ *
273
+ * @param {string} testId - The id of a chat response test. This is returned on test creation.
274
+ * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
275
+ *
276
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
277
+ *
278
+ * @example
279
+ * await client.getAgentResponseTestRoute("TeaqRRdTcIfIu2i7BYfT")
280
+ */
281
+ getAgentResponseTestRoute(testId, requestOptions) {
282
+ return core.HttpResponsePromise.fromPromise(this.__getAgentResponseTestRoute(testId, requestOptions));
283
+ }
284
+ __getAgentResponseTestRoute(testId, requestOptions) {
285
+ return __awaiter(this, void 0, void 0, function* () {
286
+ var _a, _b, _c;
287
+ const _response = yield core.fetcher({
288
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/agent-testing/${encodeURIComponent(testId)}`),
289
+ method: "GET",
290
+ headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
291
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
292
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
293
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
294
+ });
295
+ if (_response.ok) {
296
+ return {
297
+ data: serializers.GetUnitTestResponseModel.parseOrThrow(_response.body, {
298
+ unrecognizedObjectKeys: "passthrough",
299
+ allowUnrecognizedUnionMembers: true,
300
+ allowUnrecognizedEnumValues: true,
301
+ breadcrumbsPrefix: ["response"],
302
+ }),
303
+ rawResponse: _response.rawResponse,
304
+ };
305
+ }
306
+ if (_response.error.reason === "status-code") {
307
+ switch (_response.error.statusCode) {
308
+ case 422:
309
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
310
+ unrecognizedObjectKeys: "passthrough",
311
+ allowUnrecognizedUnionMembers: true,
312
+ allowUnrecognizedEnumValues: true,
313
+ breadcrumbsPrefix: ["response"],
314
+ }), _response.rawResponse);
315
+ default:
316
+ throw new errors.ElevenLabsError({
317
+ statusCode: _response.error.statusCode,
318
+ body: _response.error.body,
319
+ rawResponse: _response.rawResponse,
320
+ });
321
+ }
322
+ }
323
+ switch (_response.error.reason) {
324
+ case "non-json":
325
+ throw new errors.ElevenLabsError({
326
+ statusCode: _response.error.statusCode,
327
+ body: _response.error.rawBody,
328
+ rawResponse: _response.rawResponse,
329
+ });
330
+ case "timeout":
331
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/agent-testing/{test_id}.");
332
+ case "unknown":
333
+ throw new errors.ElevenLabsError({
334
+ message: _response.error.errorMessage,
335
+ rawResponse: _response.rawResponse,
336
+ });
337
+ }
338
+ });
339
+ }
340
+ /**
341
+ * Updates an agent response test by ID.
342
+ *
343
+ * @param {string} testId - The id of a chat response test. This is returned on test creation.
344
+ * @param {ElevenLabs.UpdateUnitTestRequest} request
345
+ * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
346
+ *
347
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
348
+ *
349
+ * @example
350
+ * await client.updateAgentResponseTestRoute("TeaqRRdTcIfIu2i7BYfT", {
351
+ * chatHistory: [{
352
+ * role: "user",
353
+ * timeInCallSecs: 1
354
+ * }],
355
+ * successCondition: "success_condition",
356
+ * successExamples: [{
357
+ * response: "response",
358
+ * type: "success"
359
+ * }],
360
+ * failureExamples: [{
361
+ * response: "response",
362
+ * type: "failure"
363
+ * }],
364
+ * name: "name"
365
+ * })
366
+ */
367
+ updateAgentResponseTestRoute(testId, request, requestOptions) {
368
+ return core.HttpResponsePromise.fromPromise(this.__updateAgentResponseTestRoute(testId, request, requestOptions));
369
+ }
370
+ __updateAgentResponseTestRoute(testId, request, requestOptions) {
371
+ return __awaiter(this, void 0, void 0, function* () {
372
+ var _a, _b, _c;
373
+ const _response = yield core.fetcher({
374
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/agent-testing/${encodeURIComponent(testId)}`),
375
+ method: "PUT",
376
+ headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
377
+ contentType: "application/json",
378
+ requestType: "json",
379
+ body: serializers.UpdateUnitTestRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
380
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
381
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
382
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
383
+ });
384
+ if (_response.ok) {
385
+ return {
386
+ data: serializers.GetUnitTestResponseModel.parseOrThrow(_response.body, {
387
+ unrecognizedObjectKeys: "passthrough",
388
+ allowUnrecognizedUnionMembers: true,
389
+ allowUnrecognizedEnumValues: true,
390
+ breadcrumbsPrefix: ["response"],
391
+ }),
392
+ rawResponse: _response.rawResponse,
393
+ };
394
+ }
395
+ if (_response.error.reason === "status-code") {
396
+ switch (_response.error.statusCode) {
397
+ case 422:
398
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
399
+ unrecognizedObjectKeys: "passthrough",
400
+ allowUnrecognizedUnionMembers: true,
401
+ allowUnrecognizedEnumValues: true,
402
+ breadcrumbsPrefix: ["response"],
403
+ }), _response.rawResponse);
404
+ default:
405
+ throw new errors.ElevenLabsError({
406
+ statusCode: _response.error.statusCode,
407
+ body: _response.error.body,
408
+ rawResponse: _response.rawResponse,
409
+ });
410
+ }
411
+ }
412
+ switch (_response.error.reason) {
413
+ case "non-json":
414
+ throw new errors.ElevenLabsError({
415
+ statusCode: _response.error.statusCode,
416
+ body: _response.error.rawBody,
417
+ rawResponse: _response.rawResponse,
418
+ });
419
+ case "timeout":
420
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling PUT /v1/convai/agent-testing/{test_id}.");
421
+ case "unknown":
422
+ throw new errors.ElevenLabsError({
423
+ message: _response.error.errorMessage,
424
+ rawResponse: _response.rawResponse,
425
+ });
426
+ }
427
+ });
428
+ }
429
+ /**
430
+ * Deletes an agent response test by ID.
431
+ *
432
+ * @param {string} testId - The id of a chat response test. This is returned on test creation.
433
+ * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
434
+ *
435
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
436
+ *
437
+ * @example
438
+ * await client.deleteChatResponseTestRoute("TeaqRRdTcIfIu2i7BYfT")
439
+ */
440
+ deleteChatResponseTestRoute(testId, requestOptions) {
441
+ return core.HttpResponsePromise.fromPromise(this.__deleteChatResponseTestRoute(testId, requestOptions));
442
+ }
443
+ __deleteChatResponseTestRoute(testId, requestOptions) {
444
+ return __awaiter(this, void 0, void 0, function* () {
445
+ var _a, _b, _c;
446
+ const _response = yield core.fetcher({
447
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/agent-testing/${encodeURIComponent(testId)}`),
448
+ method: "DELETE",
449
+ headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
450
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
451
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
452
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
453
+ });
454
+ if (_response.ok) {
455
+ return { data: _response.body, rawResponse: _response.rawResponse };
456
+ }
457
+ if (_response.error.reason === "status-code") {
458
+ switch (_response.error.statusCode) {
459
+ case 422:
460
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
461
+ unrecognizedObjectKeys: "passthrough",
462
+ allowUnrecognizedUnionMembers: true,
463
+ allowUnrecognizedEnumValues: true,
464
+ breadcrumbsPrefix: ["response"],
465
+ }), _response.rawResponse);
466
+ default:
467
+ throw new errors.ElevenLabsError({
468
+ statusCode: _response.error.statusCode,
469
+ body: _response.error.body,
470
+ rawResponse: _response.rawResponse,
471
+ });
472
+ }
473
+ }
474
+ switch (_response.error.reason) {
475
+ case "non-json":
476
+ throw new errors.ElevenLabsError({
477
+ statusCode: _response.error.statusCode,
478
+ body: _response.error.rawBody,
479
+ rawResponse: _response.rawResponse,
480
+ });
481
+ case "timeout":
482
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling DELETE /v1/convai/agent-testing/{test_id}.");
483
+ case "unknown":
484
+ throw new errors.ElevenLabsError({
485
+ message: _response.error.errorMessage,
486
+ rawResponse: _response.rawResponse,
487
+ });
488
+ }
489
+ });
490
+ }
491
+ /**
492
+ * Gets multiple agent response tests by their IDs. Returns a dictionary mapping test IDs to test summaries.
493
+ *
494
+ * @param {ElevenLabs.ListTestsByIdsRequestModel} request
495
+ * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
496
+ *
497
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
498
+ *
499
+ * @example
500
+ * await client.getAgentResponseTestsSummariesRoute({
501
+ * testIds: ["test_id_1", "test_id_2"]
502
+ * })
503
+ */
504
+ getAgentResponseTestsSummariesRoute(request, requestOptions) {
505
+ return core.HttpResponsePromise.fromPromise(this.__getAgentResponseTestsSummariesRoute(request, requestOptions));
506
+ }
507
+ __getAgentResponseTestsSummariesRoute(request, requestOptions) {
508
+ return __awaiter(this, void 0, void 0, function* () {
509
+ var _a, _b, _c;
510
+ const _response = yield core.fetcher({
511
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, "v1/convai/agent-testing/summaries"),
512
+ method: "POST",
513
+ headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
514
+ contentType: "application/json",
515
+ requestType: "json",
516
+ body: serializers.ListTestsByIdsRequestModel.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
517
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
518
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
519
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
520
+ });
521
+ if (_response.ok) {
522
+ return {
523
+ data: serializers.GetTestsSummariesByIdsResponseModel.parseOrThrow(_response.body, {
524
+ unrecognizedObjectKeys: "passthrough",
525
+ allowUnrecognizedUnionMembers: true,
526
+ allowUnrecognizedEnumValues: true,
527
+ breadcrumbsPrefix: ["response"],
528
+ }),
529
+ rawResponse: _response.rawResponse,
530
+ };
531
+ }
532
+ if (_response.error.reason === "status-code") {
533
+ switch (_response.error.statusCode) {
534
+ case 422:
535
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
536
+ unrecognizedObjectKeys: "passthrough",
537
+ allowUnrecognizedUnionMembers: true,
538
+ allowUnrecognizedEnumValues: true,
539
+ breadcrumbsPrefix: ["response"],
540
+ }), _response.rawResponse);
541
+ default:
542
+ throw new errors.ElevenLabsError({
543
+ statusCode: _response.error.statusCode,
544
+ body: _response.error.body,
545
+ rawResponse: _response.rawResponse,
546
+ });
547
+ }
548
+ }
549
+ switch (_response.error.reason) {
550
+ case "non-json":
551
+ throw new errors.ElevenLabsError({
552
+ statusCode: _response.error.statusCode,
553
+ body: _response.error.rawBody,
554
+ rawResponse: _response.rawResponse,
555
+ });
556
+ case "timeout":
557
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agent-testing/summaries.");
558
+ case "unknown":
559
+ throw new errors.ElevenLabsError({
560
+ message: _response.error.errorMessage,
561
+ rawResponse: _response.rawResponse,
562
+ });
563
+ }
564
+ });
565
+ }
566
+ /**
567
+ * Lists all agent response tests with pagination support and optional search filtering.
568
+ *
569
+ * @param {ElevenLabs.ListChatResponseTestsRouteRequest} request
570
+ * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
571
+ *
572
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
573
+ *
574
+ * @example
575
+ * await client.listChatResponseTestsRoute()
576
+ */
577
+ listChatResponseTestsRoute(request = {}, requestOptions) {
578
+ return core.HttpResponsePromise.fromPromise(this.__listChatResponseTestsRoute(request, requestOptions));
579
+ }
580
+ __listChatResponseTestsRoute() {
581
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
582
+ var _a, _b, _c;
583
+ const { cursor, pageSize, search } = request;
584
+ const _queryParams = {};
585
+ if (cursor != null) {
586
+ _queryParams["cursor"] = cursor;
587
+ }
588
+ if (pageSize != null) {
589
+ _queryParams["page_size"] = pageSize.toString();
590
+ }
591
+ if (search != null) {
592
+ _queryParams["search"] = search;
593
+ }
594
+ const _response = yield core.fetcher({
595
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, "v1/convai/agent-testing"),
596
+ method: "GET",
597
+ headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
598
+ queryParameters: _queryParams,
599
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
600
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
601
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
602
+ });
603
+ if (_response.ok) {
604
+ return {
605
+ data: serializers.GetTestsPageResponseModel.parseOrThrow(_response.body, {
606
+ unrecognizedObjectKeys: "passthrough",
607
+ allowUnrecognizedUnionMembers: true,
608
+ allowUnrecognizedEnumValues: true,
609
+ breadcrumbsPrefix: ["response"],
610
+ }),
611
+ rawResponse: _response.rawResponse,
612
+ };
613
+ }
614
+ if (_response.error.reason === "status-code") {
615
+ switch (_response.error.statusCode) {
616
+ case 422:
617
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
618
+ unrecognizedObjectKeys: "passthrough",
619
+ allowUnrecognizedUnionMembers: true,
620
+ allowUnrecognizedEnumValues: true,
621
+ breadcrumbsPrefix: ["response"],
622
+ }), _response.rawResponse);
623
+ default:
624
+ throw new errors.ElevenLabsError({
625
+ statusCode: _response.error.statusCode,
626
+ body: _response.error.body,
627
+ rawResponse: _response.rawResponse,
628
+ });
629
+ }
630
+ }
631
+ switch (_response.error.reason) {
632
+ case "non-json":
633
+ throw new errors.ElevenLabsError({
634
+ statusCode: _response.error.statusCode,
635
+ body: _response.error.rawBody,
636
+ rawResponse: _response.rawResponse,
637
+ });
638
+ case "timeout":
639
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/agent-testing.");
640
+ case "unknown":
641
+ throw new errors.ElevenLabsError({
642
+ message: _response.error.errorMessage,
643
+ rawResponse: _response.rawResponse,
644
+ });
645
+ }
646
+ });
647
+ }
648
+ /**
649
+ * Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.
650
+ *
651
+ * @param {string} agentId - The id of an agent. This is returned on agent creation.
652
+ * @param {ElevenLabs.RunAgentTestsRequestModel} request
653
+ * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
654
+ *
655
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
656
+ *
657
+ * @example
658
+ * await client.runAgentTestSuiteRoute("21m00Tcm4TlvDq8ikWAM", {
659
+ * tests: [{
660
+ * testId: "test_id"
661
+ * }]
662
+ * })
663
+ */
664
+ runAgentTestSuiteRoute(agentId, request, requestOptions) {
665
+ return core.HttpResponsePromise.fromPromise(this.__runAgentTestSuiteRoute(agentId, request, requestOptions));
666
+ }
667
+ __runAgentTestSuiteRoute(agentId, request, requestOptions) {
668
+ return __awaiter(this, void 0, void 0, function* () {
669
+ var _a, _b, _c;
670
+ const _response = yield core.fetcher({
671
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/agents/${encodeURIComponent(agentId)}/run-tests`),
672
+ method: "POST",
673
+ headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
674
+ contentType: "application/json",
675
+ requestType: "json",
676
+ body: serializers.RunAgentTestsRequestModel.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
677
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
678
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
679
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
680
+ });
681
+ if (_response.ok) {
682
+ return {
683
+ data: serializers.GetTestSuiteInvocationResponseModel.parseOrThrow(_response.body, {
684
+ unrecognizedObjectKeys: "passthrough",
685
+ allowUnrecognizedUnionMembers: true,
686
+ allowUnrecognizedEnumValues: true,
687
+ breadcrumbsPrefix: ["response"],
688
+ }),
689
+ rawResponse: _response.rawResponse,
690
+ };
691
+ }
692
+ if (_response.error.reason === "status-code") {
693
+ switch (_response.error.statusCode) {
694
+ case 422:
695
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
696
+ unrecognizedObjectKeys: "passthrough",
697
+ allowUnrecognizedUnionMembers: true,
698
+ allowUnrecognizedEnumValues: true,
699
+ breadcrumbsPrefix: ["response"],
700
+ }), _response.rawResponse);
701
+ default:
702
+ throw new errors.ElevenLabsError({
703
+ statusCode: _response.error.statusCode,
704
+ body: _response.error.body,
705
+ rawResponse: _response.rawResponse,
706
+ });
707
+ }
708
+ }
709
+ switch (_response.error.reason) {
710
+ case "non-json":
711
+ throw new errors.ElevenLabsError({
712
+ statusCode: _response.error.statusCode,
713
+ body: _response.error.rawBody,
714
+ rawResponse: _response.rawResponse,
715
+ });
716
+ case "timeout":
717
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agents/{agent_id}/run-tests.");
718
+ case "unknown":
719
+ throw new errors.ElevenLabsError({
720
+ message: _response.error.errorMessage,
721
+ rawResponse: _response.rawResponse,
722
+ });
723
+ }
724
+ });
725
+ }
726
+ /**
727
+ * Gets a test invocation by ID.
728
+ *
729
+ * @param {string} testInvocationId - The id of a test invocation. This is returned when tests are run.
730
+ * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
731
+ *
732
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
733
+ *
734
+ * @example
735
+ * await client.getTestInvocationRoute("test_invocation_id")
736
+ */
737
+ getTestInvocationRoute(testInvocationId, requestOptions) {
738
+ return core.HttpResponsePromise.fromPromise(this.__getTestInvocationRoute(testInvocationId, requestOptions));
739
+ }
740
+ __getTestInvocationRoute(testInvocationId, requestOptions) {
741
+ return __awaiter(this, void 0, void 0, function* () {
742
+ var _a, _b, _c;
743
+ const _response = yield core.fetcher({
744
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/test-invocations/${encodeURIComponent(testInvocationId)}`),
745
+ method: "GET",
746
+ headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
747
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
748
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
749
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
750
+ });
751
+ if (_response.ok) {
752
+ return {
753
+ data: serializers.GetTestSuiteInvocationResponseModel.parseOrThrow(_response.body, {
754
+ unrecognizedObjectKeys: "passthrough",
755
+ allowUnrecognizedUnionMembers: true,
756
+ allowUnrecognizedEnumValues: true,
757
+ breadcrumbsPrefix: ["response"],
758
+ }),
759
+ rawResponse: _response.rawResponse,
760
+ };
761
+ }
762
+ if (_response.error.reason === "status-code") {
763
+ switch (_response.error.statusCode) {
764
+ case 422:
765
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
766
+ unrecognizedObjectKeys: "passthrough",
767
+ allowUnrecognizedUnionMembers: true,
768
+ allowUnrecognizedEnumValues: true,
769
+ breadcrumbsPrefix: ["response"],
770
+ }), _response.rawResponse);
771
+ default:
772
+ throw new errors.ElevenLabsError({
773
+ statusCode: _response.error.statusCode,
774
+ body: _response.error.body,
775
+ rawResponse: _response.rawResponse,
776
+ });
777
+ }
778
+ }
779
+ switch (_response.error.reason) {
780
+ case "non-json":
781
+ throw new errors.ElevenLabsError({
782
+ statusCode: _response.error.statusCode,
783
+ body: _response.error.rawBody,
784
+ rawResponse: _response.rawResponse,
785
+ });
786
+ case "timeout":
787
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/test-invocations/{test_invocation_id}.");
788
+ case "unknown":
789
+ throw new errors.ElevenLabsError({
790
+ message: _response.error.errorMessage,
791
+ rawResponse: _response.rawResponse,
792
+ });
793
+ }
794
+ });
795
+ }
796
+ /**
797
+ * Resubmits specific test runs from a test invocation.
798
+ *
799
+ * @param {string} testInvocationId - The id of a test invocation. This is returned when tests are run.
800
+ * @param {ElevenLabs.ResubmitTestsRequestModel} request
801
+ * @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
802
+ *
803
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
804
+ *
805
+ * @example
806
+ * await client.resubmitTestsRoute("test_invocation_id", {
807
+ * testRunIds: ["test_run_ids"],
808
+ * agentId: "agent_id"
809
+ * })
810
+ */
811
+ resubmitTestsRoute(testInvocationId, request, requestOptions) {
812
+ return core.HttpResponsePromise.fromPromise(this.__resubmitTestsRoute(testInvocationId, request, requestOptions));
813
+ }
814
+ __resubmitTestsRoute(testInvocationId, request, requestOptions) {
815
+ return __awaiter(this, void 0, void 0, function* () {
816
+ var _a, _b, _c;
817
+ const _response = yield core.fetcher({
818
+ url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/convai/test-invocations/${encodeURIComponent(testInvocationId)}/resubmit`),
819
+ method: "POST",
820
+ headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
821
+ contentType: "application/json",
822
+ requestType: "json",
823
+ body: serializers.ResubmitTestsRequestModel.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
824
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
825
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
826
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
827
+ });
828
+ if (_response.ok) {
829
+ return { data: _response.body, rawResponse: _response.rawResponse };
830
+ }
831
+ if (_response.error.reason === "status-code") {
832
+ switch (_response.error.statusCode) {
833
+ case 422:
834
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
835
+ unrecognizedObjectKeys: "passthrough",
836
+ allowUnrecognizedUnionMembers: true,
837
+ allowUnrecognizedEnumValues: true,
838
+ breadcrumbsPrefix: ["response"],
839
+ }), _response.rawResponse);
840
+ default:
841
+ throw new errors.ElevenLabsError({
842
+ statusCode: _response.error.statusCode,
843
+ body: _response.error.body,
844
+ rawResponse: _response.rawResponse,
845
+ });
846
+ }
847
+ }
848
+ switch (_response.error.reason) {
849
+ case "non-json":
850
+ throw new errors.ElevenLabsError({
851
+ statusCode: _response.error.statusCode,
852
+ body: _response.error.rawBody,
853
+ rawResponse: _response.rawResponse,
854
+ });
855
+ case "timeout":
856
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/test-invocations/{test_invocation_id}/resubmit.");
857
+ case "unknown":
858
+ throw new errors.ElevenLabsError({
859
+ message: _response.error.errorMessage,
860
+ rawResponse: _response.rawResponse,
861
+ });
862
+ }
863
+ });
864
+ }
180
865
  /**
181
866
  * Add a generated voice to the voice library.
182
867
  *