mavenagi 0.0.0-alpha.2 → 0.0.0-alpha.3

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 (274) hide show
  1. package/Client.d.ts +6 -0
  2. package/Client.js +10 -0
  3. package/README.md +11 -11
  4. package/api/resources/action/client/Client.d.ts +78 -0
  5. package/api/resources/action/client/Client.js +304 -0
  6. package/api/resources/action/client/index.d.ts +1 -0
  7. package/api/resources/action/client/index.js +1 -0
  8. package/api/resources/action/index.d.ts +2 -0
  9. package/api/resources/action/index.js +2 -0
  10. package/api/resources/action/types/Action.d.ts +23 -0
  11. package/api/resources/action/types/ActionParameter.d.ts +8 -0
  12. package/api/resources/action/types/index.d.ts +2 -0
  13. package/api/resources/action/types/index.js +2 -0
  14. package/api/resources/actionSet/client/Client.d.ts +71 -0
  15. package/api/resources/actionSet/client/Client.js +297 -0
  16. package/api/resources/actionSet/client/index.d.ts +1 -0
  17. package/api/resources/actionSet/client/index.js +1 -0
  18. package/api/resources/actionSet/index.d.ts +2 -0
  19. package/api/resources/actionSet/index.js +2 -0
  20. package/api/resources/actionSet/types/ActionSetBase.d.ts +9 -0
  21. package/{dist/api/resources/knowledge/types/IdBody.d.ts → api/resources/actionSet/types/ActionSetBase.js} +1 -3
  22. package/api/resources/actionSet/types/ActionSetRequest.d.ts +6 -0
  23. package/api/resources/{knowledge/types/IdBody.d.ts → actionSet/types/ActionSetRequest.js} +1 -3
  24. package/api/resources/actionSet/types/ActionSetResponse.d.ts +8 -0
  25. package/api/resources/actionSet/types/ActionSetResponse.js +4 -0
  26. package/api/resources/actionSet/types/index.d.ts +3 -0
  27. package/api/resources/actionSet/types/index.js +3 -0
  28. package/api/resources/commons/errors/{AgentNotFoundError.d.ts → BadRequestError.d.ts} +1 -1
  29. package/api/resources/{conversation/errors/EmptyConversationError.js → commons/errors/BadRequestError.js} +3 -3
  30. package/{dist/api/resources/commons/errors/AgentNotFoundError.d.ts → api/resources/commons/errors/NotFoundError.d.ts} +1 -1
  31. package/{dist/api/resources/commons/errors/AgentNotFoundError.js → api/resources/commons/errors/NotFoundError.js} +3 -3
  32. package/{dist/api/resources/conversation/errors/EmptyConversationError.d.ts → api/resources/commons/errors/ServerError.d.ts} +1 -1
  33. package/api/resources/commons/errors/ServerError.js +14 -0
  34. package/api/resources/commons/errors/index.d.ts +3 -1
  35. package/api/resources/commons/errors/index.js +3 -1
  36. package/api/resources/commons/types/Feedback.d.ts +16 -0
  37. package/api/resources/commons/types/Feedback.js +4 -0
  38. package/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
  39. package/{dist/api/resources/conversation → api/resources/commons}/types/FeedbackType.js +2 -0
  40. package/api/resources/commons/types/User.d.ts +1 -0
  41. package/api/resources/commons/types/index.d.ts +2 -0
  42. package/api/resources/commons/types/index.js +2 -0
  43. package/api/resources/conversation/client/Client.d.ts +61 -29
  44. package/api/resources/conversation/client/Client.js +215 -109
  45. package/api/resources/conversation/index.d.ts +0 -1
  46. package/api/resources/conversation/index.js +0 -1
  47. package/api/resources/conversation/types/ActionExecutionRequest.d.ts +10 -0
  48. package/api/resources/conversation/types/ActionExecutionRequest.js +4 -0
  49. package/api/resources/conversation/types/ActionExecutionResponse.d.ts +7 -0
  50. package/api/resources/conversation/types/ActionExecutionResponse.js +4 -0
  51. package/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  52. package/api/resources/conversation/types/FeedbackRequest.d.ts +1 -8
  53. package/api/resources/conversation/types/UserMessage.d.ts +1 -0
  54. package/api/resources/conversation/types/index.d.ts +2 -1
  55. package/api/resources/conversation/types/index.js +2 -1
  56. package/api/resources/index.d.ts +4 -2
  57. package/api/resources/index.js +4 -2
  58. package/api/resources/knowledge/client/Client.d.ts +30 -34
  59. package/api/resources/knowledge/client/Client.js +94 -121
  60. package/api/resources/knowledge/index.d.ts +0 -1
  61. package/api/resources/knowledge/index.js +0 -1
  62. package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +1 -1
  63. package/api/resources/knowledge/types/KnowledgeDocument.d.ts +1 -1
  64. package/api/resources/knowledge/types/index.d.ts +0 -1
  65. package/api/resources/knowledge/types/index.js +0 -1
  66. package/core/index.d.ts +1 -1
  67. package/core/index.js +1 -1
  68. package/dist/Client.d.ts +6 -0
  69. package/dist/Client.js +10 -0
  70. package/dist/api/resources/action/client/Client.d.ts +78 -0
  71. package/dist/api/resources/action/client/Client.js +304 -0
  72. package/dist/api/resources/action/client/index.d.ts +1 -0
  73. package/dist/api/resources/action/client/index.js +1 -0
  74. package/dist/api/resources/action/index.d.ts +2 -0
  75. package/dist/api/resources/action/index.js +2 -0
  76. package/dist/api/resources/action/types/Action.d.ts +23 -0
  77. package/dist/api/resources/action/types/Action.js +4 -0
  78. package/dist/api/resources/action/types/ActionParameter.d.ts +8 -0
  79. package/dist/api/resources/action/types/ActionParameter.js +4 -0
  80. package/dist/api/resources/action/types/index.d.ts +2 -0
  81. package/dist/api/resources/action/types/index.js +2 -0
  82. package/dist/api/resources/actionSet/client/Client.d.ts +71 -0
  83. package/dist/api/resources/actionSet/client/Client.js +297 -0
  84. package/dist/api/resources/actionSet/client/index.d.ts +1 -0
  85. package/dist/api/resources/actionSet/client/index.js +1 -0
  86. package/dist/api/resources/actionSet/index.d.ts +2 -0
  87. package/dist/api/resources/actionSet/index.js +2 -0
  88. package/dist/api/resources/actionSet/types/ActionSetBase.d.ts +9 -0
  89. package/dist/api/resources/actionSet/types/ActionSetBase.js +4 -0
  90. package/dist/api/resources/actionSet/types/ActionSetRequest.d.ts +6 -0
  91. package/dist/api/resources/actionSet/types/ActionSetRequest.js +4 -0
  92. package/dist/api/resources/actionSet/types/ActionSetResponse.d.ts +8 -0
  93. package/dist/api/resources/actionSet/types/ActionSetResponse.js +4 -0
  94. package/dist/api/resources/actionSet/types/index.d.ts +3 -0
  95. package/dist/api/resources/actionSet/types/index.js +3 -0
  96. package/{api/resources/conversation/errors/EmptyConversationError.d.ts → dist/api/resources/commons/errors/BadRequestError.d.ts} +1 -1
  97. package/dist/api/resources/{knowledge/errors/VersionInProgressError.js → commons/errors/BadRequestError.js} +3 -3
  98. package/dist/api/resources/commons/errors/NotFoundError.d.ts +8 -0
  99. package/{api/resources/commons/errors/AgentNotFoundError.js → dist/api/resources/commons/errors/NotFoundError.js} +3 -3
  100. package/dist/api/resources/commons/errors/ServerError.d.ts +8 -0
  101. package/dist/api/resources/commons/errors/ServerError.js +14 -0
  102. package/dist/api/resources/commons/errors/index.d.ts +3 -1
  103. package/dist/api/resources/commons/errors/index.js +3 -1
  104. package/dist/api/resources/commons/types/Feedback.d.ts +16 -0
  105. package/dist/api/resources/commons/types/Feedback.js +4 -0
  106. package/dist/api/resources/{conversation → commons}/types/FeedbackType.d.ts +3 -1
  107. package/{api/resources/conversation → dist/api/resources/commons}/types/FeedbackType.js +2 -0
  108. package/dist/api/resources/commons/types/User.d.ts +1 -0
  109. package/dist/api/resources/commons/types/index.d.ts +2 -0
  110. package/dist/api/resources/commons/types/index.js +2 -0
  111. package/dist/api/resources/conversation/client/Client.d.ts +61 -29
  112. package/dist/api/resources/conversation/client/Client.js +215 -109
  113. package/dist/api/resources/conversation/index.d.ts +0 -1
  114. package/dist/api/resources/conversation/index.js +0 -1
  115. package/dist/api/resources/conversation/types/ActionExecutionRequest.d.ts +10 -0
  116. package/dist/api/resources/conversation/types/ActionExecutionRequest.js +4 -0
  117. package/dist/api/resources/conversation/types/ActionExecutionResponse.d.ts +7 -0
  118. package/dist/api/resources/conversation/types/ActionExecutionResponse.js +4 -0
  119. package/dist/api/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  120. package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +1 -8
  121. package/dist/api/resources/conversation/types/UserMessage.d.ts +1 -0
  122. package/dist/api/resources/conversation/types/index.d.ts +2 -1
  123. package/dist/api/resources/conversation/types/index.js +2 -1
  124. package/dist/api/resources/index.d.ts +4 -2
  125. package/dist/api/resources/index.js +4 -2
  126. package/dist/api/resources/knowledge/client/Client.d.ts +30 -34
  127. package/dist/api/resources/knowledge/client/Client.js +94 -121
  128. package/dist/api/resources/knowledge/index.d.ts +0 -1
  129. package/dist/api/resources/knowledge/index.js +0 -1
  130. package/dist/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +1 -1
  131. package/dist/api/resources/knowledge/types/KnowledgeDocument.d.ts +1 -1
  132. package/dist/api/resources/knowledge/types/index.d.ts +0 -1
  133. package/dist/api/resources/knowledge/types/index.js +0 -1
  134. package/dist/core/index.d.ts +1 -1
  135. package/dist/core/index.js +1 -1
  136. package/dist/serialization/resources/action/index.d.ts +1 -0
  137. package/dist/serialization/resources/action/index.js +1 -0
  138. package/dist/serialization/resources/action/types/Action.d.ts +21 -0
  139. package/dist/serialization/resources/action/types/Action.js +16 -0
  140. package/dist/serialization/resources/action/types/ActionParameter.d.ts +14 -0
  141. package/dist/serialization/resources/action/types/ActionParameter.js +9 -0
  142. package/dist/serialization/resources/action/types/index.d.ts +2 -0
  143. package/dist/serialization/resources/action/types/index.js +2 -0
  144. package/dist/serialization/resources/actionSet/index.d.ts +1 -0
  145. package/dist/serialization/resources/actionSet/index.js +1 -0
  146. package/dist/serialization/resources/{knowledge/types/IdBody.d.ts → actionSet/types/ActionSetBase.d.ts} +4 -3
  147. package/dist/serialization/resources/actionSet/types/ActionSetBase.js +8 -0
  148. package/dist/serialization/resources/actionSet/types/ActionSetRequest.d.ts +12 -0
  149. package/dist/serialization/resources/actionSet/types/ActionSetRequest.js +6 -0
  150. package/dist/serialization/resources/actionSet/types/ActionSetResponse.d.ts +14 -0
  151. package/dist/serialization/resources/actionSet/types/ActionSetResponse.js +11 -0
  152. package/dist/serialization/resources/actionSet/types/index.d.ts +3 -0
  153. package/dist/serialization/resources/actionSet/types/index.js +3 -0
  154. package/dist/serialization/resources/commons/types/Feedback.d.ts +17 -0
  155. package/dist/serialization/resources/commons/types/Feedback.js +12 -0
  156. package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.d.ts +1 -1
  157. package/dist/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
  158. package/dist/serialization/resources/commons/types/User.d.ts +1 -0
  159. package/dist/serialization/resources/commons/types/User.js +1 -0
  160. package/dist/serialization/resources/commons/types/index.d.ts +2 -0
  161. package/dist/serialization/resources/commons/types/index.js +2 -0
  162. package/dist/serialization/resources/conversation/types/ActionExecutionRequest.d.ts +15 -0
  163. package/dist/serialization/resources/conversation/types/ActionExecutionRequest.js +10 -0
  164. package/dist/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +12 -0
  165. package/dist/serialization/resources/{knowledge/types/IdBody.js → conversation/types/ActionExecutionResponse.js} +2 -2
  166. package/dist/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  167. package/dist/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
  168. package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +2 -6
  169. package/dist/serialization/resources/conversation/types/FeedbackRequest.js +2 -7
  170. package/dist/serialization/resources/conversation/types/index.d.ts +2 -1
  171. package/dist/serialization/resources/conversation/types/index.js +2 -1
  172. package/dist/serialization/resources/index.d.ts +4 -0
  173. package/dist/serialization/resources/index.js +4 -0
  174. package/dist/serialization/resources/knowledge/types/index.d.ts +0 -1
  175. package/dist/serialization/resources/knowledge/types/index.js +0 -1
  176. package/package.json +1 -1
  177. package/serialization/resources/action/index.d.ts +1 -0
  178. package/serialization/resources/action/index.js +1 -0
  179. package/serialization/resources/action/types/Action.d.ts +21 -0
  180. package/serialization/resources/action/types/Action.js +16 -0
  181. package/serialization/resources/action/types/ActionParameter.d.ts +14 -0
  182. package/serialization/resources/action/types/ActionParameter.js +9 -0
  183. package/serialization/resources/action/types/index.d.ts +2 -0
  184. package/serialization/resources/action/types/index.js +2 -0
  185. package/serialization/resources/actionSet/index.d.ts +1 -0
  186. package/serialization/resources/actionSet/index.js +1 -0
  187. package/serialization/resources/{knowledge/types/IdBody.d.ts → actionSet/types/ActionSetBase.d.ts} +4 -3
  188. package/serialization/resources/actionSet/types/ActionSetBase.js +8 -0
  189. package/serialization/resources/actionSet/types/ActionSetRequest.d.ts +12 -0
  190. package/serialization/resources/actionSet/types/ActionSetRequest.js +6 -0
  191. package/serialization/resources/actionSet/types/ActionSetResponse.d.ts +14 -0
  192. package/serialization/resources/actionSet/types/ActionSetResponse.js +11 -0
  193. package/serialization/resources/actionSet/types/index.d.ts +3 -0
  194. package/serialization/resources/actionSet/types/index.js +3 -0
  195. package/serialization/resources/commons/types/Feedback.d.ts +17 -0
  196. package/serialization/resources/commons/types/Feedback.js +12 -0
  197. package/serialization/resources/{conversation → commons}/types/FeedbackType.d.ts +1 -1
  198. package/serialization/resources/{conversation → commons}/types/FeedbackType.js +1 -1
  199. package/serialization/resources/commons/types/User.d.ts +1 -0
  200. package/serialization/resources/commons/types/User.js +1 -0
  201. package/serialization/resources/commons/types/index.d.ts +2 -0
  202. package/serialization/resources/commons/types/index.js +2 -0
  203. package/serialization/resources/conversation/types/ActionExecutionRequest.d.ts +15 -0
  204. package/serialization/resources/conversation/types/ActionExecutionRequest.js +10 -0
  205. package/serialization/resources/conversation/types/ActionExecutionResponse.d.ts +12 -0
  206. package/serialization/resources/{knowledge/types/IdBody.js → conversation/types/ActionExecutionResponse.js} +2 -2
  207. package/serialization/resources/conversation/types/BotActionFormResponse.d.ts +1 -0
  208. package/serialization/resources/conversation/types/BotActionFormResponse.js +1 -0
  209. package/serialization/resources/conversation/types/FeedbackRequest.d.ts +2 -6
  210. package/serialization/resources/conversation/types/FeedbackRequest.js +2 -7
  211. package/serialization/resources/conversation/types/index.d.ts +2 -1
  212. package/serialization/resources/conversation/types/index.js +2 -1
  213. package/serialization/resources/index.d.ts +4 -0
  214. package/serialization/resources/index.js +4 -0
  215. package/serialization/resources/knowledge/types/index.d.ts +0 -1
  216. package/serialization/resources/knowledge/types/index.js +0 -1
  217. package/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
  218. package/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
  219. package/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
  220. package/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
  221. package/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
  222. package/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
  223. package/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
  224. package/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
  225. package/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
  226. package/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
  227. package/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
  228. package/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
  229. package/api/resources/conversation/errors/index.d.ts +0 -7
  230. package/api/resources/conversation/errors/index.js +0 -7
  231. package/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
  232. package/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
  233. package/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
  234. package/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
  235. package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
  236. package/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
  237. package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
  238. package/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
  239. package/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
  240. package/api/resources/knowledge/errors/VersionInProgressError.js +0 -14
  241. package/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
  242. package/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
  243. package/api/resources/knowledge/errors/index.d.ts +0 -6
  244. package/api/resources/knowledge/errors/index.js +0 -6
  245. package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.d.ts +0 -8
  246. package/dist/api/resources/conversation/errors/ConversationAlreadyExistsError.js +0 -14
  247. package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.d.ts +0 -8
  248. package/dist/api/resources/conversation/errors/ConversationMessageNotFoundError.js +0 -14
  249. package/dist/api/resources/conversation/errors/ConversationNotFoundError.d.ts +0 -8
  250. package/dist/api/resources/conversation/errors/ConversationNotFoundError.js +0 -14
  251. package/dist/api/resources/conversation/errors/EmptyConversationError.js +0 -14
  252. package/dist/api/resources/conversation/errors/InvalidConversationIdError.d.ts +0 -8
  253. package/dist/api/resources/conversation/errors/InvalidConversationIdError.js +0 -14
  254. package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.d.ts +0 -8
  255. package/dist/api/resources/conversation/errors/InvalidConversationMessageIdError.js +0 -14
  256. package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.d.ts +0 -8
  257. package/dist/api/resources/conversation/errors/InvalidFeedbackTypeError.js +0 -14
  258. package/dist/api/resources/conversation/errors/index.d.ts +0 -7
  259. package/dist/api/resources/conversation/errors/index.js +0 -7
  260. package/dist/api/resources/knowledge/errors/DocumentCreationError.d.ts +0 -7
  261. package/dist/api/resources/knowledge/errors/DocumentCreationError.js +0 -13
  262. package/dist/api/resources/knowledge/errors/DocumentNotFoundError.d.ts +0 -8
  263. package/dist/api/resources/knowledge/errors/DocumentNotFoundError.js +0 -14
  264. package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.d.ts +0 -8
  265. package/dist/api/resources/knowledge/errors/IneligibleKnowledgeBaseError.js +0 -14
  266. package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.d.ts +0 -8
  267. package/dist/api/resources/knowledge/errors/KnowledgeBaseNotFoundError.js +0 -14
  268. package/dist/api/resources/knowledge/errors/VersionInProgressError.d.ts +0 -8
  269. package/dist/api/resources/knowledge/errors/VersionNotInProgressError.d.ts +0 -8
  270. package/dist/api/resources/knowledge/errors/VersionNotInProgressError.js +0 -14
  271. package/dist/api/resources/knowledge/errors/index.d.ts +0 -6
  272. package/dist/api/resources/knowledge/errors/index.js +0 -6
  273. /package/api/resources/{knowledge/types/IdBody.js → action/types/Action.js} +0 -0
  274. /package/{dist/api/resources/knowledge/types/IdBody.js → api/resources/action/types/ActionParameter.js} +0 -0
