mavenagi 0.0.0-alpha.4 → 0.0.0-alpha.5
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 +5 -5
- package/Client.js +3 -3
- package/README.md +15 -31
- package/api/resources/actions/client/Client.d.ts +19 -65
- package/api/resources/actions/client/Client.js +31 -292
- package/api/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +1 -7
- package/api/resources/actions/types/ActionParameter.d.ts +1 -0
- package/api/resources/actions/types/ActionRequest.d.ts +21 -0
- package/api/resources/actions/types/ActionResponse.d.ts +25 -0
- package/api/resources/actions/types/index.d.ts +3 -4
- package/api/resources/actions/types/index.js +3 -4
- package/api/resources/commons/types/EntityId.d.ts +14 -0
- package/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/api/resources/commons/types/EntityType.d.ts +14 -0
- package/api/resources/commons/types/EntityType.js +13 -0
- package/api/resources/commons/types/index.d.ts +3 -0
- package/api/resources/commons/types/index.js +3 -0
- package/api/resources/conversation/client/Client.d.ts +20 -3
- package/api/resources/conversation/client/Client.js +118 -25
- package/api/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/api/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/api/resources/index.d.ts +1 -1
- package/api/resources/index.js +1 -1
- package/api/resources/knowledge/client/Client.d.ts +2 -2
- package/api/resources/knowledge/client/Client.js +21 -21
- package/api/resources/knowledge/types/KnowledgeBase.d.ts +1 -1
- package/api/resources/triggers/client/Client.d.ts +14 -12
- package/api/resources/triggers/client/Client.js +25 -23
- package/{dist/api/resources/triggers/types/EventTrigger.d.ts → api/resources/triggers/types/EventTriggerBase.d.ts} +1 -3
- package/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/api/resources/triggers/types/EventTriggerResponse.d.ts +22 -0
- package/api/resources/triggers/types/index.d.ts +3 -1
- package/api/resources/triggers/types/index.js +3 -1
- package/api/resources/{user → users}/client/Client.d.ts +12 -12
- package/api/resources/{user → users}/client/Client.js +11 -11
- package/dist/Client.d.ts +5 -5
- package/dist/Client.js +3 -3
- package/dist/api/resources/actions/client/Client.d.ts +19 -65
- package/dist/api/resources/actions/client/Client.js +31 -292
- package/dist/api/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +1 -7
- package/dist/api/resources/actions/types/ActionParameter.d.ts +1 -0
- package/dist/api/resources/actions/types/ActionRequest.d.ts +21 -0
- package/dist/api/resources/actions/types/ActionResponse.d.ts +25 -0
- package/dist/api/resources/actions/types/ActionResponse.js +4 -0
- package/dist/api/resources/actions/types/index.d.ts +3 -4
- package/dist/api/resources/actions/types/index.js +3 -4
- package/dist/api/resources/commons/types/EntityId.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityId.js +4 -0
- package/dist/api/resources/commons/types/EntityIdBase.d.ts +10 -0
- package/dist/api/resources/commons/types/EntityIdBase.js +4 -0
- package/dist/api/resources/commons/types/EntityType.d.ts +14 -0
- package/dist/api/resources/commons/types/EntityType.js +13 -0
- package/dist/api/resources/commons/types/index.d.ts +3 -0
- package/dist/api/resources/commons/types/index.js +3 -0
- package/dist/api/resources/conversation/client/Client.d.ts +20 -3
- package/dist/api/resources/conversation/client/Client.js +118 -25
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/dist/api/resources/index.d.ts +1 -1
- package/dist/api/resources/index.js +1 -1
- package/dist/api/resources/knowledge/client/Client.d.ts +2 -2
- package/dist/api/resources/knowledge/client/Client.js +21 -21
- package/dist/api/resources/knowledge/types/KnowledgeBase.d.ts +1 -1
- package/dist/api/resources/triggers/client/Client.d.ts +14 -12
- package/dist/api/resources/triggers/client/Client.js +25 -23
- package/{api/resources/triggers/types/EventTrigger.d.ts → dist/api/resources/triggers/types/EventTriggerBase.d.ts} +1 -3
- package/dist/api/resources/triggers/types/EventTriggerBase.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.d.ts +18 -0
- package/dist/api/resources/triggers/types/EventTriggerRequest.js +4 -0
- package/dist/api/resources/triggers/types/EventTriggerResponse.d.ts +22 -0
- package/dist/api/resources/triggers/types/EventTriggerResponse.js +4 -0
- package/dist/api/resources/triggers/types/index.d.ts +3 -1
- package/dist/api/resources/triggers/types/index.js +3 -1
- package/dist/api/resources/{user → users}/client/Client.d.ts +12 -12
- package/dist/api/resources/{user → users}/client/Client.js +11 -11
- package/dist/serialization/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +2 -5
- package/{serialization/resources/actions/types/Action.js → dist/serialization/resources/actions/types/ActionBase.js} +1 -4
- package/dist/serialization/resources/actions/types/ActionParameter.d.ts +1 -0
- package/dist/serialization/resources/actions/types/ActionParameter.js +1 -0
- package/dist/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/dist/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/dist/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/dist/serialization/resources/actions/types/index.d.ts +3 -4
- package/dist/serialization/resources/actions/types/index.js +3 -4
- package/dist/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/dist/serialization/resources/commons/types/EntityId.js +14 -0
- package/{serialization/resources/actions/types/ActionSetBase.d.ts → dist/serialization/resources/commons/types/EntityIdBase.d.ts} +3 -4
- package/dist/serialization/resources/commons/types/EntityIdBase.js +7 -0
- package/dist/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/dist/serialization/resources/commons/types/EntityType.js +14 -0
- package/dist/serialization/resources/commons/types/index.d.ts +3 -0
- package/dist/serialization/resources/commons/types/index.js +3 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/dist/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/dist/serialization/resources/conversation/client/index.d.ts +1 -0
- package/dist/serialization/resources/conversation/client/index.js +1 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/ConversationBase.js +0 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +2 -0
- package/dist/serialization/resources/triggers/types/{EventTrigger.d.ts → EventTriggerBase.d.ts} +2 -3
- package/dist/serialization/resources/triggers/types/{EventTrigger.js → EventTriggerBase.js} +1 -2
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/dist/serialization/resources/triggers/types/EventTriggerResponse.d.ts +14 -0
- package/dist/serialization/resources/triggers/types/EventTriggerResponse.js +11 -0
- package/dist/serialization/resources/triggers/types/index.d.ts +3 -1
- package/dist/serialization/resources/triggers/types/index.js +3 -1
- package/package.json +1 -1
- package/serialization/resources/actions/types/{Action.d.ts → ActionBase.d.ts} +2 -5
- package/{dist/serialization/resources/actions/types/Action.js → serialization/resources/actions/types/ActionBase.js} +1 -4
- package/serialization/resources/actions/types/ActionParameter.d.ts +1 -0
- package/serialization/resources/actions/types/ActionParameter.js +1 -0
- package/serialization/resources/actions/types/ActionRequest.d.ts +14 -0
- package/serialization/resources/actions/types/ActionRequest.js +11 -0
- package/serialization/resources/actions/types/ActionResponse.d.ts +14 -0
- package/serialization/resources/actions/types/ActionResponse.js +11 -0
- package/serialization/resources/actions/types/index.d.ts +3 -4
- package/serialization/resources/actions/types/index.js +3 -4
- package/serialization/resources/commons/types/EntityId.d.ts +17 -0
- package/serialization/resources/commons/types/EntityId.js +14 -0
- package/{dist/serialization/resources/actions/types/ActionSetBase.d.ts → serialization/resources/commons/types/EntityIdBase.d.ts} +3 -4
- package/serialization/resources/commons/types/EntityIdBase.js +7 -0
- package/serialization/resources/commons/types/EntityType.d.ts +10 -0
- package/serialization/resources/commons/types/EntityType.js +14 -0
- package/serialization/resources/commons/types/index.d.ts +3 -0
- package/serialization/resources/commons/types/index.js +3 -0
- package/serialization/resources/conversation/client/addConversationMetadata.d.ts +13 -0
- package/serialization/resources/conversation/client/addConversationMetadata.js +6 -0
- package/serialization/resources/conversation/client/index.d.ts +1 -0
- package/serialization/resources/conversation/client/index.js +1 -0
- package/serialization/resources/conversation/types/ConversationBase.d.ts +0 -2
- package/serialization/resources/conversation/types/ConversationBase.js +0 -2
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationRequest.js +2 -0
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +2 -0
- package/serialization/resources/conversation/types/ConversationResponse.js +2 -0
- package/serialization/resources/triggers/types/{EventTrigger.d.ts → EventTriggerBase.d.ts} +2 -3
- package/serialization/resources/triggers/types/{EventTrigger.js → EventTriggerBase.js} +1 -2
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerRequest.js +11 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.d.ts +14 -0
- package/serialization/resources/triggers/types/EventTriggerResponse.js +11 -0
- package/serialization/resources/triggers/types/index.d.ts +3 -1
- package/serialization/resources/triggers/types/index.js +3 -1
- package/api/resources/actions/types/ActionSetBase.d.ts +0 -9
- package/api/resources/actions/types/ActionSetRequest.d.ts +0 -6
- package/api/resources/actions/types/ActionSetResponse.d.ts +0 -6
- package/dist/api/resources/actions/types/ActionSetBase.d.ts +0 -9
- package/dist/api/resources/actions/types/ActionSetRequest.d.ts +0 -6
- package/dist/api/resources/actions/types/ActionSetResponse.d.ts +0 -6
- package/dist/serialization/resources/actions/types/ActionSetBase.js +0 -8
- package/dist/serialization/resources/actions/types/ActionSetRequest.d.ts +0 -12
- package/dist/serialization/resources/actions/types/ActionSetRequest.js +0 -6
- package/dist/serialization/resources/actions/types/ActionSetResponse.d.ts +0 -12
- package/dist/serialization/resources/actions/types/ActionSetResponse.js +0 -6
- package/serialization/resources/actions/types/ActionSetBase.js +0 -8
- package/serialization/resources/actions/types/ActionSetRequest.d.ts +0 -12
- package/serialization/resources/actions/types/ActionSetRequest.js +0 -6
- package/serialization/resources/actions/types/ActionSetResponse.d.ts +0 -12
- package/serialization/resources/actions/types/ActionSetResponse.js +0 -6
- /package/api/resources/actions/types/{Action.js → ActionBase.js} +0 -0
- /package/api/resources/actions/types/{ActionSetBase.js → ActionRequest.js} +0 -0
- /package/api/resources/actions/types/{ActionSetRequest.js → ActionResponse.js} +0 -0
- /package/api/resources/{actions/types/ActionSetResponse.js → commons/types/EntityId.js} +0 -0
- /package/api/resources/{triggers/types/EventTrigger.js → commons/types/EntityIdBase.js} +0 -0
- /package/{dist/api/resources/actions/types/Action.js → api/resources/triggers/types/EventTriggerBase.js} +0 -0
- /package/{dist/api/resources/actions/types/ActionSetBase.js → api/resources/triggers/types/EventTriggerRequest.js} +0 -0
- /package/{dist/api/resources/actions/types/ActionSetRequest.js → api/resources/triggers/types/EventTriggerResponse.js} +0 -0
- /package/api/resources/{user → users}/client/index.d.ts +0 -0
- /package/api/resources/{user → users}/client/index.js +0 -0
- /package/api/resources/{user → users}/index.d.ts +0 -0
- /package/api/resources/{user → users}/index.js +0 -0
- /package/dist/api/resources/actions/types/{ActionSetResponse.js → ActionBase.js} +0 -0
- /package/dist/api/resources/{triggers/types/EventTrigger.js → actions/types/ActionRequest.js} +0 -0
- /package/dist/api/resources/{user → users}/client/index.d.ts +0 -0
- /package/dist/api/resources/{user → users}/client/index.js +0 -0
- /package/dist/api/resources/{user → users}/index.d.ts +0 -0
- /package/dist/api/resources/{user → users}/index.js +0 -0
|
@@ -20,270 +20,10 @@ export class Actions {
|
|
|
20
20
|
constructor(_options) {
|
|
21
21
|
this._options = _options;
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Update an action set or create it if it doesn't exist
|
|
25
|
-
*
|
|
26
|
-
* @param {MavenAGI.ActionSetRequest} request
|
|
27
|
-
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
|
-
*
|
|
29
|
-
* @throws {@link MavenAGI.NotFoundError}
|
|
30
|
-
* @throws {@link MavenAGI.BadRequestError}
|
|
31
|
-
* @throws {@link MavenAGI.ServerError}
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* await client.actions.createActionSet({
|
|
35
|
-
* id: "string",
|
|
36
|
-
* name: "string"
|
|
37
|
-
* })
|
|
38
|
-
*/
|
|
39
|
-
createActionSet(request, requestOptions) {
|
|
40
|
-
var _a, _b;
|
|
41
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
43
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, "/v1/actions/sets"),
|
|
44
|
-
method: "POST",
|
|
45
|
-
headers: {
|
|
46
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
47
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
48
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
49
|
-
"X-Fern-Language": "JavaScript",
|
|
50
|
-
"X-Fern-SDK-Name": "mavenagi",
|
|
51
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
52
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
53
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
54
|
-
},
|
|
55
|
-
contentType: "application/json",
|
|
56
|
-
body: yield serializers.ActionSetRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
57
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
58
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
59
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
60
|
-
});
|
|
61
|
-
if (_response.ok) {
|
|
62
|
-
return yield serializers.ActionSetResponse.parseOrThrow(_response.body, {
|
|
63
|
-
unrecognizedObjectKeys: "passthrough",
|
|
64
|
-
allowUnrecognizedUnionMembers: true,
|
|
65
|
-
allowUnrecognizedEnumValues: true,
|
|
66
|
-
breadcrumbsPrefix: ["response"],
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
if (_response.error.reason === "status-code") {
|
|
70
|
-
switch (_response.error.statusCode) {
|
|
71
|
-
case 404:
|
|
72
|
-
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
73
|
-
unrecognizedObjectKeys: "passthrough",
|
|
74
|
-
allowUnrecognizedUnionMembers: true,
|
|
75
|
-
allowUnrecognizedEnumValues: true,
|
|
76
|
-
breadcrumbsPrefix: ["response"],
|
|
77
|
-
}));
|
|
78
|
-
case 400:
|
|
79
|
-
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
80
|
-
unrecognizedObjectKeys: "passthrough",
|
|
81
|
-
allowUnrecognizedUnionMembers: true,
|
|
82
|
-
allowUnrecognizedEnumValues: true,
|
|
83
|
-
breadcrumbsPrefix: ["response"],
|
|
84
|
-
}));
|
|
85
|
-
case 500:
|
|
86
|
-
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
87
|
-
unrecognizedObjectKeys: "passthrough",
|
|
88
|
-
allowUnrecognizedUnionMembers: true,
|
|
89
|
-
allowUnrecognizedEnumValues: true,
|
|
90
|
-
breadcrumbsPrefix: ["response"],
|
|
91
|
-
}));
|
|
92
|
-
default:
|
|
93
|
-
throw new errors.MavenAGIError({
|
|
94
|
-
statusCode: _response.error.statusCode,
|
|
95
|
-
body: _response.error.body,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
switch (_response.error.reason) {
|
|
100
|
-
case "non-json":
|
|
101
|
-
throw new errors.MavenAGIError({
|
|
102
|
-
statusCode: _response.error.statusCode,
|
|
103
|
-
body: _response.error.rawBody,
|
|
104
|
-
});
|
|
105
|
-
case "timeout":
|
|
106
|
-
throw new errors.MavenAGITimeoutError();
|
|
107
|
-
case "unknown":
|
|
108
|
-
throw new errors.MavenAGIError({
|
|
109
|
-
message: _response.error.errorMessage,
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Get an action set by its supplied ID
|
|
116
|
-
*
|
|
117
|
-
* @param {string} actionSetId - The ID of the action set to get
|
|
118
|
-
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
119
|
-
*
|
|
120
|
-
* @throws {@link MavenAGI.NotFoundError}
|
|
121
|
-
* @throws {@link MavenAGI.BadRequestError}
|
|
122
|
-
* @throws {@link MavenAGI.ServerError}
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* await client.actions.getActionSet("string")
|
|
126
|
-
*/
|
|
127
|
-
getActionSet(actionSetId, requestOptions) {
|
|
128
|
-
var _a, _b;
|
|
129
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
131
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/sets/${encodeURIComponent(actionSetId)}`),
|
|
132
|
-
method: "GET",
|
|
133
|
-
headers: {
|
|
134
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
135
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
136
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
137
|
-
"X-Fern-Language": "JavaScript",
|
|
138
|
-
"X-Fern-SDK-Name": "mavenagi",
|
|
139
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
140
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
141
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
142
|
-
},
|
|
143
|
-
contentType: "application/json",
|
|
144
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
145
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
146
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
147
|
-
});
|
|
148
|
-
if (_response.ok) {
|
|
149
|
-
return yield serializers.ActionSetResponse.parseOrThrow(_response.body, {
|
|
150
|
-
unrecognizedObjectKeys: "passthrough",
|
|
151
|
-
allowUnrecognizedUnionMembers: true,
|
|
152
|
-
allowUnrecognizedEnumValues: true,
|
|
153
|
-
breadcrumbsPrefix: ["response"],
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
if (_response.error.reason === "status-code") {
|
|
157
|
-
switch (_response.error.statusCode) {
|
|
158
|
-
case 404:
|
|
159
|
-
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
160
|
-
unrecognizedObjectKeys: "passthrough",
|
|
161
|
-
allowUnrecognizedUnionMembers: true,
|
|
162
|
-
allowUnrecognizedEnumValues: true,
|
|
163
|
-
breadcrumbsPrefix: ["response"],
|
|
164
|
-
}));
|
|
165
|
-
case 400:
|
|
166
|
-
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
167
|
-
unrecognizedObjectKeys: "passthrough",
|
|
168
|
-
allowUnrecognizedUnionMembers: true,
|
|
169
|
-
allowUnrecognizedEnumValues: true,
|
|
170
|
-
breadcrumbsPrefix: ["response"],
|
|
171
|
-
}));
|
|
172
|
-
case 500:
|
|
173
|
-
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
174
|
-
unrecognizedObjectKeys: "passthrough",
|
|
175
|
-
allowUnrecognizedUnionMembers: true,
|
|
176
|
-
allowUnrecognizedEnumValues: true,
|
|
177
|
-
breadcrumbsPrefix: ["response"],
|
|
178
|
-
}));
|
|
179
|
-
default:
|
|
180
|
-
throw new errors.MavenAGIError({
|
|
181
|
-
statusCode: _response.error.statusCode,
|
|
182
|
-
body: _response.error.body,
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
switch (_response.error.reason) {
|
|
187
|
-
case "non-json":
|
|
188
|
-
throw new errors.MavenAGIError({
|
|
189
|
-
statusCode: _response.error.statusCode,
|
|
190
|
-
body: _response.error.rawBody,
|
|
191
|
-
});
|
|
192
|
-
case "timeout":
|
|
193
|
-
throw new errors.MavenAGITimeoutError();
|
|
194
|
-
case "unknown":
|
|
195
|
-
throw new errors.MavenAGIError({
|
|
196
|
-
message: _response.error.errorMessage,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Delete an action set
|
|
203
|
-
*
|
|
204
|
-
* @param {string} actionSetId - The ID of the action set to delete
|
|
205
|
-
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
206
|
-
*
|
|
207
|
-
* @throws {@link MavenAGI.NotFoundError}
|
|
208
|
-
* @throws {@link MavenAGI.BadRequestError}
|
|
209
|
-
* @throws {@link MavenAGI.ServerError}
|
|
210
|
-
*
|
|
211
|
-
* @example
|
|
212
|
-
* await client.actions.deleteActionSet("string")
|
|
213
|
-
*/
|
|
214
|
-
deleteActionSet(actionSetId, requestOptions) {
|
|
215
|
-
var _a, _b;
|
|
216
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
-
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
218
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/sets/${encodeURIComponent(actionSetId)}`),
|
|
219
|
-
method: "DELETE",
|
|
220
|
-
headers: {
|
|
221
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
222
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.organizationId),
|
|
223
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
224
|
-
"X-Fern-Language": "JavaScript",
|
|
225
|
-
"X-Fern-SDK-Name": "mavenagi",
|
|
226
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.4",
|
|
227
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
228
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
229
|
-
},
|
|
230
|
-
contentType: "application/json",
|
|
231
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
232
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
233
|
-
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
234
|
-
});
|
|
235
|
-
if (_response.ok) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
if (_response.error.reason === "status-code") {
|
|
239
|
-
switch (_response.error.statusCode) {
|
|
240
|
-
case 404:
|
|
241
|
-
throw new MavenAGI.NotFoundError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
242
|
-
unrecognizedObjectKeys: "passthrough",
|
|
243
|
-
allowUnrecognizedUnionMembers: true,
|
|
244
|
-
allowUnrecognizedEnumValues: true,
|
|
245
|
-
breadcrumbsPrefix: ["response"],
|
|
246
|
-
}));
|
|
247
|
-
case 400:
|
|
248
|
-
throw new MavenAGI.BadRequestError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
249
|
-
unrecognizedObjectKeys: "passthrough",
|
|
250
|
-
allowUnrecognizedUnionMembers: true,
|
|
251
|
-
allowUnrecognizedEnumValues: true,
|
|
252
|
-
breadcrumbsPrefix: ["response"],
|
|
253
|
-
}));
|
|
254
|
-
case 500:
|
|
255
|
-
throw new MavenAGI.ServerError(yield serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
256
|
-
unrecognizedObjectKeys: "passthrough",
|
|
257
|
-
allowUnrecognizedUnionMembers: true,
|
|
258
|
-
allowUnrecognizedEnumValues: true,
|
|
259
|
-
breadcrumbsPrefix: ["response"],
|
|
260
|
-
}));
|
|
261
|
-
default:
|
|
262
|
-
throw new errors.MavenAGIError({
|
|
263
|
-
statusCode: _response.error.statusCode,
|
|
264
|
-
body: _response.error.body,
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
switch (_response.error.reason) {
|
|
269
|
-
case "non-json":
|
|
270
|
-
throw new errors.MavenAGIError({
|
|
271
|
-
statusCode: _response.error.statusCode,
|
|
272
|
-
body: _response.error.rawBody,
|
|
273
|
-
});
|
|
274
|
-
case "timeout":
|
|
275
|
-
throw new errors.MavenAGITimeoutError();
|
|
276
|
-
case "unknown":
|
|
277
|
-
throw new errors.MavenAGIError({
|
|
278
|
-
message: _response.error.errorMessage,
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
23
|
/**
|
|
284
24
|
* Update an action or create it if it doesn't exist
|
|
285
25
|
*
|
|
286
|
-
* @param {MavenAGI.
|
|
26
|
+
* @param {MavenAGI.ActionRequest} request
|
|
287
27
|
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
288
28
|
*
|
|
289
29
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -291,19 +31,18 @@ export class Actions {
|
|
|
291
31
|
* @throws {@link MavenAGI.ServerError}
|
|
292
32
|
*
|
|
293
33
|
* @example
|
|
294
|
-
* await client.actions.
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
* name: "
|
|
299
|
-
* description: "
|
|
300
|
-
* userInteractionRequired:
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
* userFormParameters: [{}]
|
|
34
|
+
* await client.actions.createOrUpdateAction({
|
|
35
|
+
* entityId: {
|
|
36
|
+
* referenceId: "get-balance"
|
|
37
|
+
* },
|
|
38
|
+
* name: "Get the user's balance",
|
|
39
|
+
* description: "This action calls an API to get the user's current balance.",
|
|
40
|
+
* userInteractionRequired: false,
|
|
41
|
+
* requiredUserContextFieldNames: new Set(["my-billing-system.userId"]),
|
|
42
|
+
* userFormParameters: []
|
|
304
43
|
* })
|
|
305
44
|
*/
|
|
306
|
-
|
|
45
|
+
createOrUpdateAction(request, requestOptions) {
|
|
307
46
|
var _a, _b;
|
|
308
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
309
48
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
@@ -311,22 +50,22 @@ export class Actions {
|
|
|
311
50
|
method: "PUT",
|
|
312
51
|
headers: {
|
|
313
52
|
Authorization: yield this._getAuthorizationHeader(),
|
|
314
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
315
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
53
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
54
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
316
55
|
"X-Fern-Language": "JavaScript",
|
|
317
56
|
"X-Fern-SDK-Name": "mavenagi",
|
|
318
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
57
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
319
58
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
320
59
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
321
60
|
},
|
|
322
61
|
contentType: "application/json",
|
|
323
|
-
body: yield serializers.
|
|
62
|
+
body: yield serializers.ActionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
324
63
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
325
64
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
326
65
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
327
66
|
});
|
|
328
67
|
if (_response.ok) {
|
|
329
|
-
return yield serializers.
|
|
68
|
+
return yield serializers.ActionResponse.parseOrThrow(_response.body, {
|
|
330
69
|
unrecognizedObjectKeys: "passthrough",
|
|
331
70
|
allowUnrecognizedUnionMembers: true,
|
|
332
71
|
allowUnrecognizedEnumValues: true,
|
|
@@ -381,7 +120,7 @@ export class Actions {
|
|
|
381
120
|
/**
|
|
382
121
|
* Get an action by its supplied ID
|
|
383
122
|
*
|
|
384
|
-
* @param {string}
|
|
123
|
+
* @param {string} referenceId - The reference ID of the action to get. All other entity ID fields are inferred from the request.
|
|
385
124
|
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
386
125
|
*
|
|
387
126
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -389,21 +128,21 @@ export class Actions {
|
|
|
389
128
|
* @throws {@link MavenAGI.ServerError}
|
|
390
129
|
*
|
|
391
130
|
* @example
|
|
392
|
-
* await client.actions.getAction("
|
|
131
|
+
* await client.actions.getAction("get-balance")
|
|
393
132
|
*/
|
|
394
|
-
getAction(
|
|
133
|
+
getAction(referenceId, requestOptions) {
|
|
395
134
|
var _a, _b;
|
|
396
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
397
136
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
398
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(
|
|
137
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(referenceId)}`),
|
|
399
138
|
method: "GET",
|
|
400
139
|
headers: {
|
|
401
140
|
Authorization: yield this._getAuthorizationHeader(),
|
|
402
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
403
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
141
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
142
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
404
143
|
"X-Fern-Language": "JavaScript",
|
|
405
144
|
"X-Fern-SDK-Name": "mavenagi",
|
|
406
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
145
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
407
146
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
408
147
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
409
148
|
},
|
|
@@ -413,7 +152,7 @@ export class Actions {
|
|
|
413
152
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
414
153
|
});
|
|
415
154
|
if (_response.ok) {
|
|
416
|
-
return yield serializers.
|
|
155
|
+
return yield serializers.ActionResponse.parseOrThrow(_response.body, {
|
|
417
156
|
unrecognizedObjectKeys: "passthrough",
|
|
418
157
|
allowUnrecognizedUnionMembers: true,
|
|
419
158
|
allowUnrecognizedEnumValues: true,
|
|
@@ -468,7 +207,7 @@ export class Actions {
|
|
|
468
207
|
/**
|
|
469
208
|
* Delete an action
|
|
470
209
|
*
|
|
471
|
-
* @param {string}
|
|
210
|
+
* @param {string} referenceId - The reference ID of the action to unregister. All other entity ID fields are inferred from the request.
|
|
472
211
|
* @param {Actions.RequestOptions} requestOptions - Request-specific configuration.
|
|
473
212
|
*
|
|
474
213
|
* @throws {@link MavenAGI.NotFoundError}
|
|
@@ -476,21 +215,21 @@ export class Actions {
|
|
|
476
215
|
* @throws {@link MavenAGI.ServerError}
|
|
477
216
|
*
|
|
478
217
|
* @example
|
|
479
|
-
* await client.actions.deleteAction("
|
|
218
|
+
* await client.actions.deleteAction("get-balance")
|
|
480
219
|
*/
|
|
481
|
-
deleteAction(
|
|
220
|
+
deleteAction(referenceId, requestOptions) {
|
|
482
221
|
var _a, _b;
|
|
483
222
|
return __awaiter(this, void 0, void 0, function* () {
|
|
484
223
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
485
|
-
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(
|
|
224
|
+
url: urlJoin((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.MavenAGIEnvironment.Production, `/v1/actions/${encodeURIComponent(referenceId)}`),
|
|
486
225
|
method: "DELETE",
|
|
487
226
|
headers: {
|
|
488
227
|
Authorization: yield this._getAuthorizationHeader(),
|
|
489
|
-
"X-Organization-Id": yield core.Supplier.get(this._options.
|
|
490
|
-
"X-Agent-Id": yield core.Supplier.get(this._options.
|
|
228
|
+
"X-Organization-Id": yield core.Supplier.get(this._options.xOrganizationId),
|
|
229
|
+
"X-Agent-Id": yield core.Supplier.get(this._options.xAgentId),
|
|
491
230
|
"X-Fern-Language": "JavaScript",
|
|
492
231
|
"X-Fern-SDK-Name": "mavenagi",
|
|
493
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
232
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.5",
|
|
494
233
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
495
234
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
496
235
|
},
|
|
@@ -2,13 +2,7 @@
|
|
|
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
|
|
6
|
-
/** Externally supplied ID to uniquely identify this action */
|
|
7
|
-
id: string;
|
|
8
|
-
/** The ID of the action set this action belongs to. Must be an existing action set ID. */
|
|
9
|
-
actionSetId: string;
|
|
10
|
-
/** The maven app id of the app that runs this action */
|
|
11
|
-
appId: string;
|
|
5
|
+
export interface ActionBase {
|
|
12
6
|
/** The name of the action */
|
|
13
7
|
name: string;
|
|
14
8
|
/** The description of the action. This helps Maven decide when to trigger the action and is not displayed directly to the end user. */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as MavenAGI from "../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* entityId: {
|
|
9
|
+
* referenceId: "get-balance"
|
|
10
|
+
* },
|
|
11
|
+
* name: "Get the user's balance",
|
|
12
|
+
* description: "This action calls an API to get the user's current balance.",
|
|
13
|
+
* userInteractionRequired: false,
|
|
14
|
+
* requiredUserContextFieldNames: new Set(["my-billing-system.userId"]),
|
|
15
|
+
* userFormParameters: []
|
|
16
|
+
* }
|
|
17
|
+
*/
|
|
18
|
+
export interface ActionRequest extends MavenAGI.ActionBase {
|
|
19
|
+
/** ID that uniquely identifies this action */
|
|
20
|
+
entityId: MavenAGI.EntityIdBase;
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as MavenAGI from "../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* entityId: {
|
|
9
|
+
* referenceId: "get-balance",
|
|
10
|
+
* appId: "my-billing-system",
|
|
11
|
+
* organizationId: "acme",
|
|
12
|
+
* agentId: "support",
|
|
13
|
+
* type: MavenAGI.EntityType.Action
|
|
14
|
+
* },
|
|
15
|
+
* name: "Get the user's balance",
|
|
16
|
+
* description: "This action calls an API to get the user's current balance.",
|
|
17
|
+
* userInteractionRequired: false,
|
|
18
|
+
* requiredUserContextFieldNames: new Set(["my-billing-system.userId"]),
|
|
19
|
+
* userFormParameters: []
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
export interface ActionResponse extends MavenAGI.ActionBase {
|
|
23
|
+
/** ID that uniquely identifies this action */
|
|
24
|
+
entityId: MavenAGI.EntityId;
|
|
25
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./ActionSetRequest";
|
|
3
|
-
export * from "./ActionSetResponse";
|
|
4
|
-
export * from "./Action";
|
|
1
|
+
export * from "./ActionBase";
|
|
5
2
|
export * from "./ActionParameter";
|
|
3
|
+
export * from "./ActionRequest";
|
|
4
|
+
export * from "./ActionResponse";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./ActionSetRequest";
|
|
3
|
-
export * from "./ActionSetResponse";
|
|
4
|
-
export * from "./Action";
|
|
1
|
+
export * from "./ActionBase";
|
|
5
2
|
export * from "./ActionParameter";
|
|
3
|
+
export * from "./ActionRequest";
|
|
4
|
+
export * from "./ActionResponse";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as MavenAGI from "../../../index";
|
|
5
|
+
export interface EntityId extends MavenAGI.EntityIdBase {
|
|
6
|
+
/** The object type */
|
|
7
|
+
type: MavenAGI.EntityType;
|
|
8
|
+
/** The ID of the application that created this object */
|
|
9
|
+
appId: string;
|
|
10
|
+
/** The ID of the organization that this object belongs too */
|
|
11
|
+
organizationId: string;
|
|
12
|
+
/** The ID of the agent that this object belongs too */
|
|
13
|
+
agentId: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* All other entityId fields are inferred from the API request.
|
|
6
|
+
*/
|
|
7
|
+
export interface EntityIdBase {
|
|
8
|
+
/** Externally supplied ID to uniquely identify this object. Is globally unique when combined with all other entityId fields (type, appId, organizationId, agentId) */
|
|
9
|
+
referenceId: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export declare type EntityType = "CONVERSATION" | "CONVERSATION_MESSAGE" | "KNOWLEDGE_BASE" | "KNOWLEDGE_DOCUMENT" | "ACTION" | "USER" | "USER_EVENT" | "EVENT_TRIGGER";
|
|
5
|
+
export declare const EntityType: {
|
|
6
|
+
readonly Conversation: "CONVERSATION";
|
|
7
|
+
readonly ConversationMessage: "CONVERSATION_MESSAGE";
|
|
8
|
+
readonly KnowledgeBase: "KNOWLEDGE_BASE";
|
|
9
|
+
readonly KnowledgeDocument: "KNOWLEDGE_DOCUMENT";
|
|
10
|
+
readonly Action: "ACTION";
|
|
11
|
+
readonly User: "USER";
|
|
12
|
+
readonly UserEvent: "USER_EVENT";
|
|
13
|
+
readonly EventTrigger: "EVENT_TRIGGER";
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
export const EntityType = {
|
|
5
|
+
Conversation: "CONVERSATION",
|
|
6
|
+
ConversationMessage: "CONVERSATION_MESSAGE",
|
|
7
|
+
KnowledgeBase: "KNOWLEDGE_BASE",
|
|
8
|
+
KnowledgeDocument: "KNOWLEDGE_DOCUMENT",
|
|
9
|
+
Action: "ACTION",
|
|
10
|
+
User: "USER",
|
|
11
|
+
UserEvent: "USER_EVENT",
|
|
12
|
+
EventTrigger: "EVENT_TRIGGER",
|
|
13
|
+
};
|
|
@@ -9,8 +9,8 @@ export declare namespace Conversation {
|
|
|
9
9
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
10
|
appId?: core.Supplier<string | undefined>;
|
|
11
11
|
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
xOrganizationId: core.Supplier<string>;
|
|
13
|
+
xAgentId: core.Supplier<string>;
|
|
14
14
|
fetcher?: core.FetchFunction;
|
|
15
15
|
}
|
|
16
16
|
interface RequestOptions {
|
|
@@ -35,8 +35,8 @@ export declare class Conversation {
|
|
|
35
35
|
* @example
|
|
36
36
|
* await client.conversation.initialize({
|
|
37
37
|
* messages: [{}],
|
|
38
|
-
* id: "string",
|
|
39
38
|
* context: {},
|
|
39
|
+
* id: "string",
|
|
40
40
|
* responseConfig: {
|
|
41
41
|
* capabilities: [MavenAGI.Capability.Markdown],
|
|
42
42
|
* isCopilot: true,
|
|
@@ -172,5 +172,22 @@ export declare class Conversation {
|
|
|
172
172
|
* })
|
|
173
173
|
*/
|
|
174
174
|
submitActionForm(conversationId: string, request: MavenAGI.ActionExecutionRequest, requestOptions?: Conversation.RequestOptions): Promise<MavenAGI.ActionExecutionResponse>;
|
|
175
|
+
/**
|
|
176
|
+
* Add metadata to an existing conversation's Context. If a metadata field already exists, it will be overwritten.
|
|
177
|
+
*
|
|
178
|
+
* @param {string} conversationId - The ID of a conversation the metadata being added belongs to
|
|
179
|
+
* @param {Record<string, string>} request
|
|
180
|
+
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
181
|
+
*
|
|
182
|
+
* @throws {@link MavenAGI.NotFoundError}
|
|
183
|
+
* @throws {@link MavenAGI.BadRequestError}
|
|
184
|
+
* @throws {@link MavenAGI.ServerError}
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* await client.conversation.addConversationMetadata("string", {
|
|
188
|
+
* "string": "string"
|
|
189
|
+
* })
|
|
190
|
+
*/
|
|
191
|
+
addConversationMetadata(conversationId: string, request: Record<string, string>, requestOptions?: Conversation.RequestOptions): Promise<Record<string, string>>;
|
|
175
192
|
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
176
193
|
}
|