mavenagi 0.0.0-alpha.11 → 0.0.0-alpha.12
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 +9 -0
- package/README.md +41 -4
- package/api/resources/actions/client/Client.d.ts +9 -0
- package/api/resources/actions/client/Client.js +18 -15
- package/api/resources/commons/types/EntityType.d.ts +2 -1
- package/api/resources/commons/types/EntityType.js +1 -0
- package/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/api/resources/commons/types/index.d.ts +1 -1
- package/api/resources/commons/types/index.js +1 -1
- package/api/resources/conversation/client/Client.d.ts +18 -3
- package/api/resources/conversation/client/Client.js +71 -58
- package/api/resources/conversation/types/FeedbackRequest.d.ts +8 -1
- package/api/resources/knowledge/client/Client.d.ts +9 -0
- package/api/resources/knowledge/client/Client.js +44 -37
- package/api/resources/triggers/client/Client.d.ts +9 -0
- package/api/resources/triggers/client/Client.js +18 -15
- package/api/resources/users/client/Client.d.ts +9 -0
- package/api/resources/users/client/Client.js +13 -11
- package/core/fetcher/Fetcher.d.ts +4 -1
- package/core/fetcher/Fetcher.js +18 -159
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +6 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +32 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +19 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +48 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +38 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +28 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +32 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +222 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +104 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +204 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +17 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/core/runtime/runtime.d.ts +1 -0
- package/core/runtime/runtime.js +1 -0
- package/core/schemas/Schema.d.ts +7 -4
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +8 -19
- package/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/core/schemas/builders/list/list.js +31 -44
- package/core/schemas/builders/object/object.js +90 -111
- package/core/schemas/builders/object/types.d.ts +2 -2
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/core/schemas/builders/record/record.js +49 -60
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/core/schemas/builders/set/set.js +6 -15
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/core/schemas/builders/union/union.js +51 -62
- package/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/Client.d.ts +9 -0
- package/dist/api/resources/actions/client/Client.d.ts +9 -0
- package/dist/api/resources/actions/client/Client.js +18 -15
- package/dist/api/resources/commons/types/EntityType.d.ts +2 -1
- package/dist/api/resources/commons/types/EntityType.js +1 -0
- package/dist/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/dist/api/resources/commons/types/index.d.ts +1 -1
- package/dist/api/resources/commons/types/index.js +1 -1
- package/dist/api/resources/conversation/client/Client.d.ts +18 -3
- package/dist/api/resources/conversation/client/Client.js +71 -58
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +8 -1
- package/dist/api/resources/knowledge/client/Client.d.ts +9 -0
- package/dist/api/resources/knowledge/client/Client.js +44 -37
- package/dist/api/resources/triggers/client/Client.d.ts +9 -0
- package/dist/api/resources/triggers/client/Client.js +18 -15
- package/dist/api/resources/users/client/Client.d.ts +9 -0
- package/dist/api/resources/users/client/Client.js +13 -11
- package/dist/core/fetcher/Fetcher.d.ts +4 -1
- package/dist/core/fetcher/Fetcher.js +18 -159
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +6 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +32 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +19 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +48 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +38 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +28 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +32 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +222 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +104 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +204 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +17 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +23 -0
- package/dist/core/runtime/runtime.d.ts +1 -0
- package/dist/core/runtime/runtime.js +1 -0
- package/dist/core/schemas/Schema.d.ts +7 -4
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +8 -19
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
- package/dist/core/schemas/builders/list/list.js +31 -44
- package/dist/core/schemas/builders/object/object.js +90 -111
- package/dist/core/schemas/builders/object/types.d.ts +2 -2
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
- package/dist/core/schemas/builders/record/record.js +49 -60
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
- package/dist/core/schemas/builders/set/set.js +6 -15
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
- package/dist/core/schemas/builders/union/union.js +51 -62
- package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
- package/dist/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/dist/serialization/resources/commons/types/EntityType.js +1 -0
- package/{serialization/resources/commons/types/Feedback.d.ts → dist/serialization/resources/commons/types/FeedbackBase.d.ts} +2 -5
- package/{serialization/resources/commons/types/Feedback.js → dist/serialization/resources/commons/types/FeedbackBase.js} +1 -4
- package/dist/serialization/resources/commons/types/index.d.ts +1 -1
- package/dist/serialization/resources/commons/types/index.js +1 -1
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- package/package.json +7 -2
- package/reference.md +1723 -0
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +1 -0
- package/{dist/serialization/resources/commons/types/Feedback.d.ts → serialization/resources/commons/types/FeedbackBase.d.ts} +2 -5
- package/{dist/serialization/resources/commons/types/Feedback.js → serialization/resources/commons/types/FeedbackBase.js} +1 -4
- package/serialization/resources/commons/types/index.d.ts +1 -1
- package/serialization/resources/commons/types/index.js +1 -1
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- package/api/resources/commons/types/Feedback.d.ts +0 -16
- package/dist/api/resources/commons/types/Feedback.d.ts +0 -16
- /package/api/resources/commons/types/{Feedback.js → FeedbackBase.js} +0 -0
- /package/dist/api/resources/commons/types/{Feedback.js → FeedbackBase.js} +0 -0
|
@@ -56,18 +56,19 @@ export class Conversation {
|
|
|
56
56
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
57
57
|
"X-Fern-Language": "JavaScript",
|
|
58
58
|
"X-Fern-SDK-Name": "mavenagi",
|
|
59
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
59
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.12",
|
|
60
60
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
61
61
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
62
62
|
},
|
|
63
63
|
contentType: "application/json",
|
|
64
|
-
|
|
64
|
+
requestType: "json",
|
|
65
|
+
body: serializers.ConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
65
66
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
66
67
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
67
68
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
68
69
|
});
|
|
69
70
|
if (_response.ok) {
|
|
70
|
-
return
|
|
71
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
71
72
|
unrecognizedObjectKeys: "passthrough",
|
|
72
73
|
allowUnrecognizedUnionMembers: true,
|
|
73
74
|
allowUnrecognizedEnumValues: true,
|
|
@@ -77,21 +78,21 @@ export class Conversation {
|
|
|
77
78
|
if (_response.error.reason === "status-code") {
|
|
78
79
|
switch (_response.error.statusCode) {
|
|
79
80
|
case 404:
|
|
80
|
-
throw new MavenAGI.NotFoundError(
|
|
81
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
81
82
|
unrecognizedObjectKeys: "passthrough",
|
|
82
83
|
allowUnrecognizedUnionMembers: true,
|
|
83
84
|
allowUnrecognizedEnumValues: true,
|
|
84
85
|
breadcrumbsPrefix: ["response"],
|
|
85
86
|
}));
|
|
86
87
|
case 400:
|
|
87
|
-
throw new MavenAGI.BadRequestError(
|
|
88
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
88
89
|
unrecognizedObjectKeys: "passthrough",
|
|
89
90
|
allowUnrecognizedUnionMembers: true,
|
|
90
91
|
allowUnrecognizedEnumValues: true,
|
|
91
92
|
breadcrumbsPrefix: ["response"],
|
|
92
93
|
}));
|
|
93
94
|
case 500:
|
|
94
|
-
throw new MavenAGI.ServerError(
|
|
95
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
95
96
|
unrecognizedObjectKeys: "passthrough",
|
|
96
97
|
allowUnrecognizedUnionMembers: true,
|
|
97
98
|
allowUnrecognizedEnumValues: true,
|
|
@@ -144,17 +145,18 @@ export class Conversation {
|
|
|
144
145
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
145
146
|
"X-Fern-Language": "JavaScript",
|
|
146
147
|
"X-Fern-SDK-Name": "mavenagi",
|
|
147
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
148
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.12",
|
|
148
149
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
149
150
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
150
151
|
},
|
|
151
152
|
contentType: "application/json",
|
|
153
|
+
requestType: "json",
|
|
152
154
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
153
155
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
154
156
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
155
157
|
});
|
|
156
158
|
if (_response.ok) {
|
|
157
|
-
return
|
|
159
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
158
160
|
unrecognizedObjectKeys: "passthrough",
|
|
159
161
|
allowUnrecognizedUnionMembers: true,
|
|
160
162
|
allowUnrecognizedEnumValues: true,
|
|
@@ -164,21 +166,21 @@ export class Conversation {
|
|
|
164
166
|
if (_response.error.reason === "status-code") {
|
|
165
167
|
switch (_response.error.statusCode) {
|
|
166
168
|
case 404:
|
|
167
|
-
throw new MavenAGI.NotFoundError(
|
|
169
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
168
170
|
unrecognizedObjectKeys: "passthrough",
|
|
169
171
|
allowUnrecognizedUnionMembers: true,
|
|
170
172
|
allowUnrecognizedEnumValues: true,
|
|
171
173
|
breadcrumbsPrefix: ["response"],
|
|
172
174
|
}));
|
|
173
175
|
case 400:
|
|
174
|
-
throw new MavenAGI.BadRequestError(
|
|
176
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
175
177
|
unrecognizedObjectKeys: "passthrough",
|
|
176
178
|
allowUnrecognizedUnionMembers: true,
|
|
177
179
|
allowUnrecognizedEnumValues: true,
|
|
178
180
|
breadcrumbsPrefix: ["response"],
|
|
179
181
|
}));
|
|
180
182
|
case 500:
|
|
181
|
-
throw new MavenAGI.ServerError(
|
|
183
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
182
184
|
unrecognizedObjectKeys: "passthrough",
|
|
183
185
|
allowUnrecognizedUnionMembers: true,
|
|
184
186
|
allowUnrecognizedEnumValues: true,
|
|
@@ -239,12 +241,13 @@ export class Conversation {
|
|
|
239
241
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
240
242
|
"X-Fern-Language": "JavaScript",
|
|
241
243
|
"X-Fern-SDK-Name": "mavenagi",
|
|
242
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
244
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.12",
|
|
243
245
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
244
246
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
245
247
|
},
|
|
246
248
|
contentType: "application/json",
|
|
247
|
-
|
|
249
|
+
requestType: "json",
|
|
250
|
+
body: serializers.conversation.appendNewMessages.Request.jsonOrThrow(request, {
|
|
248
251
|
unrecognizedObjectKeys: "strip",
|
|
249
252
|
}),
|
|
250
253
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -252,7 +255,7 @@ export class Conversation {
|
|
|
252
255
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
253
256
|
});
|
|
254
257
|
if (_response.ok) {
|
|
255
|
-
return
|
|
258
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
256
259
|
unrecognizedObjectKeys: "passthrough",
|
|
257
260
|
allowUnrecognizedUnionMembers: true,
|
|
258
261
|
allowUnrecognizedEnumValues: true,
|
|
@@ -262,21 +265,21 @@ export class Conversation {
|
|
|
262
265
|
if (_response.error.reason === "status-code") {
|
|
263
266
|
switch (_response.error.statusCode) {
|
|
264
267
|
case 404:
|
|
265
|
-
throw new MavenAGI.NotFoundError(
|
|
268
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
266
269
|
unrecognizedObjectKeys: "passthrough",
|
|
267
270
|
allowUnrecognizedUnionMembers: true,
|
|
268
271
|
allowUnrecognizedEnumValues: true,
|
|
269
272
|
breadcrumbsPrefix: ["response"],
|
|
270
273
|
}));
|
|
271
274
|
case 400:
|
|
272
|
-
throw new MavenAGI.BadRequestError(
|
|
275
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
273
276
|
unrecognizedObjectKeys: "passthrough",
|
|
274
277
|
allowUnrecognizedUnionMembers: true,
|
|
275
278
|
allowUnrecognizedEnumValues: true,
|
|
276
279
|
breadcrumbsPrefix: ["response"],
|
|
277
280
|
}));
|
|
278
281
|
case 500:
|
|
279
|
-
throw new MavenAGI.ServerError(
|
|
282
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
280
283
|
unrecognizedObjectKeys: "passthrough",
|
|
281
284
|
allowUnrecognizedUnionMembers: true,
|
|
282
285
|
allowUnrecognizedEnumValues: true,
|
|
@@ -337,18 +340,19 @@ export class Conversation {
|
|
|
337
340
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
338
341
|
"X-Fern-Language": "JavaScript",
|
|
339
342
|
"X-Fern-SDK-Name": "mavenagi",
|
|
340
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
343
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.12",
|
|
341
344
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
342
345
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
343
346
|
},
|
|
344
347
|
contentType: "application/json",
|
|
345
|
-
|
|
348
|
+
requestType: "json",
|
|
349
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
346
350
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
347
351
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
348
352
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
349
353
|
});
|
|
350
354
|
if (_response.ok) {
|
|
351
|
-
return
|
|
355
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
352
356
|
unrecognizedObjectKeys: "passthrough",
|
|
353
357
|
allowUnrecognizedUnionMembers: true,
|
|
354
358
|
allowUnrecognizedEnumValues: true,
|
|
@@ -358,21 +362,21 @@ export class Conversation {
|
|
|
358
362
|
if (_response.error.reason === "status-code") {
|
|
359
363
|
switch (_response.error.statusCode) {
|
|
360
364
|
case 404:
|
|
361
|
-
throw new MavenAGI.NotFoundError(
|
|
365
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
362
366
|
unrecognizedObjectKeys: "passthrough",
|
|
363
367
|
allowUnrecognizedUnionMembers: true,
|
|
364
368
|
allowUnrecognizedEnumValues: true,
|
|
365
369
|
breadcrumbsPrefix: ["response"],
|
|
366
370
|
}));
|
|
367
371
|
case 400:
|
|
368
|
-
throw new MavenAGI.BadRequestError(
|
|
372
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
369
373
|
unrecognizedObjectKeys: "passthrough",
|
|
370
374
|
allowUnrecognizedUnionMembers: true,
|
|
371
375
|
allowUnrecognizedEnumValues: true,
|
|
372
376
|
breadcrumbsPrefix: ["response"],
|
|
373
377
|
}));
|
|
374
378
|
case 500:
|
|
375
|
-
throw new MavenAGI.ServerError(
|
|
379
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
376
380
|
unrecognizedObjectKeys: "passthrough",
|
|
377
381
|
allowUnrecognizedUnionMembers: true,
|
|
378
382
|
allowUnrecognizedEnumValues: true,
|
|
@@ -415,13 +419,14 @@ export class Conversation {
|
|
|
415
419
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
416
420
|
"X-Fern-Language": "JavaScript",
|
|
417
421
|
"X-Fern-SDK-Name": "mavenagi",
|
|
418
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
422
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.12",
|
|
419
423
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
420
424
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
421
425
|
},
|
|
422
426
|
contentType: "application/json",
|
|
423
|
-
|
|
424
|
-
|
|
427
|
+
requestType: "json",
|
|
428
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
429
|
+
responseType: "sse",
|
|
425
430
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
426
431
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
427
432
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -430,7 +435,7 @@ export class Conversation {
|
|
|
430
435
|
return new core.Stream({
|
|
431
436
|
stream: _response.body,
|
|
432
437
|
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
433
|
-
return
|
|
438
|
+
return serializers.StreamResponse.parseOrThrow(data, {
|
|
434
439
|
unrecognizedObjectKeys: "passthrough",
|
|
435
440
|
allowUnrecognizedUnionMembers: true,
|
|
436
441
|
allowUnrecognizedEnumValues: true,
|
|
@@ -447,21 +452,21 @@ export class Conversation {
|
|
|
447
452
|
if (_response.error.reason === "status-code") {
|
|
448
453
|
switch (_response.error.statusCode) {
|
|
449
454
|
case 404:
|
|
450
|
-
throw new MavenAGI.NotFoundError(
|
|
455
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
451
456
|
unrecognizedObjectKeys: "passthrough",
|
|
452
457
|
allowUnrecognizedUnionMembers: true,
|
|
453
458
|
allowUnrecognizedEnumValues: true,
|
|
454
459
|
breadcrumbsPrefix: ["response"],
|
|
455
460
|
}));
|
|
456
461
|
case 400:
|
|
457
|
-
throw new MavenAGI.BadRequestError(
|
|
462
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
458
463
|
unrecognizedObjectKeys: "passthrough",
|
|
459
464
|
allowUnrecognizedUnionMembers: true,
|
|
460
465
|
allowUnrecognizedEnumValues: true,
|
|
461
466
|
breadcrumbsPrefix: ["response"],
|
|
462
467
|
}));
|
|
463
468
|
case 500:
|
|
464
|
-
throw new MavenAGI.ServerError(
|
|
469
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
465
470
|
unrecognizedObjectKeys: "passthrough",
|
|
466
471
|
allowUnrecognizedUnionMembers: true,
|
|
467
472
|
allowUnrecognizedEnumValues: true,
|
|
@@ -519,20 +524,19 @@ export class Conversation {
|
|
|
519
524
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
520
525
|
"X-Fern-Language": "JavaScript",
|
|
521
526
|
"X-Fern-SDK-Name": "mavenagi",
|
|
522
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
527
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.12",
|
|
523
528
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
524
529
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
525
530
|
},
|
|
526
531
|
contentType: "application/json",
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}),
|
|
532
|
+
requestType: "json",
|
|
533
|
+
body: serializers.GenerateMavenSuggestionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
530
534
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
531
535
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
532
536
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
533
537
|
});
|
|
534
538
|
if (_response.ok) {
|
|
535
|
-
return
|
|
539
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
536
540
|
unrecognizedObjectKeys: "passthrough",
|
|
537
541
|
allowUnrecognizedUnionMembers: true,
|
|
538
542
|
allowUnrecognizedEnumValues: true,
|
|
@@ -542,21 +546,21 @@ export class Conversation {
|
|
|
542
546
|
if (_response.error.reason === "status-code") {
|
|
543
547
|
switch (_response.error.statusCode) {
|
|
544
548
|
case 404:
|
|
545
|
-
throw new MavenAGI.NotFoundError(
|
|
549
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
546
550
|
unrecognizedObjectKeys: "passthrough",
|
|
547
551
|
allowUnrecognizedUnionMembers: true,
|
|
548
552
|
allowUnrecognizedEnumValues: true,
|
|
549
553
|
breadcrumbsPrefix: ["response"],
|
|
550
554
|
}));
|
|
551
555
|
case 400:
|
|
552
|
-
throw new MavenAGI.BadRequestError(
|
|
556
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
553
557
|
unrecognizedObjectKeys: "passthrough",
|
|
554
558
|
allowUnrecognizedUnionMembers: true,
|
|
555
559
|
allowUnrecognizedEnumValues: true,
|
|
556
560
|
breadcrumbsPrefix: ["response"],
|
|
557
561
|
}));
|
|
558
562
|
case 500:
|
|
559
|
-
throw new MavenAGI.ServerError(
|
|
563
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
560
564
|
unrecognizedObjectKeys: "passthrough",
|
|
561
565
|
allowUnrecognizedUnionMembers: true,
|
|
562
566
|
allowUnrecognizedEnumValues: true,
|
|
@@ -596,9 +600,15 @@ export class Conversation {
|
|
|
596
600
|
*
|
|
597
601
|
* @example
|
|
598
602
|
* await client.conversation.createFeedback({
|
|
599
|
-
*
|
|
600
|
-
*
|
|
601
|
-
*
|
|
603
|
+
* feedbackId: {
|
|
604
|
+
* referenceId: "string"
|
|
605
|
+
* },
|
|
606
|
+
* conversationId: {
|
|
607
|
+
* referenceId: "string"
|
|
608
|
+
* },
|
|
609
|
+
* conversationMessageId: {
|
|
610
|
+
* referenceId: "string"
|
|
611
|
+
* },
|
|
602
612
|
* type: MavenAGI.FeedbackType.ThumbsUp,
|
|
603
613
|
* text: "string"
|
|
604
614
|
* })
|
|
@@ -615,12 +625,13 @@ export class Conversation {
|
|
|
615
625
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
616
626
|
"X-Fern-Language": "JavaScript",
|
|
617
627
|
"X-Fern-SDK-Name": "mavenagi",
|
|
618
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
628
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.12",
|
|
619
629
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
620
630
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
621
631
|
},
|
|
622
632
|
contentType: "application/json",
|
|
623
|
-
|
|
633
|
+
requestType: "json",
|
|
634
|
+
body: serializers.FeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
624
635
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
625
636
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
626
637
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -631,21 +642,21 @@ export class Conversation {
|
|
|
631
642
|
if (_response.error.reason === "status-code") {
|
|
632
643
|
switch (_response.error.statusCode) {
|
|
633
644
|
case 404:
|
|
634
|
-
throw new MavenAGI.NotFoundError(
|
|
645
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
635
646
|
unrecognizedObjectKeys: "passthrough",
|
|
636
647
|
allowUnrecognizedUnionMembers: true,
|
|
637
648
|
allowUnrecognizedEnumValues: true,
|
|
638
649
|
breadcrumbsPrefix: ["response"],
|
|
639
650
|
}));
|
|
640
651
|
case 400:
|
|
641
|
-
throw new MavenAGI.BadRequestError(
|
|
652
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
642
653
|
unrecognizedObjectKeys: "passthrough",
|
|
643
654
|
allowUnrecognizedUnionMembers: true,
|
|
644
655
|
allowUnrecognizedEnumValues: true,
|
|
645
656
|
breadcrumbsPrefix: ["response"],
|
|
646
657
|
}));
|
|
647
658
|
case 500:
|
|
648
|
-
throw new MavenAGI.ServerError(
|
|
659
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
649
660
|
unrecognizedObjectKeys: "passthrough",
|
|
650
661
|
allowUnrecognizedUnionMembers: true,
|
|
651
662
|
allowUnrecognizedEnumValues: true,
|
|
@@ -716,18 +727,19 @@ export class Conversation {
|
|
|
716
727
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
717
728
|
"X-Fern-Language": "JavaScript",
|
|
718
729
|
"X-Fern-SDK-Name": "mavenagi",
|
|
719
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
730
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.12",
|
|
720
731
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
721
732
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
722
733
|
},
|
|
723
734
|
contentType: "application/json",
|
|
724
|
-
|
|
735
|
+
requestType: "json",
|
|
736
|
+
body: serializers.SubmitActionFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
725
737
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
726
738
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
727
739
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
728
740
|
});
|
|
729
741
|
if (_response.ok) {
|
|
730
|
-
return
|
|
742
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
731
743
|
unrecognizedObjectKeys: "passthrough",
|
|
732
744
|
allowUnrecognizedUnionMembers: true,
|
|
733
745
|
allowUnrecognizedEnumValues: true,
|
|
@@ -737,21 +749,21 @@ export class Conversation {
|
|
|
737
749
|
if (_response.error.reason === "status-code") {
|
|
738
750
|
switch (_response.error.statusCode) {
|
|
739
751
|
case 404:
|
|
740
|
-
throw new MavenAGI.NotFoundError(
|
|
752
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
741
753
|
unrecognizedObjectKeys: "passthrough",
|
|
742
754
|
allowUnrecognizedUnionMembers: true,
|
|
743
755
|
allowUnrecognizedEnumValues: true,
|
|
744
756
|
breadcrumbsPrefix: ["response"],
|
|
745
757
|
}));
|
|
746
758
|
case 400:
|
|
747
|
-
throw new MavenAGI.BadRequestError(
|
|
759
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
748
760
|
unrecognizedObjectKeys: "passthrough",
|
|
749
761
|
allowUnrecognizedUnionMembers: true,
|
|
750
762
|
allowUnrecognizedEnumValues: true,
|
|
751
763
|
breadcrumbsPrefix: ["response"],
|
|
752
764
|
}));
|
|
753
765
|
case 500:
|
|
754
|
-
throw new MavenAGI.ServerError(
|
|
766
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
755
767
|
unrecognizedObjectKeys: "passthrough",
|
|
756
768
|
allowUnrecognizedUnionMembers: true,
|
|
757
769
|
allowUnrecognizedEnumValues: true,
|
|
@@ -807,12 +819,13 @@ export class Conversation {
|
|
|
807
819
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
808
820
|
"X-Fern-Language": "JavaScript",
|
|
809
821
|
"X-Fern-SDK-Name": "mavenagi",
|
|
810
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
822
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.12",
|
|
811
823
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
812
824
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
813
825
|
},
|
|
814
826
|
contentType: "application/json",
|
|
815
|
-
|
|
827
|
+
requestType: "json",
|
|
828
|
+
body: serializers.conversation.addConversationMetadata.Request.jsonOrThrow(request, {
|
|
816
829
|
unrecognizedObjectKeys: "strip",
|
|
817
830
|
}),
|
|
818
831
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -820,7 +833,7 @@ export class Conversation {
|
|
|
820
833
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
821
834
|
});
|
|
822
835
|
if (_response.ok) {
|
|
823
|
-
return
|
|
836
|
+
return serializers.conversation.addConversationMetadata.Response.parseOrThrow(_response.body, {
|
|
824
837
|
unrecognizedObjectKeys: "passthrough",
|
|
825
838
|
allowUnrecognizedUnionMembers: true,
|
|
826
839
|
allowUnrecognizedEnumValues: true,
|
|
@@ -830,21 +843,21 @@ export class Conversation {
|
|
|
830
843
|
if (_response.error.reason === "status-code") {
|
|
831
844
|
switch (_response.error.statusCode) {
|
|
832
845
|
case 404:
|
|
833
|
-
throw new MavenAGI.NotFoundError(
|
|
846
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
834
847
|
unrecognizedObjectKeys: "passthrough",
|
|
835
848
|
allowUnrecognizedUnionMembers: true,
|
|
836
849
|
allowUnrecognizedEnumValues: true,
|
|
837
850
|
breadcrumbsPrefix: ["response"],
|
|
838
851
|
}));
|
|
839
852
|
case 400:
|
|
840
|
-
throw new MavenAGI.BadRequestError(
|
|
853
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
841
854
|
unrecognizedObjectKeys: "passthrough",
|
|
842
855
|
allowUnrecognizedUnionMembers: true,
|
|
843
856
|
allowUnrecognizedEnumValues: true,
|
|
844
857
|
breadcrumbsPrefix: ["response"],
|
|
845
858
|
}));
|
|
846
859
|
case 500:
|
|
847
|
-
throw new MavenAGI.ServerError(
|
|
860
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
848
861
|
unrecognizedObjectKeys: "passthrough",
|
|
849
862
|
allowUnrecognizedUnionMembers: true,
|
|
850
863
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2,4 +2,11 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as MavenAGI from "../../../index";
|
|
5
|
-
export
|
|
5
|
+
export interface FeedbackRequest extends MavenAGI.FeedbackBase {
|
|
6
|
+
/** The ID that uniquely identifies this feedback */
|
|
7
|
+
feedbackId: MavenAGI.EntityIdBase;
|
|
8
|
+
/** The ID that uniquely identifies the the conversation the feedback is about */
|
|
9
|
+
conversationId: MavenAGI.EntityIdBase;
|
|
10
|
+
/** The ID that uniquely identifies the message within the conversation the feedback is about */
|
|
11
|
+
conversationMessageId: MavenAGI.EntityIdBase;
|
|
12
|
+
}
|
|
@@ -9,14 +9,23 @@ export declare namespace Knowledge {
|
|
|
9
9
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
10
10
|
appId?: core.Supplier<string | undefined>;
|
|
11
11
|
appSecret?: core.Supplier<string | undefined>;
|
|
12
|
+
/** Override the X-Organization-Id header */
|
|
12
13
|
organizationId: core.Supplier<string>;
|
|
14
|
+
/** Override the X-Agent-Id header */
|
|
13
15
|
agentId: core.Supplier<string>;
|
|
14
16
|
fetcher?: core.FetchFunction;
|
|
15
17
|
}
|
|
16
18
|
interface RequestOptions {
|
|
19
|
+
/** The maximum time to wait for a response in seconds. */
|
|
17
20
|
timeoutInSeconds?: number;
|
|
21
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
18
22
|
maxRetries?: number;
|
|
23
|
+
/** A hook to abort the request. */
|
|
19
24
|
abortSignal?: AbortSignal;
|
|
25
|
+
/** Override the X-Organization-Id header */
|
|
26
|
+
organizationId?: string;
|
|
27
|
+
/** Override the X-Agent-Id header */
|
|
28
|
+
agentId?: string;
|
|
20
29
|
}
|
|
21
30
|
}
|
|
22
31
|
export declare class Knowledge {
|