@@ -21,15 +21,17 @@ export class Knowledge {
21
21
  this._options = _options;
22
22
  }
23
23
  /**
24
- * Create knowledge base
24
+ * Create a new knowledge base.
25
25
  *
26
26
  * @param {MavenAGI.KnowledgeBase} request
27
27
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
28
28
  *
29
- * @throws {@link MavenAGI.AgentNotFoundError}
29
+ * @throws {@link MavenAGI.NotFoundError}
30
+ * @throws {@link MavenAGI.BadRequestError}
31
+ * @throws {@link MavenAGI.ServerError}
30
32
  *
31
33
  * @example
32
- * await mavenAgi.knowledge.createKnowledgeBase({
34
+ * await client.knowledge.createKnowledgeBase({
33
35
  * displayName: "string",
34
36
  * type: MavenAGI.KnowledgeBaseType.Api,
35
37
  * url: "string",
@@ -37,7 +39,7 @@ export class Knowledge {
37
39
  * })
38
40
  */
39
41
  createKnowledgeBase(request, requestOptions) {
40
- var _a, _b, _c;
42
+ var _a, _b;
41
43
  return __awaiter(this, void 0, void 0, function* () {
42
44
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
43
45
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge"),
@@ -48,7 +50,7 @@ export class Knowledge {
48
50
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
49
51
  "X-Fern-Language": "JavaScript",
50
52
  "X-Fern-SDK-Name": "mavenagi",
51
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
53
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
52
54
  "X-Fern-Runtime": core.RUNTIME.type,
53
55
  "X-Fern-Runtime-Version": core.RUNTIME.version,
54
56
  },
@@ -67,9 +69,23 @@ export class Knowledge {
67
69
  });
68
70
  }
69
71
  if (_response.error.reason === "status-code") {
70
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
71
- case "AgentNotFoundError":
72
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
72
+ switch (_response.error.statusCode) {
73
+ case 404:
74
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
75
+ unrecognizedObjectKeys: "passthrough",
76
+ allowUnrecognizedUnionMembers: true,
77
+ allowUnrecognizedEnumValues: true,
78
+ breadcrumbsPrefix: ["response"],
79
+ }));
80
+ case 400:
81
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
82
+ unrecognizedObjectKeys: "passthrough",
83
+ allowUnrecognizedUnionMembers: true,
84
+ allowUnrecognizedEnumValues: true,
85
+ breadcrumbsPrefix: ["response"],
86
+ }));
87
+ case 500:
88
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
73
89
  unrecognizedObjectKeys: "passthrough",
