mavenagi 1.2.4 → 1.2.6

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 (203) hide show
  1. package/Client.js +2 -2
  2. package/README.md +390 -0
  3. package/api/resources/actions/client/Client.d.ts +11 -1
  4. package/api/resources/actions/client/Client.js +11 -1
  5. package/api/resources/actions/client/requests/ActionPatchRequest.d.ts +11 -1
  6. package/api/resources/agentCapabilities/types/ActionCapability.d.ts +1 -1
  7. package/api/resources/agents/client/Client.d.ts +2 -2
  8. package/api/resources/agents/client/Client.js +5 -5
  9. package/api/resources/agents/client/index.d.ts +1 -0
  10. package/api/resources/agents/client/index.js +15 -0
  11. package/api/resources/agents/client/requests/AgentPatchRequest.d.ts +27 -0
  12. package/api/resources/agents/client/requests/index.d.ts +1 -0
  13. package/api/resources/agents/client/requests/index.js +2 -0
  14. package/api/resources/agents/types/Agent.d.ts +8 -0
  15. package/api/resources/agents/types/AgentPrompting.d.ts +23 -0
  16. package/api/resources/agents/types/index.d.ts +1 -1
  17. package/api/resources/agents/types/index.js +1 -1
  18. package/api/resources/analytics/client/Client.d.ts +10 -0
  19. package/api/resources/analytics/client/Client.js +83 -0
  20. package/api/resources/analytics/types/ConversationBarChartRequest.d.ts +20 -0
  21. package/api/resources/analytics/types/ConversationDateHistogramRequest.d.ts +13 -1
  22. package/api/resources/analytics/types/ConversationPieChartRequest.d.ts +13 -1
  23. package/api/resources/commons/types/ActionResponse.d.ts +7 -0
  24. package/api/resources/commons/types/AppUserResponse.d.ts +12 -0
  25. package/api/resources/commons/types/ConversationSummary.d.ts +4 -0
  26. package/api/resources/commons/types/SimulationContext.d.ts +6 -0
  27. package/api/resources/commons/types/UserDataWithReference.d.ts +5 -0
  28. package/api/resources/commons/types/UserDataWithReference.js +3 -0
  29. package/api/resources/commons/types/index.d.ts +1 -0
  30. package/api/resources/commons/types/index.js +1 -0
  31. package/api/resources/conversation/client/Client.d.ts +18 -1
  32. package/api/resources/conversation/client/Client.js +91 -1
  33. package/api/resources/events/client/Client.d.ts +10 -0
  34. package/api/resources/events/client/Client.js +83 -0
  35. package/api/resources/index.d.ts +1 -0
  36. package/api/resources/index.js +1 -0
  37. package/api/resources/knowledge/client/Client.d.ts +32 -1
  38. package/api/resources/knowledge/client/Client.js +104 -1
  39. package/api/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +11 -1
  40. package/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
  41. package/api/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -0
  42. package/api/resources/knowledge/types/KnowledgeBaseField.js +1 -0
  43. package/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +5 -0
  44. package/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +10 -0
  45. package/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.js +3 -0
  46. package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +29 -1
  47. package/api/resources/knowledge/types/KnowledgeBaseType.d.ts +8 -1
  48. package/api/resources/knowledge/types/KnowledgeBaseType.js +8 -1
  49. package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +2 -0
  50. package/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +2 -0
  51. package/api/resources/knowledge/types/index.d.ts +1 -0
  52. package/api/resources/knowledge/types/index.js +1 -0
  53. package/dist/Client.js +2 -2
  54. package/dist/api/resources/actions/client/Client.d.ts +11 -1
  55. package/dist/api/resources/actions/client/Client.js +11 -1
  56. package/dist/api/resources/actions/client/requests/ActionPatchRequest.d.ts +11 -1
  57. package/dist/api/resources/agentCapabilities/types/ActionCapability.d.ts +1 -1
  58. package/dist/api/resources/agents/client/Client.d.ts +2 -2
  59. package/dist/api/resources/agents/client/Client.js +5 -5
  60. package/dist/api/resources/agents/client/index.d.ts +1 -0
  61. package/dist/api/resources/agents/client/index.js +15 -0
  62. package/dist/api/resources/agents/client/requests/AgentPatchRequest.d.ts +27 -0
  63. package/dist/api/resources/agents/client/requests/AgentPatchRequest.js +3 -0
  64. package/dist/api/resources/agents/client/requests/index.d.ts +1 -0
  65. package/dist/api/resources/agents/client/requests/index.js +2 -0
  66. package/dist/api/resources/agents/types/Agent.d.ts +8 -0
  67. package/dist/api/resources/agents/types/AgentPrompting.d.ts +23 -0
  68. package/dist/api/resources/agents/types/AgentPrompting.js +3 -0
  69. package/dist/api/resources/agents/types/index.d.ts +1 -1
  70. package/dist/api/resources/agents/types/index.js +1 -1
  71. package/dist/api/resources/analytics/client/Client.d.ts +10 -0
  72. package/dist/api/resources/analytics/client/Client.js +83 -0
  73. package/dist/api/resources/analytics/types/ConversationBarChartRequest.d.ts +20 -0
  74. package/dist/api/resources/analytics/types/ConversationDateHistogramRequest.d.ts +13 -1
  75. package/dist/api/resources/analytics/types/ConversationPieChartRequest.d.ts +13 -1
  76. package/dist/api/resources/commons/types/ActionResponse.d.ts +7 -0
  77. package/dist/api/resources/commons/types/AppUserResponse.d.ts +12 -0
  78. package/dist/api/resources/commons/types/ConversationSummary.d.ts +4 -0
  79. package/dist/api/resources/commons/types/SimulationContext.d.ts +6 -0
  80. package/dist/api/resources/commons/types/UserDataWithReference.d.ts +5 -0
  81. package/dist/api/resources/commons/types/UserDataWithReference.js +3 -0
  82. package/dist/api/resources/commons/types/index.d.ts +1 -0
  83. package/dist/api/resources/commons/types/index.js +1 -0
  84. package/dist/api/resources/conversation/client/Client.d.ts +18 -1
  85. package/dist/api/resources/conversation/client/Client.js +91 -1
  86. package/dist/api/resources/events/client/Client.d.ts +10 -0
  87. package/dist/api/resources/events/client/Client.js +83 -0
  88. package/dist/api/resources/index.d.ts +1 -0
  89. package/dist/api/resources/index.js +1 -0
  90. package/dist/api/resources/knowledge/client/Client.d.ts +32 -1
  91. package/dist/api/resources/knowledge/client/Client.js +104 -1
  92. package/dist/api/resources/knowledge/client/requests/KnowledgeBasePatchRequest.d.ts +11 -1
  93. package/dist/api/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -2
  94. package/dist/api/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -0
  95. package/dist/api/resources/knowledge/types/KnowledgeBaseField.js +1 -0
  96. package/dist/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +5 -0
  97. package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +10 -0
  98. package/dist/api/resources/knowledge/types/KnowledgeBaseRefreshRequest.js +3 -0
  99. package/dist/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +29 -1
  100. package/dist/api/resources/knowledge/types/KnowledgeBaseType.d.ts +8 -1
  101. package/dist/api/resources/knowledge/types/KnowledgeBaseType.js +8 -1
  102. package/dist/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +2 -0
  103. package/dist/api/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +2 -0
  104. package/dist/api/resources/knowledge/types/index.d.ts +1 -0
  105. package/dist/api/resources/knowledge/types/index.js +1 -0
  106. package/dist/serialization/resources/agentCapabilities/types/ActionCapability.js +1 -1
  107. package/dist/serialization/resources/agents/client/index.d.ts +1 -0
  108. package/dist/serialization/resources/agents/client/index.js +4 -0
  109. package/dist/serialization/resources/agents/client/requests/AgentPatchRequest.d.ts +21 -0
  110. package/dist/serialization/resources/agents/client/requests/AgentPatchRequest.js +53 -0
  111. package/dist/serialization/resources/agents/client/requests/index.d.ts +1 -0
  112. package/dist/serialization/resources/agents/client/requests/index.js +5 -0
  113. package/dist/serialization/resources/agents/types/Agent.d.ts +3 -0
  114. package/dist/serialization/resources/agents/types/Agent.js +3 -0
  115. package/dist/serialization/resources/agents/types/AgentPrompting.d.ts +14 -0
  116. package/dist/serialization/resources/agents/types/AgentPrompting.js +46 -0
  117. package/dist/serialization/resources/agents/types/index.d.ts +1 -1
  118. package/dist/serialization/resources/agents/types/index.js +1 -1
  119. package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +2 -0
  120. package/dist/serialization/resources/commons/types/AppUserResponse.js +2 -0
  121. package/dist/serialization/resources/commons/types/ConversationSummary.d.ts +2 -0
  122. package/dist/serialization/resources/commons/types/ConversationSummary.js +2 -0
  123. package/dist/serialization/resources/commons/types/SimulationContext.d.ts +1 -0
  124. package/dist/serialization/resources/commons/types/SimulationContext.js +1 -0
  125. package/dist/serialization/resources/commons/types/UserDataWithReference.d.ts +11 -0
  126. package/dist/serialization/resources/commons/types/UserDataWithReference.js +45 -0
  127. package/dist/serialization/resources/commons/types/index.d.ts +1 -0
  128. package/dist/serialization/resources/commons/types/index.js +1 -0
  129. package/dist/serialization/resources/index.d.ts +1 -0
  130. package/dist/serialization/resources/index.js +1 -0
  131. package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -1
  132. package/dist/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -1
  133. package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -1
  134. package/dist/serialization/resources/knowledge/types/KnowledgeBaseField.js +1 -1
  135. package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +4 -0
  136. package/dist/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +4 -0
  137. package/dist/serialization/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +9 -0
  138. package/dist/serialization/resources/{agents/types/AgentPatchRequest.js → knowledge/types/KnowledgeBaseRefreshRequest.js} +3 -8
  139. package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +4 -0
  140. package/dist/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
  141. package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
  142. package/dist/serialization/resources/knowledge/types/KnowledgeBaseType.js +1 -1
  143. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -0
  144. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -0
  145. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +1 -0
  146. package/dist/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +1 -0
  147. package/dist/serialization/resources/knowledge/types/index.d.ts +1 -0
  148. package/dist/serialization/resources/knowledge/types/index.js +1 -0
  149. package/dist/version.d.ts +1 -1
  150. package/dist/version.js +1 -1
  151. package/package.json +1 -1
  152. package/reference.md +325 -4
  153. package/serialization/resources/agentCapabilities/types/ActionCapability.js +1 -1
  154. package/serialization/resources/agents/client/index.d.ts +1 -0
  155. package/serialization/resources/agents/client/index.js +4 -0
  156. package/serialization/resources/agents/client/requests/AgentPatchRequest.d.ts +21 -0
  157. package/serialization/resources/agents/client/requests/AgentPatchRequest.js +53 -0
  158. package/serialization/resources/agents/client/requests/index.d.ts +1 -0
  159. package/serialization/resources/agents/client/requests/index.js +5 -0
  160. package/serialization/resources/agents/types/Agent.d.ts +3 -0
  161. package/serialization/resources/agents/types/Agent.js +3 -0
  162. package/serialization/resources/agents/types/AgentPrompting.d.ts +14 -0
  163. package/serialization/resources/agents/types/AgentPrompting.js +46 -0
  164. package/serialization/resources/agents/types/index.d.ts +1 -1
  165. package/serialization/resources/agents/types/index.js +1 -1
  166. package/serialization/resources/commons/types/AppUserResponse.d.ts +2 -0
  167. package/serialization/resources/commons/types/AppUserResponse.js +2 -0
  168. package/serialization/resources/commons/types/ConversationSummary.d.ts +2 -0
  169. package/serialization/resources/commons/types/ConversationSummary.js +2 -0
  170. package/serialization/resources/commons/types/SimulationContext.d.ts +1 -0
  171. package/serialization/resources/commons/types/SimulationContext.js +1 -0
  172. package/serialization/resources/commons/types/UserDataWithReference.d.ts +11 -0
  173. package/serialization/resources/commons/types/UserDataWithReference.js +45 -0
  174. package/serialization/resources/commons/types/index.d.ts +1 -0
  175. package/serialization/resources/commons/types/index.js +1 -0
  176. package/serialization/resources/index.d.ts +1 -0
  177. package/serialization/resources/index.js +1 -0
  178. package/serialization/resources/knowledge/types/BaseKnowledgeDocument.d.ts +0 -1
  179. package/serialization/resources/knowledge/types/BaseKnowledgeDocument.js +0 -1
  180. package/serialization/resources/knowledge/types/KnowledgeBaseField.d.ts +1 -1
  181. package/serialization/resources/knowledge/types/KnowledgeBaseField.js +1 -1
  182. package/serialization/resources/knowledge/types/KnowledgeBaseFilter.d.ts +4 -0
  183. package/serialization/resources/knowledge/types/KnowledgeBaseFilter.js +4 -0
  184. package/serialization/resources/knowledge/types/KnowledgeBaseRefreshRequest.d.ts +9 -0
  185. package/serialization/resources/{agents/types/AgentPatchRequest.js → knowledge/types/KnowledgeBaseRefreshRequest.js} +3 -8
  186. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.d.ts +4 -0
  187. package/serialization/resources/knowledge/types/KnowledgeBaseResponse.js +4 -0
  188. package/serialization/resources/knowledge/types/KnowledgeBaseType.d.ts +1 -1
  189. package/serialization/resources/knowledge/types/KnowledgeBaseType.js +1 -1
  190. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +1 -0
  191. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +1 -0
  192. package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.d.ts +1 -0
  193. package/serialization/resources/knowledge/types/KnowledgeDocumentSearchResponse.js +1 -0
  194. package/serialization/resources/knowledge/types/index.d.ts +1 -0
  195. package/serialization/resources/knowledge/types/index.js +1 -0
  196. package/version.d.ts +1 -1
  197. package/version.js +1 -1
  198. package/api/resources/agents/types/AgentPatchRequest.d.ts +0 -11
  199. package/dist/api/resources/agents/types/AgentPatchRequest.d.ts +0 -11
  200. package/dist/serialization/resources/agents/types/AgentPatchRequest.d.ts +0 -14
  201. package/serialization/resources/agents/types/AgentPatchRequest.d.ts +0 -14
  202. /package/api/resources/agents/{types → client/requests}/AgentPatchRequest.js +0 -0
  203. /package/{dist/api/resources/agents/types/AgentPatchRequest.js → api/resources/agents/types/AgentPrompting.js} +0 -0
