@elevenlabs/elevenlabs-js 2.12.0 → 2.12.2

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 (218) hide show
  1. package/Client.d.ts +0 -160
  2. package/Client.js +2 -687
  3. package/api/index.d.ts +0 -1
  4. package/api/index.js +0 -1
  5. package/api/resources/conversationalAi/client/Client.d.ts +3 -0
  6. package/api/resources/conversationalAi/client/Client.js +25 -20
  7. package/api/resources/conversationalAi/resources/agents/client/Client.d.ts +18 -0
  8. package/api/resources/conversationalAi/resources/agents/client/Client.js +80 -0
  9. package/api/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.d.ts +1 -1
  10. package/api/resources/conversationalAi/resources/agents/client/requests/index.d.ts +1 -0
  11. package/api/resources/conversationalAi/resources/index.d.ts +3 -0
  12. package/api/resources/conversationalAi/resources/index.js +4 -1
  13. package/api/resources/conversationalAi/resources/tests/client/Client.d.ts +147 -0
  14. package/api/resources/conversationalAi/resources/tests/client/Client.js +537 -0
  15. package/api/resources/conversationalAi/resources/tests/client/index.d.ts +2 -0
  16. package/{dist/api → api/resources/conversationalAi/resources/tests}/client/requests/CreateUnitTestRequest.d.ts +2 -2
  17. package/api/{client/requests/ListChatResponseTestsRouteRequest.d.ts → resources/conversationalAi/resources/tests/client/requests/TestsListRequest.d.ts} +1 -1
  18. package/api/{client → resources/conversationalAi/resources/tests/client}/requests/UpdateUnitTestRequest.d.ts +2 -2
  19. package/api/resources/conversationalAi/resources/tests/client/requests/index.d.ts +4 -0
  20. package/api/resources/conversationalAi/resources/tests/index.d.ts +3 -0
  21. package/api/resources/conversationalAi/resources/tests/index.js +19 -0
  22. package/api/resources/conversationalAi/resources/tests/resources/index.d.ts +2 -0
  23. package/api/resources/conversationalAi/resources/tests/resources/index.js +41 -0
  24. package/api/resources/conversationalAi/resources/tests/resources/invocations/client/Client.d.ts +63 -0
  25. package/api/resources/conversationalAi/resources/tests/resources/invocations/client/Client.js +201 -0
  26. package/api/resources/conversationalAi/resources/tests/resources/invocations/client/index.d.ts +2 -0
  27. package/{dist/api → api/resources/conversationalAi/resources/tests/resources/invocations}/client/requests/ResubmitTestsRequestModel.d.ts +1 -1
  28. package/api/resources/conversationalAi/resources/tests/resources/invocations/client/requests/index.d.ts +1 -0
  29. package/api/resources/conversationalAi/resources/tests/resources/invocations/index.d.ts +1 -0
  30. package/api/resources/conversationalAi/resources/tests/resources/invocations/index.js +17 -0
  31. package/api/resources/conversationalAi/resources/tests/types/index.d.ts +2 -0
  32. package/api/resources/conversationalAi/resources/tests/types/index.js +18 -0
  33. package/api/types/ClientEvent.d.ts +2 -1
  34. package/api/types/ClientEvent.js +1 -0
  35. package/api/types/FeaturesUsageCommonModel.d.ts +1 -0
  36. package/api/types/TestsFeatureUsageCommonModel.d.ts +8 -0
  37. package/api/types/UnitTestRunResponseModel.d.ts +1 -0
  38. package/api/types/index.d.ts +1 -2
  39. package/api/types/index.js +1 -2
  40. package/dist/Client.d.ts +0 -160
  41. package/dist/Client.js +2 -687
  42. package/dist/api/index.d.ts +0 -1
  43. package/dist/api/index.js +0 -1
  44. package/dist/api/resources/conversationalAi/client/Client.d.ts +3 -0
  45. package/dist/api/resources/conversationalAi/client/Client.js +25 -20
  46. package/dist/api/resources/conversationalAi/resources/agents/client/Client.d.ts +18 -0
  47. package/dist/api/resources/conversationalAi/resources/agents/client/Client.js +80 -0
  48. package/dist/api/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.d.ts +1 -1
  49. package/dist/api/resources/conversationalAi/resources/agents/client/requests/index.d.ts +1 -0
  50. package/dist/api/resources/conversationalAi/resources/index.d.ts +3 -0
  51. package/dist/api/resources/conversationalAi/resources/index.js +4 -1
  52. package/dist/api/resources/conversationalAi/resources/tests/client/Client.d.ts +147 -0
  53. package/dist/api/resources/conversationalAi/resources/tests/client/Client.js +537 -0
  54. package/dist/api/resources/conversationalAi/resources/tests/client/index.d.ts +2 -0
  55. package/{api → dist/api/resources/conversationalAi/resources/tests}/client/requests/CreateUnitTestRequest.d.ts +2 -2
  56. package/dist/api/{client/requests/ListChatResponseTestsRouteRequest.d.ts → resources/conversationalAi/resources/tests/client/requests/TestsListRequest.d.ts} +1 -1
  57. package/dist/api/{client → resources/conversationalAi/resources/tests/client}/requests/UpdateUnitTestRequest.d.ts +2 -2
  58. package/dist/api/resources/conversationalAi/resources/tests/client/requests/index.d.ts +4 -0
  59. package/dist/api/resources/conversationalAi/resources/tests/client/requests/index.js +2 -0
  60. package/dist/api/resources/conversationalAi/resources/tests/index.d.ts +3 -0
  61. package/dist/api/resources/conversationalAi/resources/tests/index.js +19 -0
  62. package/dist/api/resources/conversationalAi/resources/tests/resources/index.d.ts +2 -0
  63. package/dist/api/resources/conversationalAi/resources/tests/resources/index.js +41 -0
  64. package/dist/api/resources/conversationalAi/resources/tests/resources/invocations/client/Client.d.ts +63 -0
  65. package/dist/api/resources/conversationalAi/resources/tests/resources/invocations/client/Client.js +201 -0
  66. package/dist/api/resources/conversationalAi/resources/tests/resources/invocations/client/index.d.ts +2 -0
  67. package/{api → dist/api/resources/conversationalAi/resources/tests/resources/invocations}/client/requests/ResubmitTestsRequestModel.d.ts +1 -1
  68. package/dist/api/resources/conversationalAi/resources/tests/resources/invocations/client/requests/index.d.ts +1 -0
  69. package/dist/api/resources/conversationalAi/resources/tests/resources/invocations/client/requests/index.js +2 -0
  70. package/dist/api/resources/conversationalAi/resources/tests/resources/invocations/index.d.ts +1 -0
  71. package/dist/api/resources/conversationalAi/resources/tests/resources/invocations/index.js +17 -0
  72. package/dist/api/resources/conversationalAi/resources/tests/types/UpdateUnitTestRequestDynamicVariablesValue.js +5 -0
  73. package/dist/api/resources/conversationalAi/resources/tests/types/index.d.ts +2 -0
  74. package/dist/api/resources/conversationalAi/resources/tests/types/index.js +18 -0
  75. package/dist/api/types/ClientEvent.d.ts +2 -1
  76. package/dist/api/types/ClientEvent.js +1 -0
  77. package/dist/api/types/FeaturesUsageCommonModel.d.ts +1 -0
  78. package/dist/api/types/TestsFeatureUsageCommonModel.d.ts +8 -0
  79. package/dist/api/types/TestsFeatureUsageCommonModel.js +5 -0
  80. package/dist/api/types/UnitTestRunResponseModel.d.ts +1 -0
  81. package/dist/api/types/index.d.ts +1 -2
  82. package/dist/api/types/index.js +1 -2
  83. package/dist/serialization/index.d.ts +0 -1
  84. package/dist/serialization/index.js +0 -1
  85. package/dist/serialization/resources/conversationalAi/resources/agents/client/requests/RunAgentTestsRequestModel.d.ts +15 -0
  86. package/dist/serialization/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.js +3 -3
  87. package/dist/serialization/resources/conversationalAi/resources/agents/client/requests/index.d.ts +1 -0
  88. package/dist/serialization/resources/conversationalAi/resources/agents/client/requests/index.js +3 -1
  89. package/dist/serialization/resources/conversationalAi/resources/index.d.ts +3 -0
  90. package/dist/serialization/resources/conversationalAi/resources/index.js +4 -1
  91. package/dist/serialization/resources/conversationalAi/resources/tests/client/index.js +17 -0
  92. package/dist/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/CreateUnitTestRequest.d.ts +8 -8
  93. package/dist/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/CreateUnitTestRequest.js +5 -5
  94. package/dist/serialization/resources/conversationalAi/resources/tests/client/requests/ListTestsByIdsRequestModel.d.ts +12 -0
  95. package/{serialization → dist/serialization/resources/conversationalAi/resources/tests}/client/requests/ListTestsByIdsRequestModel.js +1 -1
  96. package/dist/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/UpdateUnitTestRequest.d.ts +8 -8
  97. package/dist/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/UpdateUnitTestRequest.js +5 -5
  98. package/dist/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/index.d.ts +0 -2
  99. package/{serialization → dist/serialization/resources/conversationalAi/resources/tests}/client/requests/index.js +1 -5
  100. package/dist/serialization/resources/conversationalAi/resources/tests/index.d.ts +3 -0
  101. package/dist/serialization/resources/conversationalAi/resources/tests/index.js +19 -0
  102. package/dist/serialization/resources/conversationalAi/resources/tests/resources/index.d.ts +2 -0
  103. package/dist/serialization/resources/conversationalAi/resources/tests/resources/index.js +41 -0
  104. package/dist/serialization/resources/conversationalAi/resources/tests/resources/invocations/client/index.js +17 -0
  105. package/{serialization → dist/serialization/resources/conversationalAi/resources/tests/resources/invocations}/client/requests/ResubmitTestsRequestModel.d.ts +5 -5
  106. package/{serialization → dist/serialization/resources/conversationalAi/resources/tests/resources/invocations}/client/requests/ResubmitTestsRequestModel.js +2 -2
  107. package/dist/serialization/resources/conversationalAi/resources/tests/resources/invocations/client/requests/index.d.ts +1 -0
  108. package/dist/serialization/resources/conversationalAi/resources/tests/resources/invocations/client/requests/index.js +5 -0
  109. package/dist/serialization/resources/conversationalAi/resources/tests/resources/invocations/index.d.ts +1 -0
  110. package/dist/serialization/resources/conversationalAi/resources/tests/resources/invocations/index.js +17 -0
  111. package/dist/serialization/resources/conversationalAi/resources/tests/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
  112. package/{serialization → dist/serialization/resources/conversationalAi/resources/tests}/types/CreateUnitTestRequestDynamicVariablesValue.js +1 -1
  113. package/dist/serialization/resources/conversationalAi/resources/tests/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
  114. package/{serialization → dist/serialization/resources/conversationalAi/resources/tests}/types/UpdateUnitTestRequestDynamicVariablesValue.js +1 -1
  115. package/dist/serialization/resources/conversationalAi/resources/tests/types/index.d.ts +2 -0
  116. package/dist/serialization/resources/conversationalAi/resources/tests/types/index.js +18 -0
  117. package/dist/serialization/types/ClientEvent.d.ts +1 -1
  118. package/dist/serialization/types/ClientEvent.js +1 -0
  119. package/dist/serialization/types/FeaturesUsageCommonModel.d.ts +2 -0
  120. package/dist/serialization/types/FeaturesUsageCommonModel.js +2 -0
  121. package/dist/serialization/types/TestsFeatureUsageCommonModel.d.ts +14 -0
  122. package/dist/serialization/types/TestsFeatureUsageCommonModel.js +45 -0
  123. package/dist/serialization/types/UnitTestRunResponseModel.d.ts +1 -0
  124. package/dist/serialization/types/UnitTestRunResponseModel.js +1 -0
  125. package/dist/serialization/types/index.d.ts +1 -2
  126. package/dist/serialization/types/index.js +1 -2
  127. package/dist/version.d.ts +1 -1
  128. package/dist/version.js +1 -1
  129. package/package.json +1 -1
  130. package/reference.md +648 -0
  131. package/serialization/index.d.ts +0 -1
  132. package/serialization/index.js +0 -1
  133. package/serialization/resources/conversationalAi/resources/agents/client/requests/RunAgentTestsRequestModel.d.ts +15 -0
  134. package/serialization/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.js +3 -3
  135. package/serialization/resources/conversationalAi/resources/agents/client/requests/index.d.ts +1 -0
  136. package/serialization/resources/conversationalAi/resources/agents/client/requests/index.js +3 -1
  137. package/serialization/resources/conversationalAi/resources/index.d.ts +3 -0
  138. package/serialization/resources/conversationalAi/resources/index.js +4 -1
  139. package/serialization/resources/conversationalAi/resources/tests/client/index.js +17 -0
  140. package/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/CreateUnitTestRequest.d.ts +8 -8
  141. package/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/CreateUnitTestRequest.js +5 -5
  142. package/serialization/resources/conversationalAi/resources/tests/client/requests/ListTestsByIdsRequestModel.d.ts +12 -0
  143. package/{dist/serialization → serialization/resources/conversationalAi/resources/tests}/client/requests/ListTestsByIdsRequestModel.js +1 -1
  144. package/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/UpdateUnitTestRequest.d.ts +8 -8
  145. package/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/UpdateUnitTestRequest.js +5 -5
  146. package/serialization/{client → resources/conversationalAi/resources/tests/client}/requests/index.d.ts +0 -2
  147. package/{dist/serialization → serialization/resources/conversationalAi/resources/tests}/client/requests/index.js +1 -5
  148. package/serialization/resources/conversationalAi/resources/tests/index.d.ts +3 -0
  149. package/serialization/resources/conversationalAi/resources/tests/index.js +19 -0
  150. package/serialization/resources/conversationalAi/resources/tests/resources/index.d.ts +2 -0
  151. package/serialization/resources/conversationalAi/resources/tests/resources/index.js +41 -0
  152. package/serialization/resources/conversationalAi/resources/tests/resources/invocations/client/index.js +17 -0
  153. package/{dist/serialization → serialization/resources/conversationalAi/resources/tests/resources/invocations}/client/requests/ResubmitTestsRequestModel.d.ts +5 -5
  154. package/{dist/serialization → serialization/resources/conversationalAi/resources/tests/resources/invocations}/client/requests/ResubmitTestsRequestModel.js +2 -2
  155. package/serialization/resources/conversationalAi/resources/tests/resources/invocations/client/requests/index.d.ts +1 -0
  156. package/serialization/resources/conversationalAi/resources/tests/resources/invocations/client/requests/index.js +5 -0
  157. package/serialization/resources/conversationalAi/resources/tests/resources/invocations/index.d.ts +1 -0
  158. package/serialization/resources/conversationalAi/resources/tests/resources/invocations/index.js +17 -0
  159. package/serialization/resources/conversationalAi/resources/tests/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
  160. package/{dist/serialization → serialization/resources/conversationalAi/resources/tests}/types/CreateUnitTestRequestDynamicVariablesValue.js +1 -1
  161. package/serialization/resources/conversationalAi/resources/tests/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +10 -0
  162. package/{dist/serialization → serialization/resources/conversationalAi/resources/tests}/types/UpdateUnitTestRequestDynamicVariablesValue.js +1 -1
  163. package/serialization/resources/conversationalAi/resources/tests/types/index.d.ts +2 -0
  164. package/serialization/resources/conversationalAi/resources/tests/types/index.js +18 -0
  165. package/serialization/types/ClientEvent.d.ts +1 -1
  166. package/serialization/types/ClientEvent.js +1 -0
  167. package/serialization/types/FeaturesUsageCommonModel.d.ts +2 -0
  168. package/serialization/types/FeaturesUsageCommonModel.js +2 -0
  169. package/serialization/types/TestsFeatureUsageCommonModel.d.ts +14 -0
  170. package/serialization/types/TestsFeatureUsageCommonModel.js +45 -0
  171. package/serialization/types/UnitTestRunResponseModel.d.ts +1 -0
  172. package/serialization/types/UnitTestRunResponseModel.js +1 -0
  173. package/serialization/types/index.d.ts +1 -2
  174. package/serialization/types/index.js +1 -2
  175. package/version.d.ts +1 -1
  176. package/version.js +1 -1
  177. package/api/client/requests/index.d.ts +0 -6
  178. package/dist/api/client/requests/index.d.ts +0 -6
  179. package/dist/serialization/client/requests/ListTestsByIdsRequestModel.d.ts +0 -12
  180. package/dist/serialization/client/requests/RunAgentTestsRequestModel.d.ts +0 -15
  181. package/dist/serialization/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +0 -10
  182. package/dist/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +0 -10
  183. package/serialization/client/requests/ListTestsByIdsRequestModel.d.ts +0 -12
  184. package/serialization/client/requests/RunAgentTestsRequestModel.d.ts +0 -15
  185. package/serialization/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +0 -10
  186. package/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +0 -10
  187. /package/api/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.js +0 -0
  188. /package/api/{client → resources/conversationalAi/resources/tests/client}/index.js +0 -0
  189. /package/api/{client → resources/conversationalAi/resources/tests/client}/requests/CreateUnitTestRequest.js +0 -0
  190. /package/api/{client → resources/conversationalAi/resources/tests/client}/requests/ListTestsByIdsRequestModel.d.ts +0 -0
  191. /package/api/{client → resources/conversationalAi/resources/tests/client}/requests/ListTestsByIdsRequestModel.js +0 -0
  192. /package/api/{client/requests/ListChatResponseTestsRouteRequest.js → resources/conversationalAi/resources/tests/client/requests/TestsListRequest.js} +0 -0
  193. /package/api/{client → resources/conversationalAi/resources/tests/client}/requests/UpdateUnitTestRequest.js +0 -0
  194. /package/api/{client → resources/conversationalAi/resources/tests/client}/requests/index.js +0 -0
  195. /package/{dist/api → api/resources/conversationalAi/resources/tests/resources/invocations}/client/index.js +0 -0
  196. /package/api/{client → resources/conversationalAi/resources/tests/resources/invocations/client}/requests/ResubmitTestsRequestModel.js +0 -0
  197. /package/{dist/api → api/resources/conversationalAi/resources/tests/resources/invocations}/client/requests/index.js +0 -0
  198. /package/api/{types → resources/conversationalAi/resources/tests/types}/CreateUnitTestRequestDynamicVariablesValue.d.ts +0 -0
  199. /package/api/{types → resources/conversationalAi/resources/tests/types}/CreateUnitTestRequestDynamicVariablesValue.js +0 -0
  200. /package/api/{types → resources/conversationalAi/resources/tests/types}/UpdateUnitTestRequestDynamicVariablesValue.d.ts +0 -0
  201. /package/api/{types → resources/conversationalAi/resources/tests/types}/UpdateUnitTestRequestDynamicVariablesValue.js +0 -0
  202. /package/{dist/api/client/requests/CreateUnitTestRequest.js → api/types/TestsFeatureUsageCommonModel.js} +0 -0
  203. /package/dist/api/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.js +0 -0
  204. /package/dist/{serialization → api/resources/conversationalAi/resources/tests}/client/index.js +0 -0
  205. /package/dist/api/{client/requests/ListChatResponseTestsRouteRequest.js → resources/conversationalAi/resources/tests/client/requests/CreateUnitTestRequest.js} +0 -0
  206. /package/dist/api/{client → resources/conversationalAi/resources/tests/client}/requests/ListTestsByIdsRequestModel.d.ts +0 -0
  207. /package/dist/api/{client → resources/conversationalAi/resources/tests/client}/requests/ListTestsByIdsRequestModel.js +0 -0
  208. /package/dist/api/{client/requests/ResubmitTestsRequestModel.js → resources/conversationalAi/resources/tests/client/requests/TestsListRequest.js} +0 -0
  209. /package/dist/api/{client → resources/conversationalAi/resources/tests/client}/requests/UpdateUnitTestRequest.js +0 -0
  210. /package/{serialization → dist/api/resources/conversationalAi/resources/tests/resources/invocations}/client/index.js +0 -0
  211. /package/dist/api/{types/CreateUnitTestRequestDynamicVariablesValue.js → resources/conversationalAi/resources/tests/resources/invocations/client/requests/ResubmitTestsRequestModel.js} +0 -0
  212. /package/dist/api/{types → resources/conversationalAi/resources/tests/types}/CreateUnitTestRequestDynamicVariablesValue.d.ts +0 -0
  213. /package/dist/api/{types/UpdateUnitTestRequestDynamicVariablesValue.js → resources/conversationalAi/resources/tests/types/CreateUnitTestRequestDynamicVariablesValue.js} +0 -0
  214. /package/dist/api/{types → resources/conversationalAi/resources/tests/types}/UpdateUnitTestRequestDynamicVariablesValue.d.ts +0 -0
  215. /package/{api → dist/serialization/resources/conversationalAi/resources/tests}/client/index.d.ts +0 -0
  216. /package/dist/{api → serialization/resources/conversationalAi/resources/tests/resources/invocations}/client/index.d.ts +0 -0
  217. /package/{dist/serialization → serialization/resources/conversationalAi/resources/tests}/client/index.d.ts +0 -0
  218. /package/serialization/{client → resources/conversationalAi/resources/tests/resources/invocations/client}/index.d.ts +0 -0
