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
@@ -26,21 +26,19 @@ export class Conversation {
26
26
  * @param {MavenAGI.ConversationRequest} request
27
27
  * @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
28
28
  *
29
- * @throws {@link MavenAGI.ConversationAlreadyExistsError}
30
- * @throws {@link MavenAGI.InvalidConversationIdError}
31
- * @throws {@link MavenAGI.InvalidConversationMessageIdError}
32
- * @throws {@link MavenAGI.EmptyConversationError}
33
- * @throws {@link MavenAGI.AgentNotFoundError}
29
+ * @throws {@link MavenAGI.NotFoundError}
30
+ * @throws {@link MavenAGI.BadRequestError}
31
+ * @throws {@link MavenAGI.ServerError}
34
32
  *
35
33
  * @example
36
- * await mavenAgi.conversation.initialize({
34
+ * await client.conversation.initialize({
37
35
  * messages: [{}],
38
36
  * id: "string",
39
37
  * context: {}
40
38
  * })
41
39
  */
42
40
  initialize(request, requestOptions) {
43
- var _a, _b, _c;
41
+ var _a, _b;
44
42
  return __awaiter(this, void 0, void 0, function* () {
45
43
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
46
44
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/conversations"),
@@ -51,7 +49,7 @@ export class Conversation {
51
49
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
52
50
  "X-Fern-Language": "JavaScript",
53
51
  "X-Fern-SDK-Name": "mavenagi",
54
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
52
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
55
53
  "X-Fern-Runtime": core.RUNTIME.type,
56
54
  "X-Fern-Runtime-Version": core.RUNTIME.version,
57
55
  },
@@ -70,37 +68,23 @@ export class Conversation {
70
68
  });
71
69
  }
72
70
  if (_response.error.reason === "status-code") {
73
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
74
- case "ConversationAlreadyExistsError":
75
- throw new MavenAGI.ConversationAlreadyExistsError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
76
- unrecognizedObjectKeys: "passthrough",
77
- allowUnrecognizedUnionMembers: true,
78
- allowUnrecognizedEnumValues: true,
79
- breadcrumbsPrefix: ["response"],
80
- }));
81
- case "InvalidConversationIdError":
82
- throw new MavenAGI.InvalidConversationIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
71
+ switch (_response.error.statusCode) {
72
+ case 404:
73
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
83
74
  unrecognizedObjectKeys: "passthrough",
84
75
  allowUnrecognizedUnionMembers: true,
85
76
  allowUnrecognizedEnumValues: true,
86
77
  breadcrumbsPrefix: ["response"],
87
78
  }));
88
- case "InvalidConversationMessageIdError":
89
- throw new MavenAGI.InvalidConversationMessageIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
79
+ case 400:
80
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
90
81
  unrecognizedObjectKeys: "passthrough",
91
82
  allowUnrecognizedUnionMembers: true,
92
83
  allowUnrecognizedEnumValues: true,
93
84
  breadcrumbsPrefix: ["response"],
94
85
  }));
95
- case "EmptyConversationError":
96
- throw new MavenAGI.EmptyConversationError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
97
- unrecognizedObjectKeys: "passthrough",
98
- allowUnrecognizedUnionMembers: true,
99
- allowUnrecognizedEnumValues: true,
100
- breadcrumbsPrefix: ["response"],
101
- }));
102
- case "AgentNotFoundError":
103
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
86
+ case 500:
87
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
104
88
  unrecognizedObjectKeys: "passthrough",
105
89
  allowUnrecognizedUnionMembers: true,
106
90
  allowUnrecognizedEnumValues: true,