74
90
  allowUnrecognizedUnionMembers: true,
75
91
  allowUnrecognizedEnumValues: true,
@@ -98,24 +114,23 @@ export class Knowledge {
98
114
  });
99
115
  }
100
116
  /**
101
- * Create a new knowledge base version. Only supported on API knowledge bases.
117
+ * Create a new knowledge base version. Only supported on API knowledge bases. Will throw an exception if there is an existing version in progress.
102
118
  *
103
119
  * @param {MavenAGI.KnowledgeBaseVersion} request
104
120
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
105
121
  *
106
- * @throws {@link MavenAGI.VersionInProgressError}
107
- * @throws {@link MavenAGI.IneligibleKnowledgeBaseError}
108
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
109
- * @throws {@link MavenAGI.AgentNotFoundError}
122
+ * @throws {@link MavenAGI.NotFoundError}
123
+ * @throws {@link MavenAGI.BadRequestError}
124
+ * @throws {@link MavenAGI.ServerError}
110
125
  *
111
126
  * @example
112
- * await mavenAgi.knowledge.createKnowledgeBaseVersion({
127
+ * await client.knowledge.createKnowledgeBaseVersion({
113
128
  * knowledgeBaseId: "string",
114
129
  * type: MavenAGI.KnowledgeBaseVersionType.Full
115
130
  * })
116
131
  */