@@ -347,6 +347,99 @@ class Knowledge {
347
347
  }
348
348
  });
349
349
  }
350
+ /**
351
+ * Request that a knowledge base refresh itself.
352
+ *
353
+ * Knowledge bases refresh on a schedule determined by the `refreshFrequency` field.
354
+ * They can also be refreshed on demand by calling this endpoint.
355
+ *
356
+ * @param {string} knowledgeBaseReferenceId - The reference ID of the knowledge base to refresh. All other entity ID fields are inferred from the request.
357
+ * @param {MavenAGI.KnowledgeBaseRefreshRequest} request
358
+ * @param {Knowledge.RequestOptions} requestOptions - Request-specific configuration.
359
+ *
360
+ * @throws {@link MavenAGI.NotFoundError}
361
+ * @throws {@link MavenAGI.BadRequestError}
362
+ * @throws {@link MavenAGI.ServerError}
363
+ *
364
+ * @example
365
+ * await client.knowledge.refreshKnowledgeBase("help-center", {
366
+ * appId: "readme"
367
+ * })
368
+ */
369
+ refreshKnowledgeBase(knowledgeBaseReferenceId, request, requestOptions) {
370
+ return core.HttpResponsePromise.fromPromise(this.__refreshKnowledgeBase(knowledgeBaseReferenceId, request, requestOptions));
371
+ }
372
+ __refreshKnowledgeBase(knowledgeBaseReferenceId, request, requestOptions) {
373
+ return __awaiter(this, void 0, void 0, function* () {
374
+ var _a, _b, _c, _d, _e, _f, _g, _h;
375
+ let _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
376
+ Authorization: yield this._getAuthorizationHeader(),
377
+ "X-Organization-Id": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationId,
378
+ "X-Agent-Id": (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.agentId,
379
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
380
+ const _response = yield ((_f = this._options.fetcher) !== null && _f !== void 0 ? _f : core.fetcher)({
381
+ url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/knowledge/${encodeURIComponent(knowledgeBaseReferenceId)}/refresh`),
382
+ method: "POST",
383
+ headers: _headers,
384
+ contentType: "application/json",
385
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
386
+ requestType: "json",
387
+ body: serializers.KnowledgeBaseRefreshRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
388
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
389
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
390
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
391
+ });
392
+ if (_response.ok) {
393
+ return { data: undefined, rawResponse: _response.rawResponse };
394
+ }
395
+ if (_response.error.reason === "status-code") {
396
+ switch (_response.error.statusCode) {
397
+ case 404:
398
+ throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
399
+ unrecognizedObjectKeys: "passthrough",
400
+ allowUnrecognizedUnionMembers: true,
401
+ allowUnrecognizedEnumValues: true,
402
+ breadcrumbsPrefix: ["response"],
403
+ }), _response.rawResponse);
404
+ case 400:
405
+ throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
406
+ unrecognizedObjectKeys: "passthrough",
407
+ allowUnrecognizedUnionMembers: true,
408
+ allowUnrecognizedEnumValues: true,
409
+ breadcrumbsPrefix: ["response"],
410
+ }), _response.rawResponse);
411
+ case 500:
412
+ throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
413
+ unrecognizedObjectKeys: "passthrough",
414
+ allowUnrecognizedUnionMembers: true,
415
+ allowUnrecognizedEnumValues: true,
416
+ breadcrumbsPrefix: ["response"],
417
+ }), _response.rawResponse);
418
+ default:
419
+ throw new errors.MavenAGIError({
420
+ statusCode: _response.error.statusCode,
421
+ body: _response.error.body,
422
+ rawResponse: _response.rawResponse,
423
+ });
424
+ }
425
+ }
426
+ switch (_response.error.reason) {
427
+ case "non-json":
428
+ throw new errors.MavenAGIError({
429
+ statusCode: _response.error.statusCode,
430
+ body: _response.error.rawBody,
431
+ rawResponse: _response.rawResponse,
432
+ });
433
+ case "timeout":
434
+ throw new errors.MavenAGITimeoutError("Timeout exceeded when calling POST /v1/knowledge/{knowledgeBaseReferenceId}/refresh.");
435
+ case "unknown":
436
+ throw new errors.MavenAGIError({
437
+ message: _response.error.errorMessage,
438
+ rawResponse: _response.rawResponse,
439
+ });
440
+ }
441
+ });
442
+ }
350
443
  /**
351
444
  * Update mutable knowledge base fields
352
445
  *
@@ -362,7 +455,17 @@ class Knowledge {
362
455
  * @throws {@link MavenAGI.ServerError}
363
456
  *
364
457
  * @example
365
- * await client.knowledge.patchKnowledgeBase("knowledgeBaseReferenceId")
458
+ * await client.knowledge.patchKnowledgeBase("help-center", {
459
+ * name: "Updated Help Center",
460
+ * tags: new Set(["tag1", "tag2", "tag3"]),
461
+ * segmentId: {
462
+ * referenceId: "premium-users",
463
+ * appId: "readme",
464
+ * organizationId: "acme",
465
+ * agentId: "support",
466
+ * type: "SEGMENT"
467
+ * }
468
+ * })
366
469
  */
367
470
  patchKnowledgeBase(knowledgeBaseReferenceId, request = {}, requestOptions) {
368
471
  return core.HttpResponsePromise.fromPromise(this.__patchKnowledgeBase(knowledgeBaseReferenceId, request, requestOptions));
@@ -1,7 +1,17 @@
1
1
  import * as MavenAGI from "../../../../index";
2
2
  /**
3
3
  * @example
4
- * {}
4
+ * {
5
+ * name: "Updated Help Center",
6
+ * tags: new Set(["tag1", "tag2", "tag3"]),
7
+ * segmentId: {
8
+ * referenceId: "premium-users",
9
+ * appId: "readme",
10
+ * organizationId: "acme",
11
+ * agentId: "support",
12
+ * type: "SEGMENT"
13
+ * }
14
+ * }
5
15
  */
6
16
  export interface KnowledgeBasePatchRequest {
7
17
  /** The App ID of the knowledge base to patch. If not provided the ID of the calling app will be used. */
@@ -1,6 +1,4 @@
1
1
  export interface BaseKnowledgeDocument {
2
- /** The title of the document. Will be shown as part of answers. */
3
- title: string;
4
2
  /** The URL of the document. Should be visible to end users. Will be shown as part of answers. Not used for crawling. */
5
3
  url?: string;
6
4
  /** The document language. Must be a valid ISO 639-1 language code. */
@@ -1,5 +1,6 @@
1
1
  export declare const KnowledgeBaseField: {
2
2
  readonly Title: "Title";
3
+ readonly CreatedAt: "CreatedAt";
3
4
  readonly UpdatedAt: "UpdatedAt";
4
5
  };
5
6
  export type KnowledgeBaseField = (typeof KnowledgeBaseField)[keyof typeof KnowledgeBaseField];
@@ -4,5 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.KnowledgeBaseField = void 0;
5
5
  exports.KnowledgeBaseField = {
6
6
  Title: "Title",
7
+ CreatedAt: "CreatedAt",
7
8
  UpdatedAt: "UpdatedAt",
8
9
  };
@@ -1,3 +1,4 @@
1
+ import * as MavenAGI from "../../../index";
1
2
  export interface KnowledgeBaseFilter {
2
3
  /**
3
4
  * Full-text search query for matching knowledge bases by content.
@@ -22,4 +23,8 @@ export interface KnowledgeBaseFilter {
22
23
  createdBefore?: Date;
23
24
  /** Filter by app IDs */
24
25
  appIds?: string[];
26
+ /** Filter knowledge bases by the most recent version status */
27
+ mostRecentVersionStatus?: MavenAGI.KnowledgeBaseVersionStatus[];
28
+ /** Filter knowledge bases by the LLM inclusion status */
29
+ llmInclusionStatus?: MavenAGI.LlmInclusionStatus;
25
30
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * appId: "readme"
5
+ * }
6
+ */
7
+ export interface KnowledgeBaseRefreshRequest {
8
+ /** The App ID of the knowledge base to refresh. If not provided the ID of the calling app will be used. */
9
+ appId?: string;
10
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,6 +2,8 @@ import * as MavenAGI from "../../../index";
2
2
  /**
3
3
  * @example
4
4
  * {
5
+ * createdAt: new Date("2025-01-01T00:00:00.000Z"),
6
+ * updatedAt: new Date("2025-02-02T00:00:00.000Z"),
5
7
  * knowledgeBaseId: {
6
8
  * referenceId: "help-center",
7
9
  * appId: "readme",
@@ -9,20 +11,46 @@ import * as MavenAGI from "../../../index";
9
11
  * agentId: "support",
10
12
  * type: MavenAGI.EntityType.KnowledgeBase
11
13
  * },
14
+ * activeVersionId: {
15
+ * referenceId: "version-1",
16
+ * appId: "readme",
17
+ * organizationId: "acme",
18
+ * agentId: "support",
19
+ * type: MavenAGI.EntityType.KnowledgeBaseVersion
20
+ * },
21
+ * mostRecentVersionStatus: MavenAGI.KnowledgeBaseVersionStatus.Succeeded,
22
+ * llmInclusionStatus: MavenAGI.LlmInclusionStatus.WhenRelevant,
12
23
  * name: "Help center",
13
24
  * type: MavenAGI.KnowledgeBaseType.Api,
14
25
  * metadata: {
15
26
  * "key": "value"
16
27
  * },
17
28
  * tags: new Set(["tag1", "tag2"]),
18
- * refreshFrequency: MavenAGI.KnowledgeBaseRefreshFrequency.Daily
29
+ * refreshFrequency: MavenAGI.KnowledgeBaseRefreshFrequency.Daily,
30
+ * segmentId: {
31
+ * referenceId: "premium-users",
32
+ * appId: "readme",
33
+ * organizationId: "acme",
34
+ * agentId: "support",
35
+ * type: MavenAGI.EntityType.Segment
36
+ * }
19
37
  * }
20
38
  */
21
39
  export interface KnowledgeBaseResponse extends MavenAGI.KnowledgeBaseProperties {
40
+ /** The date and time when the knowledge base was created. */
41
+ createdAt: Date;
42
+ /** The date and time when the knowledge base was last updated. */
43
+ updatedAt: Date;
22
44
  /** ID that uniquely identifies this knowledge base */
23
45
  knowledgeBaseId: MavenAGI.EntityId;
24
46
  /** ID of the knowledge base version that is currently active. Documents can be fetched using this version ID. */
25
47
  activeVersionId?: MavenAGI.EntityId;
48
+ /**
49
+ * The status of the most recent version of the knowledge base.
50
+ * The `activeVersionId` will only be populated if this status is `SUCCEEDED`.
51
+ * Use the `listKnowledgeBaseVersions` endpoint to get the full list of versions.
52
+ */
53
+ mostRecentVersionStatus: MavenAGI.KnowledgeBaseVersionStatus;
26
54
  /** The type of the knowledge base. Can not be changed once created. */
27
55
  type: MavenAGI.KnowledgeBaseType;
28
56
  /** Metadata for the knowledge base. */
@@ -1,5 +1,12 @@
1
- /** API knowledge bases are managed by a Maven App. */
1
+ /**
2
+ * API knowledge bases are managed by a Maven App.
3
+ * All other knowledge base types are deprecated and can not be created.
4
+ */
2
5
  export declare const KnowledgeBaseType: {
3
6
  readonly Api: "API";
7
+ readonly Url: "URL";
8
+ readonly Manual: "MANUAL";
9
+ readonly Rss: "RSS";
10
+ readonly Legacy: "LEGACY";
4
11
  };
5
12
  export type KnowledgeBaseType = (typeof KnowledgeBaseType)[keyof typeof KnowledgeBaseType];
@@ -2,7 +2,14 @@
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.KnowledgeBaseType = void 0;
5
- /** API knowledge bases are managed by a Maven App. */
5
+ /**
6
+ * API knowledge bases are managed by a Maven App.
7
+ * All other knowledge base types are deprecated and can not be created.
8
+ */
6
9
  exports.KnowledgeBaseType = {
7
10
  Api: "API",
11
+ Url: "URL",
12
+ Manual: "MANUAL",
13
+ Rss: "RSS",
14
+ Legacy: "LEGACY",
8
15
  };
@@ -24,6 +24,8 @@ export interface KnowledgeDocumentRequest extends MavenAGI.BaseKnowledgeDocument
24
24
  /** ID that uniquely identifies which knowledge base version to create the document in. If not provided will use the most recent version of the knowledge base. */
25
25
  versionId?: MavenAGI.EntityIdWithoutAgent;
26
26
  contentType: MavenAGI.KnowledgeDocumentContentType;
27
+ /** The title of the document. Will be shown as part of answers. */
28
+ title: string;
27
29
  /** The content of the document. Not shown directly to users. May be provided in HTML or markdown. HTML will be converted to markdown automatically. Images are not currently supported and will be ignored. */
28
30
  content: string;
29
31
  /** Metadata for the knowledge document. */
@@ -7,4 +7,6 @@ export interface KnowledgeDocumentSearchResponse extends MavenAGI.BaseKnowledgeD
7
7
  * This may be missing on legacy documents.
8
8
  */
9
9
  knowledgeBaseVersionId?: MavenAGI.EntityId;
10
+ /** The title of the document. Will be shown as part of answers. May be missing on legacy documents. */
11
+ title?: string;
10
12
  }
@@ -24,3 +24,4 @@ export * from "./KnowledgeDocumentSearchRequest";
24
24
  export * from "./KnowledgeDocumentSearchResponse";
25
25
  export * from "./KnowledgeDocumentsResponse";
26
26
  export * from "./KnowledgeBaseVersionsListResponse";
27
+ export * from "./KnowledgeBaseRefreshRequest";
@@ -40,3 +40,4 @@ __exportStar(require("./KnowledgeDocumentSearchRequest"), exports);
40
40
  __exportStar(require("./KnowledgeDocumentSearchResponse"), exports);
41
41
  __exportStar(require("./KnowledgeDocumentsResponse"), exports);
42
42
  __exportStar(require("./KnowledgeBaseVersionsListResponse"), exports);
43
+ __exportStar(require("./KnowledgeBaseRefreshRequest"), exports);
package/dist/Client.js CHANGED
@@ -59,8 +59,8 @@ class MavenAGIClient {
59
59
  "X-Agent-Id": _options === null || _options === void 0 ? void 0 : _options.agentId,
60
60
  "X-Fern-Language": "JavaScript",
61
61
  "X-Fern-SDK-Name": "mavenagi",
62
- "X-Fern-SDK-Version": "1.2.4",
63
- "User-Agent": "mavenagi/1.2.4",
62
+ "X-Fern-SDK-Version": "1.2.6",
63
+ "User-Agent": "mavenagi/1.2.6",
64
64
  "X-Fern-Runtime": core.RUNTIME.type,
65
65
  "X-Fern-Runtime-Version": core.RUNTIME.version,
66
66
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -115,7 +115,17 @@ export declare class Actions {
115
115
  * @throws {@link MavenAGI.ServerError}
116
116
  *
117
117
  * @example
118
- * await client.actions.patch("actionReferenceId")
118
+ * await client.actions.patch("get-balance", {
119
+ * instructions: "Use this action when the user asks about their account balance or remaining credits.",
120
+ * llmInclusionStatus: "WHEN_RELEVANT",
121
+ * segmentId: {
122
+ * referenceId: "premium-users",
123
+ * appId: "my-billing-system",
124
+ * organizationId: "acme",
125
+ * agentId: "support",
126
+ * type: "SEGMENT"
127
+ * }
128
+ * })
119
129
  */
120
130
  patch(actionReferenceId: string, request?: MavenAGI.ActionPatchRequest, requestOptions?: Actions.RequestOptions): core.HttpResponsePromise<MavenAGI.ActionResponse>;
121
131
  private __patch;
@@ -375,7 +375,17 @@ class Actions {
375
375
  * @throws {@link MavenAGI.ServerError}
376
376
  *
377
377
  * @example
378
- * await client.actions.patch("actionReferenceId")
378
+ * await client.actions.patch("get-balance", {
379
+ * instructions: "Use this action when the user asks about their account balance or remaining credits.",
380
+ * llmInclusionStatus: "WHEN_RELEVANT",
381
+ * segmentId: {
382
+ * referenceId: "premium-users",
383
+ * appId: "my-billing-system",
384
+ * organizationId: "acme",
385
+ * agentId: "support",
386
+ * type: "SEGMENT"
387
+ * }
388
+ * })
379
389
  */
380
390
  patch(actionReferenceId, request = {}, requestOptions) {
381
391
  return core.HttpResponsePromise.fromPromise(this.__patch(actionReferenceId, request, requestOptions));
@@ -1,7 +1,17 @@
1
1
  import * as MavenAGI from "../../../../index";
2
2
  /**
3
3
  * @example
4
- * {}
4
+ * {
5
+ * instructions: "Use this action when the user asks about their account balance or remaining credits.",
6
+ * llmInclusionStatus: "WHEN_RELEVANT",
7
+ * segmentId: {
8
+ * referenceId: "premium-users",
9
+ * appId: "my-billing-system",
10
+ * organizationId: "acme",
11
+ * agentId: "support",
12
+ * type: "SEGMENT"
13
+ * }
14
+ * }
5
15
  */
6
16
  export interface ActionPatchRequest {
7
17
  /** The App ID of the action to patch. If not provided the ID of the calling app will be used. */
@@ -2,7 +2,7 @@ import * as MavenAGI from "../../../index";
2
2
  export interface ActionCapability extends MavenAGI.AgentCapabilityBase {
3
3
  userInteractionRequired: boolean;
4
4
  /** When user interaction is required, the name of the button that is shown to the end user to confirm execution of the action. Defaults to "Submit" if not supplied. */
5
- buttonName: string | null;
5
+ buttonName?: string;
6
6
  /** The parameters that the action uses as input. An action will only be executed when all of the required parameters are provided. Parameter values may be inferred from the user's conversation by the LLM. */
7
7
  userFormParameters: MavenAGI.ActionParameter[];
8
8
  precondition?: MavenAGI.Precondition;
@@ -128,9 +128,9 @@ export declare class Agents {
128
128
  * @throws {@link MavenAGI.ServerError}
129
129
  *
130
130
  * @example
131
- * await client.agents.patch("organizationReferenceId", "agentReferenceId", {})
131
+ * await client.agents.patch("organizationReferenceId", "agentReferenceId")
132
132
  */
133
- patch(organizationReferenceId: string, agentReferenceId: string, request: MavenAGI.AgentPatchRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<MavenAGI.Agent>;
133
+ patch(organizationReferenceId: string, agentReferenceId: string, request?: MavenAGI.AgentPatchRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<MavenAGI.Agent>;
134
134
  private __patch;
135
135
  /**
136
136
  * Delete an agent.
@@ -460,13 +460,13 @@ class Agents {
460
460
  * @throws {@link MavenAGI.ServerError}
461
461
  *
462
462
  * @example
463
- * await client.agents.patch("organizationReferenceId", "agentReferenceId", {})
463
+ * await client.agents.patch("organizationReferenceId", "agentReferenceId")
464
464
  */
465
- patch(organizationReferenceId, agentReferenceId, request, requestOptions) {
465
+ patch(organizationReferenceId, agentReferenceId, request = {}, requestOptions) {
466
466
  return core.HttpResponsePromise.fromPromise(this.__patch(organizationReferenceId, agentReferenceId, request, requestOptions));
467
467
  }
468
- __patch(organizationReferenceId, agentReferenceId, request, requestOptions) {
469
- return __awaiter(this, void 0, void 0, function* () {
468
+ __patch(organizationReferenceId_1, agentReferenceId_1) {
469
+ return __awaiter(this, arguments, void 0, function* (organizationReferenceId, agentReferenceId, request = {}, requestOptions) {
470
470
  var _a, _b, _c, _d, _e, _f, _g, _h;
471
471
  let _headers = (0, headers_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
472
472
  Authorization: yield this._getAuthorizationHeader(),
@@ -477,7 +477,7 @@ class Agents {
477
477
  url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.MavenAGIEnvironment.Production, `/v1/organizations/${encodeURIComponent(organizationReferenceId)}/agents/${encodeURIComponent(agentReferenceId)}`),
478
478
  method: "PATCH",
479
479
  headers: _headers,
480
- contentType: "application/json",
480
+ contentType: "application/merge-patch+json",
481
481
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
482
482
  requestType: "json",
483
483
  body: serializers.AgentPatchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
@@ -1 +1,2 @@
1
1
  export {};
2
+ export * from "./requests";
@@ -1,2 +1,17 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,27 @@
1
+ import * as MavenAGI from "../../../../index";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface AgentPatchRequest {
7
+ /** The name of the agent. */
8
+ name?: string;
9
+ /** The environment of the agent. */
10
+ environment?: MavenAGI.AgentEnvironment;
11
+ /** The agent's default timezone. This is used when a timezone is not set on a conversation. */
12
+ defaultTimezone?: string;
13
+ /** The PII categories that are enabled for the agent. */
14
+ enabledPiiCategories?: Set<MavenAGI.PiiCategory>;
15
+ /** The system fallback message. */
16
+ systemFallbackMessage?: string | null;
17
+ /** The overall persona of the agent. */
18
+ persona?: MavenAGI.LlmPersona;
19
+ /** Additional text directly appended to the prompt. */
20
+ additionalPromptText?: string | null;
21
+ /** LLM prompt for category generation. */
22
+ categoryGenerationPromptText?: string | null;
23
+ /** LLM prompt for generating a response when the user's question has been detected as unsafe. */
24
+ contentSafetyViolationResponsePromptText?: string | null;
25
+ /** Return the system fallback message on all questions that have no relevant knowledge bases or actions. */
26
+ rejectQuestionsWithoutKnowledge?: boolean;
27
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export { type AgentPatchRequest } from "./AgentPatchRequest";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -20,4 +20,12 @@ export interface Agent {
20
20
  * `UsUkPassportNumber`, `UsSocialSecurityNumber`.
21
21
  */
22
22
  enabledPiiCategories: Set<MavenAGI.PiiCategory>;
23
+ /**
24
+ * Text shown to end users when the system encounters an error while generating a bot response message.
25
+ *
26
+ * This text is also used when a content safety violation is detected, unless `contentSafetyViolationPromptText` is set.
27
+ */
28
+ systemFallbackMessage?: string;
29
+ /** Agent prompting settings. */
30
+ prompting: MavenAGI.AgentPrompting;
23
31
  }
@@ -0,0 +1,23 @@
1
+ import * as MavenAGI from "../../../index";
2
+ export interface AgentPrompting {
3
+ /** The overall persona of the agent. */
4
+ persona: MavenAGI.LlmPersona;
5
+ /** Additional text directly appended to the prompt. This field is replaced by Knowledge Documents with `llmInclusionsStatus` set to `ALWAYS`. */
6
+ additionalPromptText?: string;
7
+ /**
8
+ * LLM prompt for category generation.
9
+ *
10
+ * Use this to specify a fixed set of categories that an LLM should choose from when analyzing a conversation.
11
+ * When not set uses a default prompt which gives the LLM flexibility to determine appropriate categories on its own.
12
+ */
13
+ categoryGenerationPromptText?: string;
14
+ /**
15
+ * LLM prompt for generating a response when the user's question has been detected as unsafe.
16
+ *
17
+ * Use this to provide custom LLM generated replies when dealing with content safety violations.
18
+ * When not set, the system fallback message will be used and replies will not be personalized by the LLM as it will not be involved.
19
+ */
20
+ contentSafetyViolationResponsePromptText?: string;
21
+ /** Return the system fallback message on all questions that have no relevant knowledge bases or actions. */
22
+ rejectQuestionsWithoutKnowledge: boolean;
23
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,8 +2,8 @@ export * from "./PiiCategory";
2
2
  export * from "./AgentEnvironment";
3
3
  export * from "./Agent";
4
4
  export * from "./CreateAgentRequest";
5
- export * from "./AgentPatchRequest";
6
5
  export * from "./AgentsSearchRequest";
7
6
  export * from "./AgentField";
8
7
  export * from "./AgentFilter";
9
8
  export * from "./AgentsSearchResponse";
9
+ export * from "./AgentPrompting";
@@ -18,8 +18,8 @@ __exportStar(require("./PiiCategory"), exports);
18
18
  __exportStar(require("./AgentEnvironment"), exports);
19
19
  __exportStar(require("./Agent"), exports);
20
20
  __exportStar(require("./CreateAgentRequest"), exports);
21
- __exportStar(require("./AgentPatchRequest"), exports);
22
21
  __exportStar(require("./AgentsSearchRequest"), exports);
23
22
  __exportStar(require("./AgentField"), exports);
24
23
  __exportStar(require("./AgentFilter"), exports);
25
24
  __exportStar(require("./AgentsSearchResponse"), exports);
25
+ __exportStar(require("./AgentPrompting"), exports);
@@ -136,6 +136,16 @@ export declare class Analytics {
136
136
  */
137
137
  getConversationChart(request: MavenAGI.ConversationChartRequest, requestOptions?: Analytics.RequestOptions): core.HttpResponsePromise<MavenAGI.ChartResponse>;
138
138
  private __getConversationChart;
139
+ /**
140
+ * Export the conversation analytics table to a CSV file.
141
+ *
142
+ * This outputs the current table view defined by the request. For most programmatic use cases, prefer `getConversationTable` and format client-side. The CSV format may change and should not be relied upon by code consumers. A maximum of 10,000 rows can be exported at a time.
143
+ * @throws {@link MavenAGI.NotFoundError}
144
+ * @throws {@link MavenAGI.BadRequestError}
145
+ * @throws {@link MavenAGI.ServerError}
146
+ */
147
+ exportConversationTable(request: MavenAGI.ConversationTableRequest, requestOptions?: Analytics.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
148
+ private __exportConversationTable;
139
149
  /**
140
150
  * Retrieves structured feedback data formatted as a table, allowing users to group, filter, and define specific metrics to display as columns.
141
151
  *