@@ -131,17 +115,18 @@ export class Conversation {
131
115
  /**
132
116
  * Get a conversation
133
117
  *
134
- * @param {string} conversationId - The ID of a conversation to get
118
+ * @param {string} conversationId - The ID of the conversation to get
135
119
  * @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
136
120
  *
137
- * @throws {@link MavenAGI.ConversationNotFoundError}
138
- * @throws {@link MavenAGI.AgentNotFoundError}
121
+ * @throws {@link MavenAGI.NotFoundError}
122
+ * @throws {@link MavenAGI.BadRequestError}
123
+ * @throws {@link MavenAGI.ServerError}
139
124
  *
140
125
  * @example
141
- * await mavenAgi.conversation.get("string")
126
+ * await client.conversation.get("string")
142
127
  */
143
128
  get(conversationId, requestOptions) {
144
- var _a, _b, _c;
129
+ var _a, _b;
145
130
  return __awaiter(this, void 0, void 0, function* () {
146
131
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
147
132
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}`),
@@ -152,7 +137,7 @@ export class Conversation {
152
137
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
153
138
  "X-Fern-Language": "JavaScript",
154
139
  "X-Fern-SDK-Name": "mavenagi",
155
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
140
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
156
141
  "X-Fern-Runtime": core.RUNTIME.type,
157
142
  "X-Fern-Runtime-Version": core.RUNTIME.version,
158
143
  },
@@ -170,16 +155,23 @@ export class Conversation {
170
155
  });
171
156
  }
172
157
  if (_response.error.reason === "status-code") {
173
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
174
- case "ConversationNotFoundError":
175
- throw new MavenAGI.ConversationNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
158
+ switch (_response.error.statusCode) {
159
+ case 404:
160
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
176
161
  unrecognizedObjectKeys: "passthrough",
177
162
  allowUnrecognizedUnionMembers: true,
178
163
  allowUnrecognizedEnumValues: true,
179
164
  breadcrumbsPrefix: ["response"],
180
165
  }));
181
- case "AgentNotFoundError":
182
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
166
+ case 400:
167
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
168
+ unrecognizedObjectKeys: "passthrough",
169
+ allowUnrecognizedUnionMembers: true,
170
+ allowUnrecognizedEnumValues: true,
171
+ breadcrumbsPrefix: ["response"],
172
+ }));
173
+ case 500:
174
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
183
175
  unrecognizedObjectKeys: "passthrough",
184
176
  allowUnrecognizedUnionMembers: true,
185
177
  allowUnrecognizedEnumValues: true,
@@ -214,12 +206,12 @@ export class Conversation {
214
206
  * @param {MavenAGI.ConversationMessageRequest[]} request
215
207
  * @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
216
208
  *
217
- * @throws {@link MavenAGI.ConversationNotFoundError}
218
- * @throws {@link MavenAGI.InvalidConversationMessageIdError}
219
- * @throws {@link MavenAGI.AgentNotFoundError}
209
+ * @throws {@link MavenAGI.NotFoundError}
210
+ * @throws {@link MavenAGI.BadRequestError}
211
+ * @throws {@link MavenAGI.ServerError}
220
212
  *
221
213
  * @example
222
- * await mavenAgi.conversation.appendNewMessages("string", [{
214
+ * await client.conversation.appendNewMessages("string", [{
223
215
  * text: "string",
224
216
  * userMessageType: MavenAGI.UserConversationMessageType.User,
225
217
  * id: "string",
@@ -227,7 +219,7 @@ export class Conversation {
227
219
  * }])
228
220
  */
229
221
  appendNewMessages(conversationId, request, requestOptions) {
230
- var _a, _b, _c;
222
+ var _a, _b;
231
223
  return __awaiter(this, void 0, void 0, function* () {
232
224
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
233
225
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/messages`),
@@ -238,7 +230,7 @@ export class Conversation {
238
230
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
239
231
  "X-Fern-Language": "JavaScript",
240
232
  "X-Fern-SDK-Name": "mavenagi",
241
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
233
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
242
234
  "X-Fern-Runtime": core.RUNTIME.type,
243
235
  "X-Fern-Runtime-Version": core.RUNTIME.version,
244
236
  },
@@ -259,23 +251,23 @@ export class Conversation {
259
251
  });
260
252
  }
261
253
  if (_response.error.reason === "status-code") {
262
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
263
- case "ConversationNotFoundError":
264
- throw new MavenAGI.ConversationNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
254
+ switch (_response.error.statusCode) {
255
+ case 404:
256
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
265
257
  unrecognizedObjectKeys: "passthrough",
266
258
  allowUnrecognizedUnionMembers: true,
267
259
  allowUnrecognizedEnumValues: true,
268
260
  breadcrumbsPrefix: ["response"],
269
261
  }));