117
132
  createKnowledgeBaseVersion(request, requestOptions) {
118
- var _a, _b, _c;
133
+ var _a, _b;
119
134
  return __awaiter(this, void 0, void 0, function* () {
120
135
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
121
136
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/version"),
@@ -126,7 +141,7 @@ export class Knowledge {
126
141
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
127
142
  "X-Fern-Language": "JavaScript",
128
143
  "X-Fern-SDK-Name": "mavenagi",
129
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
144
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
130
145
  "X-Fern-Runtime": core.RUNTIME.type,
131
146
  "X-Fern-Runtime-Version": core.RUNTIME.version,
132
147
  },
@@ -145,30 +160,23 @@ export class Knowledge {
145
160
  });
146
161
  }
147
162
  if (_response.error.reason === "status-code") {
148
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
149
- case "VersionInProgressError":
150
- throw new MavenAGI.VersionInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
151
- unrecognizedObjectKeys: "passthrough",
152
- allowUnrecognizedUnionMembers: true,
153
- allowUnrecognizedEnumValues: true,
154
- breadcrumbsPrefix: ["response"],
155
- }));
156
- case "IneligibleKnowledgeBaseError":
157
- throw new MavenAGI.IneligibleKnowledgeBaseError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
163
+ switch (_response.error.statusCode) {
164
+ case 404:
165
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
158
166
  unrecognizedObjectKeys: "passthrough",
159
167
  allowUnrecognizedUnionMembers: true,
160
168
  allowUnrecognizedEnumValues: true,
161
169
  breadcrumbsPrefix: ["response"],
162
170
  }));
