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