270
- case "InvalidConversationMessageIdError":
271
- throw new MavenAGI.InvalidConversationMessageIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
262
+ case 400:
263
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
272
264
  unrecognizedObjectKeys: "passthrough",
273
265
  allowUnrecognizedUnionMembers: true,
274
266
  allowUnrecognizedEnumValues: true,
275
267
  breadcrumbsPrefix: ["response"],
276
268
  }));
277
- case "AgentNotFoundError":
278
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
269
+ case 500:
270
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
279
271
  unrecognizedObjectKeys: "passthrough",
280
272
  allowUnrecognizedUnionMembers: true,
281
273
  allowUnrecognizedEnumValues: true,
@@ -310,18 +302,19 @@ export class Conversation {
310
302
  * @param {MavenAGI.AskRequest} request
311
303
  * @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
312
304
  *
313
- * @throws {@link MavenAGI.InvalidConversationIdError}
314
- * @throws {@link MavenAGI.AgentNotFoundError}
305
+ * @throws {@link MavenAGI.NotFoundError}
306
+ * @throws {@link MavenAGI.BadRequestError}
307
+ * @throws {@link MavenAGI.ServerError}
315
308
  *
316
309
  * @example
317
- * await mavenAgi.conversation.ask("string", {
310
+ * await client.conversation.ask("string", {
318
311
  * id: "string",
319
312
  * text: "string",
320
313
  * context: {}
321
314
  * })
322
315
  */
323
316
  ask(conversationId, request, requestOptions) {
324
- var _a, _b, _c;
317
+ var _a, _b;
325
318
  return __awaiter(this, void 0, void 0, function* () {
326
319
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
327
320
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/ask`),
@@ -332,7 +325,7 @@ export class Conversation {
332
325
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
333
326
  "X-Fern-Language": "JavaScript",
334
327
  "X-Fern-SDK-Name": "mavenagi",
335
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
328
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
336
329
  "X-Fern-Runtime": core.RUNTIME.type,
337
330
  "X-Fern-Runtime-Version": core.RUNTIME.version,
338
331
  },
@@ -351,16 +344,23 @@ export class Conversation {
351
344
  });
352
345
  }
353
346
  if (_response.error.reason === "status-code") {
354
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
355
- case "InvalidConversationIdError":
356
- throw new MavenAGI.InvalidConversationIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
347
+ switch (_response.error.statusCode) {
348
+ case 404:
349
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
350
+ unrecognizedObjectKeys: "passthrough",
351
+ allowUnrecognizedUnionMembers: true,
352
+ allowUnrecognizedEnumValues: true,
353
+ breadcrumbsPrefix: ["response"],
354
+ }));
355
+ case 400:
356
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
357
357
  unrecognizedObjectKeys: "passthrough",
358
358
  allowUnrecognizedUnionMembers: true,
359
359
  allowUnrecognizedEnumValues: true,
360
360
  breadcrumbsPrefix: ["response"],
361
361
  }));
362
- case "AgentNotFoundError":
363
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
362
+ case 500:
363
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
364
364
  unrecognizedObjectKeys: "passthrough",
365
365
  allowUnrecognizedUnionMembers: true,
366
366
  allowUnrecognizedEnumValues: true,
@@ -392,7 +392,7 @@ export class Conversation {
392
392
  * Ask a question
393
393
  */
394
394
  askStream(conversationId, request, requestOptions) {
395
- var _a, _b, _c;
395
+ var _a, _b;
396
396
  return __awaiter(this, void 0, void 0, function* () {
397
397
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
398
398
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/ask_stream`),
@@ -403,7 +403,7 @@ export class Conversation {
403
403
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
404
404
  "X-Fern-Language": "JavaScript",
405
405
  "X-Fern-SDK-Name": "mavenagi",
406
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
406
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
407
407
  "X-Fern-Runtime": core.RUNTIME.type,
408
408
  "X-Fern-Runtime-Version": core.RUNTIME.version,
409
409
  },
@@ -433,9 +433,23 @@ export class Conversation {
433
433
  });
434
434
  }
435
435
  if (_response.error.reason === "status-code") {
436
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
437
- case "AgentNotFoundError":
438
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
436
+ switch (_response.error.statusCode) {
437
+ case 404:
438
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
439
+ unrecognizedObjectKeys: "passthrough",
440
+ allowUnrecognizedUnionMembers: true,
441
+ allowUnrecognizedEnumValues: true,
442
+ breadcrumbsPrefix: ["response"],
443
+ }));
444
+ case 400:
445
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
446
+ unrecognizedObjectKeys: "passthrough",
447
+ allowUnrecognizedUnionMembers: true,
448
+ allowUnrecognizedEnumValues: true,
449
+ breadcrumbsPrefix: ["response"],
450
+ }));
451
+ case 500:
452
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
439
453
  unrecognizedObjectKeys: "passthrough",