163
- case "KnowledgeBaseNotFoundError":
164
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
171
+ case 400:
172
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
165
173
  unrecognizedObjectKeys: "passthrough",
166
174
  allowUnrecognizedUnionMembers: true,
167
175
  allowUnrecognizedEnumValues: true,
168
176
  breadcrumbsPrefix: ["response"],
169
177
  }));
170
- case "AgentNotFoundError":
171
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
178
+ case 500:
179
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
172
180
  unrecognizedObjectKeys: "passthrough",
173
181
  allowUnrecognizedUnionMembers: true,
174
182
  allowUnrecognizedEnumValues: true,
@@ -197,23 +205,22 @@ export class Knowledge {
197
205
  });
198
206
  }
199
207
  /**
200
- * Finalize a knowledge base version. Required to indicate a version is complete.
208
+ * Finalize the latest knowledge base version. Required to indicate the version is complete. Will throw an exception if the latest version is not in progress.
201
209
  *
202
210
  * @param {MavenAGI.KnowledgeBaseId} request
203
211
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
204
212
  *
205
- * @throws {@link MavenAGI.VersionNotInProgressError}
206
- * @throws {@link MavenAGI.IneligibleKnowledgeBaseError}
207
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
208
- * @throws {@link MavenAGI.AgentNotFoundError}
213
+ * @throws {@link MavenAGI.NotFoundError}
214
+ * @throws {@link MavenAGI.BadRequestError}
215
+ * @throws {@link MavenAGI.ServerError}
209
216
  *
210
217
  * @example
211
- * await mavenAgi.knowledge.finalizeKnowledgeBaseVersion({
218
+ * await client.knowledge.finalizeKnowledgeBaseVersion({
212
219
  * knowledgeBaseId: "string"
213
220
  * })
214
221
  */
215
222
  finalizeKnowledgeBaseVersion(request, requestOptions) {
216
- var _a, _b, _c;
223
+ var _a, _b;
217
224
  return __awaiter(this, void 0, void 0, function* () {
218
225
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
219
226
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/version/finalize"),
@@ -224,7 +231,7 @@ export class Knowledge {
224
231
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
225
232
  "X-Fern-Language": "JavaScript",
226
233
  "X-Fern-SDK-Name": "mavenagi",
227
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
234
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
228
235
  "X-Fern-Runtime": core.RUNTIME.type,
229
236
  "X-Fern-Runtime-Version": core.RUNTIME.version,
230
237
  },
@@ -238,30 +245,23 @@ export class Knowledge {
238
245
  return;
239
246
  }
240
247
  if (_response.error.reason === "status-code") {
241
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
242
- case "VersionNotInProgressError":
243
- throw new MavenAGI.VersionNotInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
248
+ switch (_response.error.statusCode) {
249
+ case 404:
250
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
244
251
  unrecognizedObjectKeys: "passthrough",
245
252
  allowUnrecognizedUnionMembers: true,
246
253
  allowUnrecognizedEnumValues: true,
247
254
  breadcrumbsPrefix: ["response"],
248
255
  }));
249
- case "IneligibleKnowledgeBaseError":
250
- throw new MavenAGI.IneligibleKnowledgeBaseError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
256
+ case 400:
257
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
251
258
  unrecognizedObjectKeys: "passthrough",
252
259
  allowUnrecognizedUnionMembers: true,
253
260
  allowUnrecognizedEnumValues: true,
254
261
  breadcrumbsPrefix: ["response"],
255
262
  }));
256
- case "KnowledgeBaseNotFoundError":
257
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
258
- unrecognizedObjectKeys: "passthrough",
259
- allowUnrecognizedUnionMembers: true,
260
- allowUnrecognizedEnumValues: true,
261
- breadcrumbsPrefix: ["response"],
262
- }));
263
- case "AgentNotFoundError":
264
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
263
+ case 500:
264
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
265
265
  unrecognizedObjectKeys: "passthrough",
266
266
  allowUnrecognizedUnionMembers: true,
267
267
  allowUnrecognizedEnumValues: true,
@@ -290,19 +290,17 @@ export class Knowledge {
290
290
  });
291
291
  }