@@ -0,0 +1,537 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
+ return new (P || (P = Promise))(function (resolve, reject) {
41
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
45
+ });
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.Tests = void 0;
49
+ const environments = __importStar(require("../../../../../../environments"));
50
+ const core = __importStar(require("../../../../../../core"));
51
+ const ElevenLabs = __importStar(require("../../../../../index"));
52
+ const headers_1 = require("../../../../../../core/headers");
53
+ const serializers = __importStar(require("../../../../../../serialization/index"));
54
+ const errors = __importStar(require("../../../../../../errors/index"));
55
+ const Client_1 = require("../resources/invocations/client/Client");
56
+ class Tests {
57
+ constructor(_options = {}) {
58
+ this._options = _options;
59
+ }
60
+ get invocations() {
61
+ var _a;
62
+ return ((_a = this._invocations) !== null && _a !== void 0 ? _a : (this._invocations = new Client_1.Invocations(this._options)));
63
+ }
64
+ /**
65
+ * Creates a new agent response test.
66
+ *
67
+ * @param {ElevenLabs.conversationalAi.CreateUnitTestRequest} request
68
+ * @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
69
+ *
70
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
71
+ *
72
+ * @example
73
+ * await client.conversationalAi.tests.create({
74
+ * chatHistory: [{
75
+ * role: "user",
76
+ * timeInCallSecs: 1
77
+ * }],
78
+ * successCondition: "success_condition",
79
+ * successExamples: [{
80
+ * response: "response",
81
+ * type: "success"
82
+ * }],
83
+ * failureExamples: [{
84
+ * response: "response",
85
+ * type: "failure"
86
+ * }],
87
+ * name: "name"
88
+ * })
89
+ */
90
+ create(request, requestOptions) {
91
+ return core.HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
92
+ }
93
+ __create(request, requestOptions) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ var _a, _b, _c;
96
+ const _response = yield core.fetcher({
97
+ 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"),
98
+ method: "POST",
99
+ 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),
100
+ contentType: "application/json",
101
+ requestType: "json",
102
+ body: serializers.conversationalAi.CreateUnitTestRequest.jsonOrThrow(request, {
103
+ unrecognizedObjectKeys: "strip",
104
+ }),
105
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
106
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
107
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
108
+ });
109
+ if (_response.ok) {
110
+ return {
111
+ data: serializers.CreateUnitTestResponseModel.parseOrThrow(_response.body, {
112
+ unrecognizedObjectKeys: "passthrough",
113
+ allowUnrecognizedUnionMembers: true,
114
+ allowUnrecognizedEnumValues: true,
115
+ breadcrumbsPrefix: ["response"],
116
+ }),
117
+ rawResponse: _response.rawResponse,
118
+ };
119
+ }
120
+ if (_response.error.reason === "status-code") {
121
+ switch (_response.error.statusCode) {
122
+ case 422:
123
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
124
+ unrecognizedObjectKeys: "passthrough",
125
+ allowUnrecognizedUnionMembers: true,
126
+ allowUnrecognizedEnumValues: true,
127
+ breadcrumbsPrefix: ["response"],
128
+ }), _response.rawResponse);
129
+ default:
130
+ throw new errors.ElevenLabsError({
131
+ statusCode: _response.error.statusCode,
132
+ body: _response.error.body,
133
+ rawResponse: _response.rawResponse,
134
+ });
135
+ }
136
+ }
137
+ switch (_response.error.reason) {
138
+ case "non-json":
139
+ throw new errors.ElevenLabsError({
140
+ statusCode: _response.error.statusCode,
141
+ body: _response.error.rawBody,
142
+ rawResponse: _response.rawResponse,
143
+ });
144
+ case "timeout":
145
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agent-testing/create.");
146
+ case "unknown":
147
+ throw new errors.ElevenLabsError({
148
+ message: _response.error.errorMessage,
149
+ rawResponse: _response.rawResponse,
150
+ });
151
+ }
152
+ });
153
+ }
154
+ /**
155
+ * Gets an agent response test by ID.
156
+ *
157
+ * @param {string} testId - The id of a chat response test. This is returned on test creation.
158
+ * @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
159
+ *
160
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
161
+ *
162
+ * @example
163
+ * await client.conversationalAi.tests.get("TeaqRRdTcIfIu2i7BYfT")
164
+ */
165
+ get(testId, requestOptions) {
166
+ return core.HttpResponsePromise.fromPromise(this.__get(testId, requestOptions));
167
+ }
168
+ __get(testId, requestOptions) {
169
+ return __awaiter(this, void 0, void 0, function* () {
170
+ var _a, _b, _c;
171
+ const _response = yield core.fetcher({
172
+ 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)}`),
173
+ method: "GET",
174
+ 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),
175
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
176
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
177
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
178
+ });
179
+ if (_response.ok) {
180
+ return {
181
+ data: serializers.GetUnitTestResponseModel.parseOrThrow(_response.body, {
182
+ unrecognizedObjectKeys: "passthrough",
183
+ allowUnrecognizedUnionMembers: true,
184
+ allowUnrecognizedEnumValues: true,
185
+ breadcrumbsPrefix: ["response"],
186
+ }),
187
+ rawResponse: _response.rawResponse,
188
+ };
189
+ }
190
+ if (_response.error.reason === "status-code") {
191
+ switch (_response.error.statusCode) {
192
+ case 422:
193
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
194
+ unrecognizedObjectKeys: "passthrough",
195
+ allowUnrecognizedUnionMembers: true,
196
+ allowUnrecognizedEnumValues: true,
197
+ breadcrumbsPrefix: ["response"],
198
+ }), _response.rawResponse);
199
+ default:
200
+ throw new errors.ElevenLabsError({
201
+ statusCode: _response.error.statusCode,
202
+ body: _response.error.body,
203
+ rawResponse: _response.rawResponse,
204
+ });
205
+ }
206
+ }
207
+ switch (_response.error.reason) {
208
+ case "non-json":
209
+ throw new errors.ElevenLabsError({
210
+ statusCode: _response.error.statusCode,
211
+ body: _response.error.rawBody,
212
+ rawResponse: _response.rawResponse,
213
+ });
214
+ case "timeout":
215
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/agent-testing/{test_id}.");
216
+ case "unknown":
217
+ throw new errors.ElevenLabsError({
218
+ message: _response.error.errorMessage,
219
+ rawResponse: _response.rawResponse,
220
+ });
221
+ }
222
+ });
223
+ }
224
+ /**
225
+ * Updates an agent response test by ID.
226
+ *
227
+ * @param {string} testId - The id of a chat response test. This is returned on test creation.
228
+ * @param {ElevenLabs.conversationalAi.UpdateUnitTestRequest} request
229
+ * @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
230
+ *
231
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
232
+ *
233
+ * @example
234
+ * await client.conversationalAi.tests.update("TeaqRRdTcIfIu2i7BYfT", {
235
+ * chatHistory: [{
236
+ * role: "user",
237
+ * timeInCallSecs: 1
238
+ * }],
239
+ * successCondition: "success_condition",
240
+ * successExamples: [{
241
+ * response: "response",
242
+ * type: "success"
243
+ * }],
244
+ * failureExamples: [{
245
+ * response: "response",
246
+ * type: "failure"
247
+ * }],
248
+ * name: "name"
249
+ * })
250
+ */
251
+ update(testId, request, requestOptions) {
252
+ return core.HttpResponsePromise.fromPromise(this.__update(testId, request, requestOptions));
253
+ }
254
+ __update(testId, request, requestOptions) {
255
+ return __awaiter(this, void 0, void 0, function* () {
256
+ var _a, _b, _c;
257
+ const _response = yield core.fetcher({
258
+ 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)}`),
259
+ method: "PUT",
260
+ 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),
261
+ contentType: "application/json",
262
+ requestType: "json",
263
+ body: serializers.conversationalAi.UpdateUnitTestRequest.jsonOrThrow(request, {
264
+ unrecognizedObjectKeys: "strip",
265
+ }),
266
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
267
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
268
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
269
+ });
270
+ if (_response.ok) {
271
+ return {
272
+ data: serializers.GetUnitTestResponseModel.parseOrThrow(_response.body, {
273
+ unrecognizedObjectKeys: "passthrough",
274
+ allowUnrecognizedUnionMembers: true,
275
+ allowUnrecognizedEnumValues: true,
276
+ breadcrumbsPrefix: ["response"],
277
+ }),
278
+ rawResponse: _response.rawResponse,
279
+ };
280
+ }
281
+ if (_response.error.reason === "status-code") {
282
+ switch (_response.error.statusCode) {
283
+ case 422:
284
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
285
+ unrecognizedObjectKeys: "passthrough",
286
+ allowUnrecognizedUnionMembers: true,
287
+ allowUnrecognizedEnumValues: true,
288
+ breadcrumbsPrefix: ["response"],
289
+ }), _response.rawResponse);
290
+ default:
291
+ throw new errors.ElevenLabsError({
292
+ statusCode: _response.error.statusCode,
293
+ body: _response.error.body,
294
+ rawResponse: _response.rawResponse,
295
+ });
296
+ }
297
+ }
298
+ switch (_response.error.reason) {
299
+ case "non-json":
300
+ throw new errors.ElevenLabsError({
301
+ statusCode: _response.error.statusCode,
302
+ body: _response.error.rawBody,
303
+ rawResponse: _response.rawResponse,
304
+ });
305
+ case "timeout":
306
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling PUT /v1/convai/agent-testing/{test_id}.");
307
+ case "unknown":
308
+ throw new errors.ElevenLabsError({
309
+ message: _response.error.errorMessage,
310
+ rawResponse: _response.rawResponse,
311
+ });
312
+ }
313
+ });
314
+ }
315
+ /**
316
+ * Deletes an agent response test by ID.
317
+ *
318
+ * @param {string} testId - The id of a chat response test. This is returned on test creation.
319
+ * @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
320
+ *
321
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
322
+ *
323
+ * @example
324
+ * await client.conversationalAi.tests.delete("TeaqRRdTcIfIu2i7BYfT")
325
+ */
326
+ delete(testId, requestOptions) {
327
+ return core.HttpResponsePromise.fromPromise(this.__delete(testId, requestOptions));
328
+ }
329
+ __delete(testId, requestOptions) {
330
+ return __awaiter(this, void 0, void 0, function* () {
331
+ var _a, _b, _c;
332
+ const _response = yield core.fetcher({
333
+ 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)}`),
334
+ method: "DELETE",
335
+ 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),
336
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
337
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
338
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
339
+ });
340
+ if (_response.ok) {
341
+ return { data: _response.body, rawResponse: _response.rawResponse };
342
+ }
343
+ if (_response.error.reason === "status-code") {
344
+ switch (_response.error.statusCode) {
345
+ case 422:
346
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
347
+ unrecognizedObjectKeys: "passthrough",
348
+ allowUnrecognizedUnionMembers: true,
349
+ allowUnrecognizedEnumValues: true,
350
+ breadcrumbsPrefix: ["response"],
351
+ }), _response.rawResponse);
352
+ default:
353
+ throw new errors.ElevenLabsError({
354
+ statusCode: _response.error.statusCode,
355
+ body: _response.error.body,
356
+ rawResponse: _response.rawResponse,
357
+ });
358
+ }
359
+ }
360
+ switch (_response.error.reason) {
361
+ case "non-json":
362
+ throw new errors.ElevenLabsError({
363
+ statusCode: _response.error.statusCode,
364
+ body: _response.error.rawBody,
365
+ rawResponse: _response.rawResponse,
366
+ });
367
+ case "timeout":
368
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling DELETE /v1/convai/agent-testing/{test_id}.");
369
+ case "unknown":
370
+ throw new errors.ElevenLabsError({
371
+ message: _response.error.errorMessage,
372
+ rawResponse: _response.rawResponse,
373
+ });
374
+ }
375
+ });
376
+ }
377
+ /**
378
+ * Gets multiple agent response tests by their IDs. Returns a dictionary mapping test IDs to test summaries.
379
+ *
380
+ * @param {ElevenLabs.conversationalAi.ListTestsByIdsRequestModel} request
381
+ * @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
382
+ *
383
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
384
+ *
385
+ * @example
386
+ * await client.conversationalAi.tests.summaries({
387
+ * testIds: ["test_id_1", "test_id_2"]
388
+ * })
389
+ */
390
+ summaries(request, requestOptions) {
391
+ return core.HttpResponsePromise.fromPromise(this.__summaries(request, requestOptions));
392
+ }
393
+ __summaries(request, requestOptions) {
394
+ return __awaiter(this, void 0, void 0, function* () {
395
+ var _a, _b, _c;
396
+ const _response = yield core.fetcher({
397
+ 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"),
398
+ method: "POST",
399
+ 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),
400
+ contentType: "application/json",
401
+ requestType: "json",
402
+ body: serializers.conversationalAi.ListTestsByIdsRequestModel.jsonOrThrow(request, {
403
+ unrecognizedObjectKeys: "strip",
404
+ }),
405
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
406
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
407
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
408
+ });
409
+ if (_response.ok) {
410
+ return {
411
+ data: serializers.GetTestsSummariesByIdsResponseModel.parseOrThrow(_response.body, {
412
+ unrecognizedObjectKeys: "passthrough",
413
+ allowUnrecognizedUnionMembers: true,
414
+ allowUnrecognizedEnumValues: true,
415
+ breadcrumbsPrefix: ["response"],
416
+ }),
417
+ rawResponse: _response.rawResponse,
418
+ };
419
+ }
420
+ if (_response.error.reason === "status-code") {
421
+ switch (_response.error.statusCode) {
422
+ case 422:
423
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
424
+ unrecognizedObjectKeys: "passthrough",
425
+ allowUnrecognizedUnionMembers: true,
426
+ allowUnrecognizedEnumValues: true,
427
+ breadcrumbsPrefix: ["response"],
428
+ }), _response.rawResponse);
429
+ default:
430
+ throw new errors.ElevenLabsError({
431
+ statusCode: _response.error.statusCode,
432
+ body: _response.error.body,
433
+ rawResponse: _response.rawResponse,
434
+ });
435
+ }
436
+ }
437
+ switch (_response.error.reason) {
438
+ case "non-json":
439
+ throw new errors.ElevenLabsError({
440
+ statusCode: _response.error.statusCode,
441
+ body: _response.error.rawBody,
442
+ rawResponse: _response.rawResponse,
443
+ });
444
+ case "timeout":
445
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agent-testing/summaries.");
446
+ case "unknown":
447
+ throw new errors.ElevenLabsError({
448
+ message: _response.error.errorMessage,
449
+ rawResponse: _response.rawResponse,
450
+ });
451
+ }
452
+ });
453
+ }
454
+ /**
455
+ * Lists all agent response tests with pagination support and optional search filtering.
456
+ *
457
+ * @param {ElevenLabs.conversationalAi.TestsListRequest} request
458
+ * @param {Tests.RequestOptions} requestOptions - Request-specific configuration.
459
+ *
460
+ * @throws {@link ElevenLabs.UnprocessableEntityError}
461
+ *
462
+ * @example
463
+ * await client.conversationalAi.tests.list()
464
+ */
465
+ list(request = {}, requestOptions) {
466
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
467
+ }
468
+ __list() {
469
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
470
+ var _a, _b, _c;
471
+ const { cursor, pageSize, search } = request;
472
+ const _queryParams = {};
473
+ if (cursor != null) {
474
+ _queryParams["cursor"] = cursor;
475
+ }
476
+ if (pageSize != null) {
477
+ _queryParams["page_size"] = pageSize.toString();
478
+ }
479
+ if (search != null) {
480
+ _queryParams["search"] = search;
481
+ }
482
+ const _response = yield core.fetcher({
483
+ 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"),
484
+ method: "GET",
485
+ 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),
486
+ queryParameters: _queryParams,
487
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
488
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
489
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
490
+ });
491
+ if (_response.ok) {
492
+ return {
493
+ data: serializers.GetTestsPageResponseModel.parseOrThrow(_response.body, {
494
+ unrecognizedObjectKeys: "passthrough",
495
+ allowUnrecognizedUnionMembers: true,
496
+ allowUnrecognizedEnumValues: true,
497
+ breadcrumbsPrefix: ["response"],
498
+ }),
499
+ rawResponse: _response.rawResponse,
500
+ };
501
+ }
502
+ if (_response.error.reason === "status-code") {
503
+ switch (_response.error.statusCode) {
504
+ case 422:
505
+ throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
506
+ unrecognizedObjectKeys: "passthrough",
507
+ allowUnrecognizedUnionMembers: true,
508
+ allowUnrecognizedEnumValues: true,
509
+ breadcrumbsPrefix: ["response"],
510
+ }), _response.rawResponse);
511
+ default:
512
+ throw new errors.ElevenLabsError({
513
+ statusCode: _response.error.statusCode,
514
+ body: _response.error.body,
515
+ rawResponse: _response.rawResponse,
516
+ });
517
+ }
518
+ }
519
+ switch (_response.error.reason) {
520
+ case "non-json":
521
+ throw new errors.ElevenLabsError({
522
+ statusCode: _response.error.statusCode,
523
+ body: _response.error.rawBody,
524
+ rawResponse: _response.rawResponse,
525
+ });
526
+ case "timeout":
527
+ throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling GET /v1/convai/agent-testing.");
528
+ case "unknown":
529
+ throw new errors.ElevenLabsError({
530
+ message: _response.error.errorMessage,
531
+ rawResponse: _response.rawResponse,
532
+ });
533
+ }
534
+ });
535
+ }
536
+ }
537
+ exports.Tests = Tests;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as ElevenLabs from "../../index";
4
+ import * as ElevenLabs from "../../../../../../index";
5
5
  /**
6
6
  * @example
7
7
  * {
@@ -32,6 +32,6 @@ export interface CreateUnitTestRequest {
32
32
  /** How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. */
33
33
  toolCallParameters?: ElevenLabs.UnitTestToolCallEvaluationModelInput;
34
34
  /** Dynamic variables to replace in the agent config during testing */
35
- dynamicVariables?: Record<string, ElevenLabs.CreateUnitTestRequestDynamicVariablesValue | undefined>;
35
+ dynamicVariables?: Record<string, ElevenLabs.conversationalAi.CreateUnitTestRequestDynamicVariablesValue | undefined>;
36
36
  name: string;
37
37
  }
@@ -5,7 +5,7 @@
5
5
  * @example
6
6
  * {}
7
7
  */
8
- export interface ListChatResponseTestsRouteRequest {
8
+ export interface TestsListRequest {
9
9
  /**
10
10
  * Used for fetching next page. Cursor is returned in the response.
11
11
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- import * as ElevenLabs from "../../index";
4
+ import * as ElevenLabs from "../../../../../../index";
5
5
  /**
6
6
  * @example
7
7
  * {
@@ -32,6 +32,6 @@ export interface UpdateUnitTestRequest {
32
32
  /** How to evaluate the agent's tool call (if any). If empty, the tool call is not evaluated. */
33
33
  toolCallParameters?: ElevenLabs.UnitTestToolCallEvaluationModelInput;
34
34
  /** Dynamic variables to replace in the agent config during testing */
35
- dynamicVariables?: Record<string, ElevenLabs.UpdateUnitTestRequestDynamicVariablesValue | undefined>;
35
+ dynamicVariables?: Record<string, ElevenLabs.conversationalAi.UpdateUnitTestRequestDynamicVariablesValue | undefined>;
36
36
  name: string;
37
37
  }
@@ -0,0 +1,4 @@
1
+ export { type CreateUnitTestRequest } from "./CreateUnitTestRequest";
2
+ export { type UpdateUnitTestRequest } from "./UpdateUnitTestRequest";
3
+ export { type ListTestsByIdsRequestModel } from "./ListTestsByIdsRequestModel";
4
+ export { type TestsListRequest } from "./TestsListRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export * from "./client";
3
+ export * from "./resources";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
18
+ __exportStar(require("./client"), exports);
19
+ __exportStar(require("./resources"), exports);
@@ -0,0 +1,2 @@
1
+ export * as invocations from "./invocations";
2
+ export * from "./invocations/client/requests";