440
454
  allowUnrecognizedUnionMembers: true,
441
455
  allowUnrecognizedEnumValues: true,
@@ -470,19 +484,17 @@ export class Conversation {
470
484
  * @param {MavenAGI.GenerateMavenSuggestionsRequest} request
471
485
  * @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
472
486
  *
473
- * @throws {@link MavenAGI.InvalidConversationIdError}
474
- * @throws {@link MavenAGI.ConversationNotFoundError}
475
- * @throws {@link MavenAGI.ConversationMessageNotFoundError}
476
- * @throws {@link MavenAGI.InvalidConversationMessageIdError}
477
- * @throws {@link MavenAGI.AgentNotFoundError}
487
+ * @throws {@link MavenAGI.NotFoundError}
488
+ * @throws {@link MavenAGI.BadRequestError}
489
+ * @throws {@link MavenAGI.ServerError}
478
490
  *
479
491
  * @example
480
- * await mavenAgi.conversation.generateMavenSuggestions("string", {
492
+ * await client.conversation.generateMavenSuggestions("string", {
481
493
  * messageIds: ["string"]
482
494
  * })
483
495
  */
484
496
  generateMavenSuggestions(conversationId, request, requestOptions) {
485
- var _a, _b, _c;
497
+ var _a, _b;
486
498
  return __awaiter(this, void 0, void 0, function* () {
487
499
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
488
500
  url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/generate_maven_suggestions`),
@@ -493,7 +505,7 @@ export class Conversation {
493
505
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
494
506
  "X-Fern-Language": "JavaScript",
495
507
  "X-Fern-SDK-Name": "mavenagi",
496
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
508
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
497
509
  "X-Fern-Runtime": core.RUNTIME.type,
498
510
  "X-Fern-Runtime-Version": core.RUNTIME.version,
499
511
  },
@@ -514,37 +526,112 @@ export class Conversation {
514
526
  });
515
527
  }
516
528
  if (_response.error.reason === "status-code") {
517
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
518
- case "InvalidConversationIdError":
519
- throw new MavenAGI.InvalidConversationIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
529
+ switch (_response.error.statusCode) {
530
+ case 404:
531
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
520
532
  unrecognizedObjectKeys: "passthrough",
521
533
  allowUnrecognizedUnionMembers: true,
522
534
  allowUnrecognizedEnumValues: true,
523
535
  breadcrumbsPrefix: ["response"],
524
536
  }));
525
- case "ConversationNotFoundError":
526
- throw new MavenAGI.ConversationNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
537
+ case 400:
538
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
527
539
  unrecognizedObjectKeys: "passthrough",
528
540
  allowUnrecognizedUnionMembers: true,
529
541
  allowUnrecognizedEnumValues: true,
530
542
  breadcrumbsPrefix: ["response"],
531
543
  }));
532
- case "ConversationMessageNotFoundError":
533
- throw new MavenAGI.ConversationMessageNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
544
+ case 500:
545
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
546
+ unrecognizedObjectKeys: "passthrough",
547
+ allowUnrecognizedUnionMembers: true,
548
+ allowUnrecognizedEnumValues: true,
549
+ breadcrumbsPrefix: ["response"],
550
+ }));
551
+ default:
552
+ throw new errors.MavenAGIError({
553
+ statusCode: _response.error.statusCode,
554
+ body: _response.error.body,
555
+ });
556
+ }
557
+ }
558
+ switch (_response.error.reason) {
559
+ case "non-json":
560
+ throw new errors.MavenAGIError({
561
+ statusCode: _response.error.statusCode,
562
+ body: _response.error.rawBody,
563
+ });
564
+ case "timeout":
565
+ throw new errors.MavenAGITimeoutError();
566
+ case "unknown":
567
+ throw new errors.MavenAGIError({
568
+ message: _response.error.errorMessage,
569
+ });
570
+ }
571
+ });
572
+ }
573
+ /**
574
+ * Create feedback
575
+ *
576
+ * @param {MavenAGI.FeedbackRequest} request
577
+ * @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
578
+ *
579
+ * @throws {@link MavenAGI.NotFoundError}
580
+ * @throws {@link MavenAGI.BadRequestError}
581
+ * @throws {@link MavenAGI.ServerError}
582
+ *
583
+ * @example
584
+ * await client.conversation.createFeedback({
585
+ * id: "string",
586
+ * conversationId: "string",
587
+ * conversationMessageId: "string",
588
+ * type: MavenAGI.FeedbackType.ThumbsUp,
589
+ * text: "string"
590
+ * })
591
+ */
592
+ createFeedback(request, requestOptions) {
593
+ var _a, _b;
594
+ return __awaiter(this, void 0, void 0, function* () {
595
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
596
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/conversations/feedback"),
597
+ method: "POST",
598
+ headers: {
599
+ Authorization: yield this._getAuthorizationHeader(),
600
+ "X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
601
+ "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
602
+ "X-Fern-Language": "JavaScript",
603
+ "X-Fern-SDK-Name": "mavenagi",
604
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
605
+ "X-Fern-Runtime": core.RUNTIME.type,
606
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
607
+ },
608
+ contentType: "application/json",
609
+ body: yield serializers.FeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
610
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
611
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
612
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
613
+ });
614
+ if (_response.ok) {
615
+ return;
616
+ }
617
+ if (_response.error.reason === "status-code") {
618
+ switch (_response.error.statusCode) {
619
+ case 404:
620
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
534
621
  unrecognizedObjectKeys: "passthrough",
535
622
  allowUnrecognizedUnionMembers: true,
536
623
  allowUnrecognizedEnumValues: true,
537
624
  breadcrumbsPrefix: ["response"],
538
625
  }));
539
- case "InvalidConversationMessageIdError":
540
- throw new MavenAGI.InvalidConversationMessageIdError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
626
+ case 400:
627
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
541
628
  unrecognizedObjectKeys: "passthrough",
542
629
  allowUnrecognizedUnionMembers: true,
543
630
  allowUnrecognizedEnumValues: true,
544
631
  breadcrumbsPrefix: ["response"],
545
632
  }));
546
- case "AgentNotFoundError":
547
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
633
+ case 500:
634
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
548
635
  unrecognizedObjectKeys: "passthrough",
549
636
  allowUnrecognizedUnionMembers: true,
550
637
  allowUnrecognizedEnumValues: true,
@@ -573,27 +660,41 @@ export class Conversation {
573
660
  });
574
661
  }
575
662
  /**
576
- * Create feedback
663
+ * Submit a filled out action form
577
664
  *
578
- * @param {MavenAGI.FeedbackRequest} request
665
+ * @param {string} conversationId - The ID of a conversation the form being submitted belongs to
666
+ * @param {MavenAGI.ActionExecutionRequest} request
579
667
  * @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
580
668
  *
581
- * @throws {@link MavenAGI.InvalidFeedbackTypeError}
582
- * @throws {@link MavenAGI.ConversationMessageNotFoundError}
583
- * @throws {@link MavenAGI.AgentNotFoundError}
669
+ * @throws {@link MavenAGI.NotFoundError}
670
+ * @throws {@link MavenAGI.BadRequestError}
671
+ * @throws {@link MavenAGI.ServerError}
584
672
  *
585
673
  * @example
586
- * await mavenAgi.conversation.createFeedback({
587
- * conversationMessageId: "string",
588
- * text: "string",
589
- * type: MavenAGI.FeedbackType.ThumbsUp
674
+ * await client.conversation.submitActionForm("string", {
675
+ * actionFormId: "string",
676
+ * userContext: {
677
+ * name: "string",
678
+ * id: {
679
+ * "string": "string"
680
+ * },
681
+ * email: "string",
682
+ * context: {
683
+ * "string": "string"
684
+ * }
685
+ * },
686
+ * parameters: {
687
+ * "string": {
688
+ * "key": "value"
689
+ * }
690
+ * }
590
691
  * })
591
692
  */
592
- createFeedback(request, requestOptions) {
593
- var _a, _b, _c;
693
+ submitActionForm(conversationId, request, requestOptions) {
694
+ var _a, _b;
594
695
  return __awaiter(this, void 0, void 0, function* () {
595
696
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
596
- url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/conversations/feedback"),
697
+ url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/conversations/${encodeURIComponent(conversationId)}/submit-form`),
597
698
  method: "POST",
598
699
  headers: {
599
700
  Authorization: yield this._getAuthorizationHeader(),
@@ -601,37 +702,42 @@ export class Conversation {
601
702
  "X-Agent-Id": yield core.Supplier.get(this._options.agentId),
602
703
  "X-Fern-Language": "JavaScript",
603
704
  "X-Fern-SDK-Name": "mavenagi",
604
- "X-Fern-SDK-Version": "0.0.0-alpha.2",
705
+ "X-Fern-SDK-Version": "0.0.0-alpha.3",
605
706
  "X-Fern-Runtime": core.RUNTIME.type,
606
707
  "X-Fern-Runtime-Version": core.RUNTIME.version,
607
708
  },
608
709
  contentType: "application/json",
609
- body: yield serializers.FeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
710
+ body: yield serializers.ActionExecutionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
610
711
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
611
712
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
612
713
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
613
714
  });
614
715
  if (_response.ok) {
615
- return;
716
+ return yield serializers.ActionExecutionResponse.parseOrThrow(_response.body, {
717
+ unrecognizedObjectKeys: "passthrough",
718
+ allowUnrecognizedUnionMembers: true,
719
+ allowUnrecognizedEnumValues: true,
720
+ breadcrumbsPrefix: ["response"],
721
+ });
616
722
  }
617
723
  if (_response.error.reason === "status-code") {
618
- switch ((_c = _response.error.body) === null || _c === void 0 ? void 0 : _c["errorName"]) {
619
- case "InvalidFeedbackTypeError":
620
- throw new MavenAGI.InvalidFeedbackTypeError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
724
+ switch (_response.error.statusCode) {
725
+ case 404:
726
+ throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
621
727
  unrecognizedObjectKeys: "passthrough",
622
728
  allowUnrecognizedUnionMembers: true,
623
729
  allowUnrecognizedEnumValues: true,
624
730
  breadcrumbsPrefix: ["response"],
625
731
  }));
626
- case "ConversationMessageNotFoundError":
627
- throw new MavenAGI.ConversationMessageNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
732
+ case 400:
733
+ throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
628
734
  unrecognizedObjectKeys: "passthrough",
629
735
  allowUnrecognizedUnionMembers: true,
630
736
  allowUnrecognizedEnumValues: true,
631
737
  breadcrumbsPrefix: ["response"],
632
738
  }));
633
- case "AgentNotFoundError":
634
- throw new MavenAGI.AgentNotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
739
+ case 500:
740
+ throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
635
741
  unrecognizedObjectKeys: "passthrough",
636
742
  allowUnrecognizedUnionMembers: true,
637
743
  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";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as MavenAGI from "../../../index";
5
+ export interface ActionExecutionRequest {
6
+ actionFormId: string;
7
+ userContext: MavenAGI.User;
8
+ /** Map of parameter names to values */
9
+ parameters: Record<string, unknown>;
10
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface ActionExecutionResponse {
5
+ /** The result of the action execution in markdown format. */
6
+ response: string;
7
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as MavenAGI from "../../../index";
5
5
  export interface BotActionFormResponse {
6
+ id: string;
6
7
  formLabel: string;
7
8
  fields: MavenAGI.ActionFormField[];
8
9
  submitLabel: string;
@@ -2,11 +2,4 @@
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
4
  import * as MavenAGI from "../../../index";
5
- export interface FeedbackRequest {
6
- /** The ID of the conversation message the feedback is about */
7
- conversationMessageId: string;
8
- /** The feedback text */
9
- text: string;
10
- /** The type of feedback */
11
- type: MavenAGI.FeedbackType;
12
- }
5
+ export declare type FeedbackRequest = MavenAGI.Feedback;