292
292
  /**
293
- * Create knowledge document
293
+ * Create knowledge document. Requires an existing knowledge base with an in progress version. Will throw an exception if the latest version is not in progress.
294
294
  *
295
295
  * @param {MavenAGI.KnowledgeDocument} request
296
296
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
297
297
  *
298
- * @throws {@link MavenAGI.VersionNotInProgressError}
299
- * @throws {@link MavenAGI.IneligibleKnowledgeBaseError}
300
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
301
- * @throws {@link MavenAGI.DocumentCreationError}
302
- * @throws {@link MavenAGI.AgentNotFoundError}
298
+ * @throws {@link MavenAGI.NotFoundError}
299
+ * @throws {@link MavenAGI.BadRequestError}
300
+ * @throws {@link MavenAGI.ServerError}
303
301
  *
304
302
  * @example
305
- * await mavenAgi.knowledge.createKnowledgeDocument({
303
+ * await client.knowledge.createKnowledgeDocument({
306
304
  * title: "string",
307
305
  * content: "string",
308
306
  * url: "string",
@@ -315,7 +313,7 @@ export class Knowledge {
315
313
  * })
316
314
  */
317
315
  createKnowledgeDocument(request, requestOptions) {
318
- var _a, _b, _c;
316
+ var _a, _b;
319
317
  return __awaiter(this, void 0, void 0, function* () {
320
318
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
321
319
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
@@ -326,7 +324,7 @@ export class Knowledge {
326
324
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
327
325
  "X-Fern-Language": "JavaScript",
328
326
  "X-Fern-SDK-Name": "mavenagi",
329
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
327
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
330
328
  "X-Fern-Runtime": core.RUNTIME.type,
331
329
  "X-Fern-Runtime-Version": core.RUNTIME.version,
332
330
  },
@@ -345,32 +343,23 @@ export class Knowledge {
345
343
  });
346
344
  }
347
345
  if (_response.error.reason === "status-code") {
348
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
349
- case "VersionNotInProgressError":
350
- throw new MavenAGI.VersionNotInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
351
- unrecognizedObjectKeys: "passthrough",
352
- allowUnrecognizedUnionMembers: true,
353
- allowUnrecognizedEnumValues: true,
354
- breadcrumbsPrefix: ["response"],
355
- }));
356
- case "IneligibleKnowledgeBaseError":
357
- throw new MavenAGI.IneligibleKnowledgeBaseError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
346
+ switch (_response.error.statusCode) {
347
+ case 404:
348
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
358
349
  unrecognizedObjectKeys: "passthrough",
359
350
  allowUnrecognizedUnionMembers: true,
360
351
  allowUnrecognizedEnumValues: true,
361
352
  breadcrumbsPrefix: ["response"],
362
353
  }));
363
- case "KnowledgeBaseNotFoundError":
364
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
354
+ case 400:
355
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
365
356
  unrecognizedObjectKeys: "passthrough",
366
357
  allowUnrecognizedUnionMembers: true,
367
358
  allowUnrecognizedEnumValues: true,
368
359
  breadcrumbsPrefix: ["response"],
369
360
  }));
370
- case "DocumentCreationError":
371
- throw new MavenAGI.DocumentCreationError();
372
- case "AgentNotFoundError":
373
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
361
+ case 500:
362
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
374
363
  unrecognizedObjectKeys: "passthrough",
375
364
  allowUnrecognizedUnionMembers: true,
376
365
  allowUnrecognizedEnumValues: true,
@@ -399,18 +388,17 @@ export class Knowledge {
399
388
  });
400
389
  }
401
390
  /**
402
- * Update knowledge document
391
+ * Update knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
403
392
  *
404
393
  * @param {MavenAGI.KnowledgeDocument} request
405
394
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
406
395
  *
407
- * @throws {@link MavenAGI.VersionNotInProgressError}
408
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
409
- * @throws {@link MavenAGI.DocumentNotFoundError}
410
- * @throws {@link MavenAGI.AgentNotFoundError}
396
+ * @throws {@link MavenAGI.NotFoundError}
397
+ * @throws {@link MavenAGI.BadRequestError}
398
+ * @throws {@link MavenAGI.ServerError}
411
399
  *
412
400
  * @example
413
- * await mavenAgi.knowledge.updateKnowledgeDocument({
401
+ * await client.knowledge.updateKnowledgeDocument({
414
402
  * title: "string",
415
403
  * content: "string",
416
404
  * url: "string",
@@ -423,7 +411,7 @@ export class Knowledge {
423
411
  * })
424
412
  */
425
413
  updateKnowledgeDocument(request, requestOptions) {
426
- var _a, _b, _c;
414
+ var _a, _b;
427
415
  return __awaiter(this, void 0, void 0, function* () {
428
416
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
429
417
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
@@ -434,7 +422,7 @@ export class Knowledge {
434
422
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
435
423
  "X-Fern-Language": "JavaScript",
436
424
  "X-Fern-SDK-Name": "mavenagi",
437
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
425
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
438
426
  "X-Fern-Runtime": core.RUNTIME.type,
439
427
  "X-Fern-Runtime-Version": core.RUNTIME.version,
440
428
  },
@@ -453,30 +441,23 @@ export class Knowledge {
453
441
  });
454
442
  }
455
443
  if (_response.error.reason === "status-code") {
456
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
457
- case "VersionNotInProgressError":
458
- throw new MavenAGI.VersionNotInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
459
- unrecognizedObjectKeys: "passthrough",
460
- allowUnrecognizedUnionMembers: true,
461
- allowUnrecognizedEnumValues: true,
462
- breadcrumbsPrefix: ["response"],
463
- }));
464
- case "KnowledgeBaseNotFoundError":
465
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
444
+ switch (_response.error.statusCode) {
445
+ case 404:
446
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
466
447
  unrecognizedObjectKeys: "passthrough",
467
448
  allowUnrecognizedUnionMembers: true,
468
449
  allowUnrecognizedEnumValues: true,
469
450
  breadcrumbsPrefix: ["response"],
470
451
  }));
471
- case "DocumentNotFoundError":
472
- throw new MavenAGI.DocumentNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
452
+ case 400:
453
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
473
454
  unrecognizedObjectKeys: "passthrough",
474
455
  allowUnrecognizedUnionMembers: true,
475
456
  allowUnrecognizedEnumValues: true,
476
457
  breadcrumbsPrefix: ["response"],
477
458
  }));
478
- case "AgentNotFoundError":
479
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
459
+ case 500:
460
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
480
461
  unrecognizedObjectKeys: "passthrough",
481
462
  allowUnrecognizedUnionMembers: true,
482
463
  allowUnrecognizedEnumValues: true,
@@ -505,24 +486,23 @@ export class Knowledge {
505
486
  });
506
487
  }
507
488
  /**
508
- * Delete knowledge document
489
+ * Delete knowledge document. Requires an existing knowledge base with an in progress version of type PARTIAL. Will throw an exception if the latest version is not in progress.
509
490
  *
510
491
  * @param {MavenAGI.KnowledgeDocumentId} request
511
492
  * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
512
493
  *
513
- * @throws {@link MavenAGI.VersionNotInProgressError}
514
- * @throws {@link MavenAGI.KnowledgeBaseNotFoundError}
515
- * @throws {@link MavenAGI.DocumentNotFoundError}
516
- * @throws {@link MavenAGI.AgentNotFoundError}
494
+ * @throws {@link MavenAGI.NotFoundError}
495
+ * @throws {@link MavenAGI.BadRequestError}
496
+ * @throws {@link MavenAGI.ServerError}
517
497
  *
518
498
  * @example
519
- * await mavenAgi.knowledge.deleteKnowledgeDocument({
499
+ * await client.knowledge.deleteKnowledgeDocument({
520
500
  * knowledgeBaseId: "string",
521
501
  * documentId: "string"
522
502
  * })
523
503
  */
524
504
  deleteKnowledgeDocument(request, requestOptions) {
525
- var _a, _b, _c;
505
+ var _a, _b;
526
506
  return __awaiter(this, void 0, void 0, function* () {
527
507
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
528
508
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/knowledge/document"),
@@ -533,7 +513,7 @@ export class Knowledge {
533
513
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
534
514
  "X-Fern-Language": "JavaScript",
535
515
  "X-Fern-SDK-Name": "mavenagi",
536
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
516
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
537
517
  "X-Fern-Runtime": core.RUNTIME.type,
538
518
  "X-Fern-Runtime-Version": core.RUNTIME.version,
539
519
  },
@@ -547,30 +527,23 @@ export class Knowledge {
547
527
  return;
548
528
  }
549
529
  if (_response.error.reason === "status-code") {
550
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
551
- case "VersionNotInProgressError":
552
- throw new MavenAGI.VersionNotInProgressError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
553
- unrecognizedObjectKeys: "passthrough",
554
- allowUnrecognizedUnionMembers: true,
555
- allowUnrecognizedEnumValues: true,
556
- breadcrumbsPrefix: ["response"],
557
- }));
558
- case "KnowledgeBaseNotFoundError":
559
- throw new MavenAGI.KnowledgeBaseNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
530
+ switch (_response.error.statusCode) {
531
+ case 404:
532
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
560
533
  unrecognizedObjectKeys: "passthrough",
561
534
  allowUnrecognizedUnionMembers: true,
562
535
  allowUnrecognizedEnumValues: true,
563
536
  breadcrumbsPrefix: ["response"],
564
537
  }));
565
- case "DocumentNotFoundError":
566
- throw new MavenAGI.DocumentNotFoundError(yield serializers.IdBody.parseOrThrow(_response.error.body, {
538
+ case 400:
539
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
567
540
  unrecognizedObjectKeys: "passthrough",
568
541
  allowUnrecognizedUnionMembers: true,
569
542
  allowUnrecognizedEnumValues: true,
570
543
  breadcrumbsPrefix: ["response"],
571
544
  }));
572
- case "AgentNotFoundError":
573
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
545
+ case 500:
546
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
574
547
  unrecognizedObjectKeys: "passthrough",
575
548
  allowUnrecognizedUnionMembers: true,
576
549
  allowUnrecognizedEnumValues: true,
@@ -1,3 +1,2 @@
1
1
  export * from "./types";
2
- export * from "./errors";
3
2
  export * from "./client";
@@ -1,3 +1,2 @@
1
1
  export * from "./types";
2
- export * from "./errors";
3
2
  export * from "./client";
@@ -5,6 +5,6 @@ import * as MavenAGI from "../../../index";
5
5
  export interface KnowledgeBaseVersion {
6
6
  /** External ID of the knowledge base used to create a new version */
7
7
  knowledgeBaseId: string;
8
- /** Indicates whether the completed version constitutes a full or partial refresh of the knowledge base */
8
+ /** Indicates whether the completed version constitutes a full or partial refresh of the knowledge base. Deleting and updating documents is only supported for partial refreshes. */
9
9
  type: MavenAGI.KnowledgeBaseVersionType;
10
10
  }
@@ -5,7 +5,7 @@ import * as MavenAGI from "../../../index";
5
5
  export interface KnowledgeDocument extends MavenAGI.KnowledgeDocumentId {
6
6
  /** The title of the document. Will be shown as part of answers. */
7
7
  title: string;
8
- /** The content of the document */
8
+ /** The content of the document. Not shown directly to users. */
9
9
  content: string;
10
10
  /** The URL of the document. Should be visible to end users. Will be shown as part of answers. */
11
11
  url?: string;
@@ -5,4 +5,3 @@ export * from "./KnowledgeBaseVersion";
5
5
  export * from "./KnowledgeBaseVersionType";
6
6
  export * from "./KnowledgeDocumentId";
7
7
  export * from "./KnowledgeDocument";
8
- export * from "./IdBody";
@@ -5,4 +5,3 @@ export * from "./KnowledgeBaseVersion";
5
5
  export * from "./KnowledgeBaseVersionType";
6
6
  export * from "./KnowledgeDocumentId";
7
7
  export * from "./KnowledgeDocument";
8
- export * from "./IdBody";
package/core/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./fetcher";
2
2
  export * from "./runtime";
3
- export * from "./streaming-fetcher";
4
3
  export * from "./auth";
4
+ export * from "./streaming-fetcher";
5
5
  export * as serialization from "./schemas";
package/core/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./fetcher";
2
2
  export * from "./runtime";
3
- export * from "./streaming-fetcher";
4
3
  export * from "./auth";
4
+ export * from "./streaming-fetcher";
5
5
  export * as serialization from "./schemas";
package/dist/Client.d.ts CHANGED
@@ -3,6 +3,8 @@
3
3
  */
4
4
  import * as environments from "./environments";
5
5
  import * as core from "./core";
6
+ import { ActionSet } from "./api/resources/actionSet/client/Client";
7
+ import { Action } from "./api/resources/action/client/Client";
6
8
  import { Conversation } from "./api/resources/conversation/client/Client";
7
9
  import { Knowledge } from "./api/resources/knowledge/client/Client";
8
10
  export declare namespace MavenAGIClient {
@@ -23,6 +25,10 @@ export declare namespace MavenAGIClient {
23
25
  export declare class MavenAGIClient {
24
26
  protected readonly _options: MavenAGIClient.Options;
25
27
  constructor(_options: MavenAGIClient.Options);
28
+ protected _actionSet: ActionSet | undefined;
29
+ get actionSet(): ActionSet;
30
+ protected _action: Action | undefined;
31
+ get action(): Action;
26
32
  protected _conversation: Conversation | undefined;
27
33
  get conversation(): Conversation;
28
34
  protected _knowledge: Knowledge | undefined;
package/dist/Client.js CHANGED
@@ -1,12 +1,22 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import { ActionSet } from "./api/resources/actionSet/client/Client";
5
+ import { Action } from "./api/resources/action/client/Client";
4
6
  import { Conversation } from "./api/resources/conversation/client/Client";
5
7
  import { Knowledge } from "./api/resources/knowledge/client/Client";
6
8
  export class MavenAGIClient {
7
9
  constructor(_options) {
8
10
  this._options = _options;
9
11
  }
12
+ get actionSet() {
13
+ var _a;
14
+ return ((_a = this._actionSet) !== null && _a !== void 0 ? _a : (this._actionSet = new ActionSet(this._options)));
15
+ }
16
+ get action() {
17
+ var _a;
18
+ return ((_a = this._action) !== null && _a !== void 0 ? _a : (this._action = new Action(this._options)));
19
+ }
10
20
  get conversation() {
11
21
  var _a;
12
22
  return ((_a = this._conversation) !== null && _a !== void 0 ? _a : (this._conversation = new Conversation(this._options)));
@@ -0,0 +1,78 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as environments from "../../../../environments";
5
+ import * as core from "../../../../core";
6
+ import * as MavenAGI from "../../../index";
7
+ export declare namespace Action {
8
+ interface Options {
9
+ environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
10
+ appId?: core.Supplier<string | undefined>;
11
+ appSecret?: core.Supplier<string | undefined>;
12
+ organizationId: core.Supplier<string>;
13
+ agentId: core.Supplier<string>;
14
+ fetcher?: core.FetchFunction;
15
+ }
16
+ interface RequestOptions {
17
+ timeoutInSeconds?: number;
18
+ maxRetries?: number;
19
+ abortSignal?: AbortSignal;
20
+ }
21
+ }
22
+ export declare class Action {
23
+ protected readonly _options: Action.Options;
24
+ constructor(_options: Action.Options);
25
+ /**
26
+ * Get an action by its supplied ID
27
+ *
28
+ * @param {string} actionId - The ID of the action to get
29
+ * @param {Action.RequestOptions} requestOptions - Request-specific configuration.
30
+ *
31
+ * @throws {@link MavenAGI.NotFoundError}
32
+ * @throws {@link MavenAGI.BadRequestError}
33
+ * @throws {@link MavenAGI.ServerError}
34
+ *
35
+ * @example
36
+ * await client.action.get("string")
37
+ */
38
+ get(actionId: string, requestOptions?: Action.RequestOptions): Promise<MavenAGI.Action>;
39
+ /**
40
+ * Update an action or create it if it doesn't exist
41
+ *
42
+ * @param {MavenAGI.Action} request
43
+ * @param {Action.RequestOptions} requestOptions - Request-specific configuration.
44
+ *
45
+ * @throws {@link MavenAGI.NotFoundError}
46
+ * @throws {@link MavenAGI.BadRequestError}
47
+ * @throws {@link MavenAGI.ServerError}
48
+ *
49
+ * @example
50
+ * await client.action.register({
51
+ * id: "string",
52
+ * actionSetId: "string",
53
+ * appId: "string",
54
+ * name: "string",
55
+ * description: "string",
56
+ * userInteractionRequired: true,
57
+ * buttonName: "string",
58
+ * requiredUserContextFieldNames: new Set(["string"]),
59
+ * userFormParameters: [{}]
60
+ * })
61
+ */
62
+ register(request: MavenAGI.Action, requestOptions?: Action.RequestOptions): Promise<MavenAGI.Action>;
63
+ /**
64
+ * Delete an action
65
+ *
66
+ * @param {string} actionId - The ID of the action to delete
67
+ * @param {Action.RequestOptions} requestOptions - Request-specific configuration.
68
+ *
69
+ * @throws {@link MavenAGI.NotFoundError}
70
+ * @throws {@link MavenAGI.BadRequestError}
71
+ * @throws {@link MavenAGI.ServerError}
72
+ *
73
+ * @example
74
+ * await client.action.delete("string")
75
+ */
76
+ delete(actionId: string, requestOptions?: Action.RequestOptions): Promise<void>;
77
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
78
+ }