mavenagi 0.0.0-alpha.11 → 0.0.0-alpha.14
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 +49 -5
- package/api/resources/actions/client/Client.d.ts +9 -0
- package/api/resources/actions/client/Client.js +18 -15
- package/api/resources/commons/types/AppUser.d.ts +3 -2
- package/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/api/resources/commons/types/AppUserRequest.d.ts +19 -1
- package/api/resources/commons/types/AppUserResponse.d.ts +34 -2
- package/api/resources/commons/types/EntityType.d.ts +2 -1
- package/api/resources/commons/types/EntityType.js +1 -0
- package/api/resources/commons/types/Feedback.d.ts +4 -8
- package/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/api/resources/commons/types/UserData.d.ts +1 -1
- package/api/resources/commons/types/index.d.ts +4 -2
- package/api/resources/commons/types/index.js +4 -2
- package/api/resources/conversation/client/Client.d.ts +39 -22
- package/api/resources/conversation/client/Client.js +97 -77
- package/api/resources/conversation/types/AskRequest.d.ts +2 -4
- package/api/resources/conversation/types/ConversationBase.d.ts +12 -0
- package/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -3
- package/api/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/api/resources/conversation/types/ConversationResponse.d.ts +0 -2
- package/api/resources/conversation/types/FeedbackRequest.d.ts +8 -1
- package/api/resources/conversation/types/SubmitActionFormRequest.d.ts +1 -3
- package/api/resources/conversation/types/UserMessageBase.d.ts +2 -0
- package/api/resources/conversation/types/index.d.ts +0 -2
- package/api/resources/conversation/types/index.js +0 -2
- 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/triggers/types/index.d.ts +0 -3
- package/api/resources/triggers/types/index.js +0 -3
- package/api/resources/users/client/Client.d.ts +27 -14
- package/api/resources/users/client/Client.js +32 -26
- 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/AppUser.d.ts +3 -2
- package/dist/api/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/dist/api/resources/commons/types/AppUserRequest.d.ts +19 -1
- package/dist/api/resources/commons/types/AppUserResponse.d.ts +34 -2
- 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/Feedback.d.ts +4 -8
- package/dist/api/resources/commons/types/FeedbackBase.d.ts +10 -0
- package/dist/api/resources/commons/types/UserData.d.ts +1 -1
- package/dist/api/resources/commons/types/index.d.ts +4 -2
- package/dist/api/resources/commons/types/index.js +4 -2
- package/dist/api/resources/conversation/client/Client.d.ts +39 -22
- package/dist/api/resources/conversation/client/Client.js +97 -77
- package/dist/api/resources/conversation/types/AskRequest.d.ts +2 -4
- package/dist/api/resources/conversation/types/ConversationBase.d.ts +12 -0
- package/dist/api/resources/conversation/types/ConversationMessageBase.d.ts +4 -3
- package/dist/api/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/dist/api/resources/conversation/types/ConversationResponse.d.ts +0 -2
- package/dist/api/resources/conversation/types/FeedbackRequest.d.ts +8 -1
- package/dist/api/resources/conversation/types/SubmitActionFormRequest.d.ts +1 -3
- package/dist/api/resources/conversation/types/UserMessageBase.d.ts +2 -0
- package/dist/api/resources/conversation/types/index.d.ts +0 -2
- package/dist/api/resources/conversation/types/index.js +0 -2
- 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/triggers/types/index.d.ts +0 -3
- package/dist/api/resources/triggers/types/index.js +0 -3
- package/dist/api/resources/users/client/Client.d.ts +27 -14
- package/dist/api/resources/users/client/Client.js +32 -26
- 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/AppUser.d.ts +3 -3
- package/dist/serialization/resources/commons/types/AppUser.js +3 -3
- package/dist/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/dist/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
- package/dist/serialization/resources/commons/types/AppUserRequest.d.ts +1 -1
- package/dist/serialization/resources/commons/types/AppUserRequest.js +1 -1
- package/dist/serialization/resources/commons/types/AppUserResponse.d.ts +2 -1
- package/dist/serialization/resources/commons/types/AppUserResponse.js +2 -1
- package/dist/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/dist/serialization/resources/commons/types/EntityType.js +1 -0
- package/{serialization/resources/triggers → dist/serialization/resources/commons}/types/EventTriggerResponse.d.ts +1 -1
- package/{serialization/resources/triggers → dist/serialization/resources/commons}/types/EventTriggerResponse.js +1 -1
- package/dist/serialization/resources/commons/types/Feedback.d.ts +6 -7
- package/dist/serialization/resources/commons/types/Feedback.js +9 -8
- package/dist/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/dist/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/dist/serialization/resources/commons/types/UserData.d.ts +1 -1
- package/dist/serialization/resources/commons/types/UserData.js +1 -1
- package/dist/serialization/resources/commons/types/index.d.ts +4 -2
- package/dist/serialization/resources/commons/types/index.js +4 -2
- package/dist/serialization/resources/conversation/types/AskRequest.d.ts +1 -4
- package/dist/serialization/resources/conversation/types/AskRequest.js +1 -4
- package/dist/serialization/resources/conversation/types/ConversationBase.d.ts +6 -0
- package/dist/serialization/resources/conversation/types/ConversationBase.js +6 -0
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -2
- package/dist/serialization/resources/conversation/types/ConversationMessageBase.js +2 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/ConversationRequest.js +0 -2
- package/dist/serialization/resources/conversation/types/ConversationResponse.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/ConversationResponse.js +0 -2
- package/dist/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/dist/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
- package/dist/serialization/resources/conversation/types/UserMessageBase.d.ts +2 -0
- package/dist/serialization/resources/conversation/types/UserMessageBase.js +2 -0
- package/dist/serialization/resources/conversation/types/index.d.ts +0 -2
- package/dist/serialization/resources/conversation/types/index.js +0 -2
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
- package/dist/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
- package/dist/serialization/resources/triggers/types/index.d.ts +0 -3
- package/dist/serialization/resources/triggers/types/index.js +0 -3
- package/package.json +7 -2
- package/reference.md +1732 -0
- package/serialization/resources/commons/types/AppUser.d.ts +3 -3
- package/serialization/resources/commons/types/AppUser.js +3 -3
- package/serialization/resources/commons/types/AppUserIdentifier.d.ts +1 -1
- package/serialization/resources/commons/types/AppUserIdentifier.js +1 -1
- package/serialization/resources/commons/types/AppUserRequest.d.ts +1 -1
- package/serialization/resources/commons/types/AppUserRequest.js +1 -1
- package/serialization/resources/commons/types/AppUserResponse.d.ts +2 -1
- package/serialization/resources/commons/types/AppUserResponse.js +2 -1
- package/serialization/resources/commons/types/EntityType.d.ts +1 -1
- package/serialization/resources/commons/types/EntityType.js +1 -0
- package/{dist/serialization/resources/triggers → serialization/resources/commons}/types/EventTriggerResponse.d.ts +1 -1
- package/{dist/serialization/resources/triggers → serialization/resources/commons}/types/EventTriggerResponse.js +1 -1
- package/serialization/resources/commons/types/Feedback.d.ts +6 -7
- package/serialization/resources/commons/types/Feedback.js +9 -8
- package/serialization/resources/commons/types/FeedbackBase.d.ts +14 -0
- package/serialization/resources/commons/types/FeedbackBase.js +9 -0
- package/serialization/resources/commons/types/UserData.d.ts +1 -1
- package/serialization/resources/commons/types/UserData.js +1 -1
- package/serialization/resources/commons/types/index.d.ts +4 -2
- package/serialization/resources/commons/types/index.js +4 -2
- package/serialization/resources/conversation/types/AskRequest.d.ts +1 -4
- package/serialization/resources/conversation/types/AskRequest.js +1 -4
- package/serialization/resources/conversation/types/ConversationBase.d.ts +6 -0
- package/serialization/resources/conversation/types/ConversationBase.js +6 -0
- package/serialization/resources/conversation/types/ConversationMessageBase.d.ts +2 -2
- package/serialization/resources/conversation/types/ConversationMessageBase.js +2 -2
- package/serialization/resources/conversation/types/ConversationRequest.d.ts +0 -2
- package/serialization/resources/conversation/types/ConversationRequest.js +0 -2
- package/serialization/resources/conversation/types/ConversationResponse.d.ts +0 -2
- package/serialization/resources/conversation/types/ConversationResponse.js +0 -2
- package/serialization/resources/conversation/types/FeedbackRequest.d.ts +7 -2
- package/serialization/resources/conversation/types/FeedbackRequest.js +10 -2
- package/serialization/resources/conversation/types/SubmitActionFormRequest.d.ts +0 -2
- package/serialization/resources/conversation/types/SubmitActionFormRequest.js +0 -2
- package/serialization/resources/conversation/types/UserMessageBase.d.ts +2 -0
- package/serialization/resources/conversation/types/UserMessageBase.js +2 -0
- package/serialization/resources/conversation/types/index.d.ts +0 -2
- package/serialization/resources/conversation/types/index.js +0 -2
- package/serialization/resources/triggers/types/EventTriggerRequest.d.ts +1 -1
- package/serialization/resources/triggers/types/EventTriggerRequest.js +1 -1
- package/serialization/resources/triggers/types/index.d.ts +0 -3
- package/serialization/resources/triggers/types/index.js +0 -3
- package/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
- package/api/resources/commons/types/User.d.ts +0 -10
- package/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/api/resources/conversation/types/ConversationContext.js +0 -4
- package/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/api/resources/conversation/types/ConversationMessageContext.js +0 -4
- package/dist/api/resources/commons/types/AppUserIdentification.d.ts +0 -8
- package/dist/api/resources/commons/types/AppUserIdentification.js +0 -4
- package/dist/api/resources/commons/types/User.d.ts +0 -10
- package/dist/api/resources/commons/types/User.js +0 -4
- package/dist/api/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/api/resources/conversation/types/ConversationContext.js +0 -4
- package/dist/api/resources/conversation/types/ConversationMessageContext.d.ts +0 -12
- package/dist/api/resources/conversation/types/ConversationMessageContext.js +0 -4
- package/dist/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
- package/dist/serialization/resources/commons/types/AppUserIdentification.js +0 -8
- package/dist/serialization/resources/commons/types/User.d.ts +0 -15
- package/dist/serialization/resources/commons/types/User.js +0 -10
- package/dist/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/dist/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/dist/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- package/serialization/resources/commons/types/AppUserIdentification.d.ts +0 -13
- package/serialization/resources/commons/types/AppUserIdentification.js +0 -8
- package/serialization/resources/commons/types/User.d.ts +0 -15
- package/serialization/resources/commons/types/User.js +0 -10
- package/serialization/resources/conversation/types/ConversationContext.d.ts +0 -20
- package/serialization/resources/conversation/types/ConversationContext.js +0 -15
- package/serialization/resources/conversation/types/ConversationMessageContext.d.ts +0 -16
- package/serialization/resources/conversation/types/ConversationMessageContext.js +0 -11
- /package/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerResponse.js +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/api/resources/commons/types/{AppUserIdentification.js → FeedbackBase.js} +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerResponse.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerResponse.js +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/api/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/{api/resources/commons/types/User.js → dist/api/resources/commons/types/FeedbackBase.js} +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/dist/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.d.ts +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerBase.js +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.d.ts +0 -0
- /package/serialization/resources/{triggers → commons}/types/EventTriggerType.js +0 -0
|
@@ -21,7 +21,7 @@ export class Conversation {
|
|
|
21
21
|
this._options = _options;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Initialize a new conversation. Only required if the ask request wishes to supply conversation level data or when syncing to external systems.
|
|
25
25
|
*
|
|
26
26
|
* @param {MavenAGI.ConversationRequest} request
|
|
27
27
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -36,11 +36,18 @@ export class Conversation {
|
|
|
36
36
|
* referenceId: "string"
|
|
37
37
|
* },
|
|
38
38
|
* messages: [{}],
|
|
39
|
-
* context: {},
|
|
40
39
|
* responseConfig: {
|
|
41
40
|
* capabilities: [MavenAGI.Capability.Markdown],
|
|
42
41
|
* isCopilot: true,
|
|
43
42
|
* responseLength: MavenAGI.ResponseLength.Short
|
|
43
|
+
* },
|
|
44
|
+
* subject: "string",
|
|
45
|
+
* url: "string",
|
|
46
|
+
* createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
47
|
+
* updatedAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
48
|
+
* tags: new Set(["string"]),
|
|
49
|
+
* metadata: {
|
|
50
|
+
* "string": "string"
|
|
44
51
|
* }
|
|
45
52
|
* })
|
|
46
53
|
*/
|
|
@@ -56,18 +63,19 @@ export class Conversation {
|
|
|
56
63
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
57
64
|
"X-Fern-Language": "JavaScript",
|
|
58
65
|
"X-Fern-SDK-Name": "mavenagi",
|
|
59
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
66
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
60
67
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
61
68
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
62
69
|
},
|
|
63
70
|
contentType: "application/json",
|
|
64
|
-
|
|
71
|
+
requestType: "json",
|
|
72
|
+
body: serializers.ConversationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
65
73
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
66
74
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
67
75
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
68
76
|
});
|
|
69
77
|
if (_response.ok) {
|
|
70
|
-
return
|
|
78
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
71
79
|
unrecognizedObjectKeys: "passthrough",
|
|
72
80
|
allowUnrecognizedUnionMembers: true,
|
|
73
81
|
allowUnrecognizedEnumValues: true,
|
|
@@ -77,21 +85,21 @@ export class Conversation {
|
|
|
77
85
|
if (_response.error.reason === "status-code") {
|
|
78
86
|
switch (_response.error.statusCode) {
|
|
79
87
|
case 404:
|
|
80
|
-
throw new MavenAGI.NotFoundError(
|
|
88
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
81
89
|
unrecognizedObjectKeys: "passthrough",
|
|
82
90
|
allowUnrecognizedUnionMembers: true,
|
|
83
91
|
allowUnrecognizedEnumValues: true,
|
|
84
92
|
breadcrumbsPrefix: ["response"],
|
|
85
93
|
}));
|
|
86
94
|
case 400:
|
|
87
|
-
throw new MavenAGI.BadRequestError(
|
|
95
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
88
96
|
unrecognizedObjectKeys: "passthrough",
|
|
89
97
|
allowUnrecognizedUnionMembers: true,
|
|
90
98
|
allowUnrecognizedEnumValues: true,
|
|
91
99
|
breadcrumbsPrefix: ["response"],
|
|
92
100
|
}));
|
|
93
101
|
case 500:
|
|
94
|
-
throw new MavenAGI.ServerError(
|
|
102
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
95
103
|
unrecognizedObjectKeys: "passthrough",
|
|
96
104
|
allowUnrecognizedUnionMembers: true,
|
|
97
105
|
allowUnrecognizedEnumValues: true,
|
|
@@ -144,17 +152,18 @@ export class Conversation {
|
|
|
144
152
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
145
153
|
"X-Fern-Language": "JavaScript",
|
|
146
154
|
"X-Fern-SDK-Name": "mavenagi",
|
|
147
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
155
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
148
156
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
149
157
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
150
158
|
},
|
|
151
159
|
contentType: "application/json",
|
|
160
|
+
requestType: "json",
|
|
152
161
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
153
162
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
154
163
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
155
164
|
});
|
|
156
165
|
if (_response.ok) {
|
|
157
|
-
return
|
|
166
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
158
167
|
unrecognizedObjectKeys: "passthrough",
|
|
159
168
|
allowUnrecognizedUnionMembers: true,
|
|
160
169
|
allowUnrecognizedEnumValues: true,
|
|
@@ -164,21 +173,21 @@ export class Conversation {
|
|
|
164
173
|
if (_response.error.reason === "status-code") {
|
|
165
174
|
switch (_response.error.statusCode) {
|
|
166
175
|
case 404:
|
|
167
|
-
throw new MavenAGI.NotFoundError(
|
|
176
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
168
177
|
unrecognizedObjectKeys: "passthrough",
|
|
169
178
|
allowUnrecognizedUnionMembers: true,
|
|
170
179
|
allowUnrecognizedEnumValues: true,
|
|
171
180
|
breadcrumbsPrefix: ["response"],
|
|
172
181
|
}));
|
|
173
182
|
case 400:
|
|
174
|
-
throw new MavenAGI.BadRequestError(
|
|
183
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
175
184
|
unrecognizedObjectKeys: "passthrough",
|
|
176
185
|
allowUnrecognizedUnionMembers: true,
|
|
177
186
|
allowUnrecognizedEnumValues: true,
|
|
178
187
|
breadcrumbsPrefix: ["response"],
|
|
179
188
|
}));
|
|
180
189
|
case 500:
|
|
181
|
-
throw new MavenAGI.ServerError(
|
|
190
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
182
191
|
unrecognizedObjectKeys: "passthrough",
|
|
183
192
|
allowUnrecognizedUnionMembers: true,
|
|
184
193
|
allowUnrecognizedEnumValues: true,
|
|
@@ -222,9 +231,13 @@ export class Conversation {
|
|
|
222
231
|
* conversationMessageId: {
|
|
223
232
|
* referenceId: "string"
|
|
224
233
|
* },
|
|
234
|
+
* userId: {
|
|
235
|
+
* referenceId: "string"
|
|
236
|
+
* },
|
|
225
237
|
* text: "string",
|
|
226
238
|
* userMessageType: MavenAGI.UserConversationMessageType.User,
|
|
227
|
-
*
|
|
239
|
+
* createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
240
|
+
* updatedAt: new Date("2024-01-15T09:30:00.000Z")
|
|
228
241
|
* }])
|
|
229
242
|
*/
|
|
230
243
|
appendNewMessages(conversationId, request, requestOptions) {
|
|
@@ -239,12 +252,13 @@ export class Conversation {
|
|
|
239
252
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
240
253
|
"X-Fern-Language": "JavaScript",
|
|
241
254
|
"X-Fern-SDK-Name": "mavenagi",
|
|
242
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
255
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
243
256
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
244
257
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
245
258
|
},
|
|
246
259
|
contentType: "application/json",
|
|
247
|
-
|
|
260
|
+
requestType: "json",
|
|
261
|
+
body: serializers.conversation.appendNewMessages.Request.jsonOrThrow(request, {
|
|
248
262
|
unrecognizedObjectKeys: "strip",
|
|
249
263
|
}),
|
|
250
264
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -252,7 +266,7 @@ export class Conversation {
|
|
|
252
266
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
253
267
|
});
|
|
254
268
|
if (_response.ok) {
|
|
255
|
-
return
|
|
269
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
256
270
|
unrecognizedObjectKeys: "passthrough",
|
|
257
271
|
allowUnrecognizedUnionMembers: true,
|
|
258
272
|
allowUnrecognizedEnumValues: true,
|
|
@@ -262,21 +276,21 @@ export class Conversation {
|
|
|
262
276
|
if (_response.error.reason === "status-code") {
|
|
263
277
|
switch (_response.error.statusCode) {
|
|
264
278
|
case 404:
|
|
265
|
-
throw new MavenAGI.NotFoundError(
|
|
279
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
266
280
|
unrecognizedObjectKeys: "passthrough",
|
|
267
281
|
allowUnrecognizedUnionMembers: true,
|
|
268
282
|
allowUnrecognizedEnumValues: true,
|
|
269
283
|
breadcrumbsPrefix: ["response"],
|
|
270
284
|
}));
|
|
271
285
|
case 400:
|
|
272
|
-
throw new MavenAGI.BadRequestError(
|
|
286
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
273
287
|
unrecognizedObjectKeys: "passthrough",
|
|
274
288
|
allowUnrecognizedUnionMembers: true,
|
|
275
289
|
allowUnrecognizedEnumValues: true,
|
|
276
290
|
breadcrumbsPrefix: ["response"],
|
|
277
291
|
}));
|
|
278
292
|
case 500:
|
|
279
|
-
throw new MavenAGI.ServerError(
|
|
293
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
280
294
|
unrecognizedObjectKeys: "passthrough",
|
|
281
295
|
allowUnrecognizedUnionMembers: true,
|
|
282
296
|
allowUnrecognizedEnumValues: true,
|
|
@@ -305,7 +319,7 @@ export class Conversation {
|
|
|
305
319
|
});
|
|
306
320
|
}
|
|
307
321
|
/**
|
|
308
|
-
* Ask a question
|
|
322
|
+
* Ask a question
|
|
309
323
|
*
|
|
310
324
|
* @param {string} conversationId - The ID of a new or existing conversation to use as context for the question
|
|
311
325
|
* @param {MavenAGI.AskRequest} request
|
|
@@ -320,9 +334,10 @@ export class Conversation {
|
|
|
320
334
|
* conversationMessageId: {
|
|
321
335
|
* referenceId: "string"
|
|
322
336
|
* },
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
337
|
+
* userId: {
|
|
338
|
+
* referenceId: "string"
|
|
339
|
+
* },
|
|
340
|
+
* text: "string"
|
|
326
341
|
* })
|
|
327
342
|
*/
|
|
328
343
|
ask(conversationId, request, requestOptions) {
|
|
@@ -337,18 +352,19 @@ export class Conversation {
|
|
|
337
352
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
338
353
|
"X-Fern-Language": "JavaScript",
|
|
339
354
|
"X-Fern-SDK-Name": "mavenagi",
|
|
340
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
355
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
341
356
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
342
357
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
343
358
|
},
|
|
344
359
|
contentType: "application/json",
|
|
345
|
-
|
|
360
|
+
requestType: "json",
|
|
361
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
346
362
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
347
363
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
348
364
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
349
365
|
});
|
|
350
366
|
if (_response.ok) {
|
|
351
|
-
return
|
|
367
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
352
368
|
unrecognizedObjectKeys: "passthrough",
|
|
353
369
|
allowUnrecognizedUnionMembers: true,
|
|
354
370
|
allowUnrecognizedEnumValues: true,
|
|
@@ -358,21 +374,21 @@ export class Conversation {
|
|
|
358
374
|
if (_response.error.reason === "status-code") {
|
|
359
375
|
switch (_response.error.statusCode) {
|
|
360
376
|
case 404:
|
|
361
|
-
throw new MavenAGI.NotFoundError(
|
|
377
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
362
378
|
unrecognizedObjectKeys: "passthrough",
|
|
363
379
|
allowUnrecognizedUnionMembers: true,
|
|
364
380
|
allowUnrecognizedEnumValues: true,
|
|
365
381
|
breadcrumbsPrefix: ["response"],
|
|
366
382
|
}));
|
|
367
383
|
case 400:
|
|
368
|
-
throw new MavenAGI.BadRequestError(
|
|
384
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
369
385
|
unrecognizedObjectKeys: "passthrough",
|
|
370
386
|
allowUnrecognizedUnionMembers: true,
|
|
371
387
|
allowUnrecognizedEnumValues: true,
|
|
372
388
|
breadcrumbsPrefix: ["response"],
|
|
373
389
|
}));
|
|
374
390
|
case 500:
|
|
375
|
-
throw new MavenAGI.ServerError(
|
|
391
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
376
392
|
unrecognizedObjectKeys: "passthrough",
|
|
377
393
|
allowUnrecognizedUnionMembers: true,
|
|
378
394
|
allowUnrecognizedEnumValues: true,
|
|
@@ -415,13 +431,14 @@ export class Conversation {
|
|
|
415
431
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
416
432
|
"X-Fern-Language": "JavaScript",
|
|
417
433
|
"X-Fern-SDK-Name": "mavenagi",
|
|
418
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
434
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
419
435
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
420
436
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
421
437
|
},
|
|
422
438
|
contentType: "application/json",
|
|
423
|
-
|
|
424
|
-
|
|
439
|
+
requestType: "json",
|
|
440
|
+
body: serializers.AskRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
441
|
+
responseType: "sse",
|
|
425
442
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
426
443
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
427
444
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -430,7 +447,7 @@ export class Conversation {
|
|
|
430
447
|
return new core.Stream({
|
|
431
448
|
stream: _response.body,
|
|
432
449
|
parse: (data) => __awaiter(this, void 0, void 0, function* () {
|
|
433
|
-
return
|
|
450
|
+
return serializers.StreamResponse.parseOrThrow(data, {
|
|
434
451
|
unrecognizedObjectKeys: "passthrough",
|
|
435
452
|
allowUnrecognizedUnionMembers: true,
|
|
436
453
|
allowUnrecognizedEnumValues: true,
|
|
@@ -447,21 +464,21 @@ export class Conversation {
|
|
|
447
464
|
if (_response.error.reason === "status-code") {
|
|
448
465
|
switch (_response.error.statusCode) {
|
|
449
466
|
case 404:
|
|
450
|
-
throw new MavenAGI.NotFoundError(
|
|
467
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
451
468
|
unrecognizedObjectKeys: "passthrough",
|
|
452
469
|
allowUnrecognizedUnionMembers: true,
|
|
453
470
|
allowUnrecognizedEnumValues: true,
|
|
454
471
|
breadcrumbsPrefix: ["response"],
|
|
455
472
|
}));
|
|
456
473
|
case 400:
|
|
457
|
-
throw new MavenAGI.BadRequestError(
|
|
474
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
458
475
|
unrecognizedObjectKeys: "passthrough",
|
|
459
476
|
allowUnrecognizedUnionMembers: true,
|
|
460
477
|
allowUnrecognizedEnumValues: true,
|
|
461
478
|
breadcrumbsPrefix: ["response"],
|
|
462
479
|
}));
|
|
463
480
|
case 500:
|
|
464
|
-
throw new MavenAGI.ServerError(
|
|
481
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
465
482
|
unrecognizedObjectKeys: "passthrough",
|
|
466
483
|
allowUnrecognizedUnionMembers: true,
|
|
467
484
|
allowUnrecognizedEnumValues: true,
|
|
@@ -519,20 +536,19 @@ export class Conversation {
|
|
|
519
536
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
520
537
|
"X-Fern-Language": "JavaScript",
|
|
521
538
|
"X-Fern-SDK-Name": "mavenagi",
|
|
522
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
539
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
523
540
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
524
541
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
525
542
|
},
|
|
526
543
|
contentType: "application/json",
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}),
|
|
544
|
+
requestType: "json",
|
|
545
|
+
body: serializers.GenerateMavenSuggestionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
530
546
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
531
547
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
532
548
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
533
549
|
});
|
|
534
550
|
if (_response.ok) {
|
|
535
|
-
return
|
|
551
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
536
552
|
unrecognizedObjectKeys: "passthrough",
|
|
537
553
|
allowUnrecognizedUnionMembers: true,
|
|
538
554
|
allowUnrecognizedEnumValues: true,
|
|
@@ -542,21 +558,21 @@ export class Conversation {
|
|
|
542
558
|
if (_response.error.reason === "status-code") {
|
|
543
559
|
switch (_response.error.statusCode) {
|
|
544
560
|
case 404:
|
|
545
|
-
throw new MavenAGI.NotFoundError(
|
|
561
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
546
562
|
unrecognizedObjectKeys: "passthrough",
|
|
547
563
|
allowUnrecognizedUnionMembers: true,
|
|
548
564
|
allowUnrecognizedEnumValues: true,
|
|
549
565
|
breadcrumbsPrefix: ["response"],
|
|
550
566
|
}));
|
|
551
567
|
case 400:
|
|
552
|
-
throw new MavenAGI.BadRequestError(
|
|
568
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
553
569
|
unrecognizedObjectKeys: "passthrough",
|
|
554
570
|
allowUnrecognizedUnionMembers: true,
|
|
555
571
|
allowUnrecognizedEnumValues: true,
|
|
556
572
|
breadcrumbsPrefix: ["response"],
|
|
557
573
|
}));
|
|
558
574
|
case 500:
|
|
559
|
-
throw new MavenAGI.ServerError(
|
|
575
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
560
576
|
unrecognizedObjectKeys: "passthrough",
|
|
561
577
|
allowUnrecognizedUnionMembers: true,
|
|
562
578
|
allowUnrecognizedEnumValues: true,
|
|
@@ -596,9 +612,15 @@ export class Conversation {
|
|
|
596
612
|
*
|
|
597
613
|
* @example
|
|
598
614
|
* await client.conversation.createFeedback({
|
|
599
|
-
*
|
|
600
|
-
*
|
|
601
|
-
*
|
|
615
|
+
* feedbackId: {
|
|
616
|
+
* referenceId: "string"
|
|
617
|
+
* },
|
|
618
|
+
* conversationId: {
|
|
619
|
+
* referenceId: "string"
|
|
620
|
+
* },
|
|
621
|
+
* conversationMessageId: {
|
|
622
|
+
* referenceId: "string"
|
|
623
|
+
* },
|
|
602
624
|
* type: MavenAGI.FeedbackType.ThumbsUp,
|
|
603
625
|
* text: "string"
|
|
604
626
|
* })
|
|
@@ -615,37 +637,43 @@ export class Conversation {
|
|
|
615
637
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
616
638
|
"X-Fern-Language": "JavaScript",
|
|
617
639
|
"X-Fern-SDK-Name": "mavenagi",
|
|
618
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
640
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
619
641
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
620
642
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
621
643
|
},
|
|
622
644
|
contentType: "application/json",
|
|
623
|
-
|
|
645
|
+
requestType: "json",
|
|
646
|
+
body: serializers.FeedbackRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
624
647
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
625
648
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
626
649
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
627
650
|
});
|
|
628
651
|
if (_response.ok) {
|
|
629
|
-
return
|
|
652
|
+
return serializers.Feedback.parseOrThrow(_response.body, {
|
|
653
|
+
unrecognizedObjectKeys: "passthrough",
|
|
654
|
+
allowUnrecognizedUnionMembers: true,
|
|
655
|
+
allowUnrecognizedEnumValues: true,
|
|
656
|
+
breadcrumbsPrefix: ["response"],
|
|
657
|
+
});
|
|
630
658
|
}
|
|
631
659
|
if (_response.error.reason === "status-code") {
|
|
632
660
|
switch (_response.error.statusCode) {
|
|
633
661
|
case 404:
|
|
634
|
-
throw new MavenAGI.NotFoundError(
|
|
662
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
635
663
|
unrecognizedObjectKeys: "passthrough",
|
|
636
664
|
allowUnrecognizedUnionMembers: true,
|
|
637
665
|
allowUnrecognizedEnumValues: true,
|
|
638
666
|
breadcrumbsPrefix: ["response"],
|
|
639
667
|
}));
|
|
640
668
|
case 400:
|
|
641
|
-
throw new MavenAGI.BadRequestError(
|
|
669
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
642
670
|
unrecognizedObjectKeys: "passthrough",
|
|
643
671
|
allowUnrecognizedUnionMembers: true,
|
|
644
672
|
allowUnrecognizedEnumValues: true,
|
|
645
673
|
breadcrumbsPrefix: ["response"],
|
|
646
674
|
}));
|
|
647
675
|
case 500:
|
|
648
|
-
throw new MavenAGI.ServerError(
|
|
676
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
649
677
|
unrecognizedObjectKeys: "passthrough",
|
|
650
678
|
allowUnrecognizedUnionMembers: true,
|
|
651
679
|
allowUnrecognizedEnumValues: true,
|
|
@@ -687,16 +715,6 @@ export class Conversation {
|
|
|
687
715
|
* @example
|
|
688
716
|
* await client.conversation.submitActionForm("string", {
|
|
689
717
|
* actionFormId: "string",
|
|
690
|
-
* userContext: {
|
|
691
|
-
* name: "string",
|
|
692
|
-
* id: {
|
|
693
|
-
* "string": "string"
|
|
694
|
-
* },
|
|
695
|
-
* email: "string",
|
|
696
|
-
* context: {
|
|
697
|
-
* "string": "string"
|
|
698
|
-
* }
|
|
699
|
-
* },
|
|
700
718
|
* parameters: {
|
|
701
719
|
* "string": {
|
|
702
720
|
* "key": "value"
|
|
@@ -716,18 +734,19 @@ export class Conversation {
|
|
|
716
734
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
717
735
|
"X-Fern-Language": "JavaScript",
|
|
718
736
|
"X-Fern-SDK-Name": "mavenagi",
|
|
719
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
737
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
720
738
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
721
739
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
722
740
|
},
|
|
723
741
|
contentType: "application/json",
|
|
724
|
-
|
|
742
|
+
requestType: "json",
|
|
743
|
+
body: serializers.SubmitActionFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
725
744
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
726
745
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
727
746
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
728
747
|
});
|
|
729
748
|
if (_response.ok) {
|
|
730
|
-
return
|
|
749
|
+
return serializers.ConversationResponse.parseOrThrow(_response.body, {
|
|
731
750
|
unrecognizedObjectKeys: "passthrough",
|
|
732
751
|
allowUnrecognizedUnionMembers: true,
|
|
733
752
|
allowUnrecognizedEnumValues: true,
|
|
@@ -737,21 +756,21 @@ export class Conversation {
|
|
|
737
756
|
if (_response.error.reason === "status-code") {
|
|
738
757
|
switch (_response.error.statusCode) {
|
|
739
758
|
case 404:
|
|
740
|
-
throw new MavenAGI.NotFoundError(
|
|
759
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
741
760
|
unrecognizedObjectKeys: "passthrough",
|
|
742
761
|
allowUnrecognizedUnionMembers: true,
|
|
743
762
|
allowUnrecognizedEnumValues: true,
|
|
744
763
|
breadcrumbsPrefix: ["response"],
|
|
745
764
|
}));
|
|
746
765
|
case 400:
|
|
747
|
-
throw new MavenAGI.BadRequestError(
|
|
766
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
748
767
|
unrecognizedObjectKeys: "passthrough",
|
|
749
768
|
allowUnrecognizedUnionMembers: true,
|
|
750
769
|
allowUnrecognizedEnumValues: true,
|
|
751
770
|
breadcrumbsPrefix: ["response"],
|
|
752
771
|
}));
|
|
753
772
|
case 500:
|
|
754
|
-
throw new MavenAGI.ServerError(
|
|
773
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
755
774
|
unrecognizedObjectKeys: "passthrough",
|
|
756
775
|
allowUnrecognizedUnionMembers: true,
|
|
757
776
|
allowUnrecognizedEnumValues: true,
|
|
@@ -780,7 +799,7 @@ export class Conversation {
|
|
|
780
799
|
});
|
|
781
800
|
}
|
|
782
801
|
/**
|
|
783
|
-
* Add metadata to an existing conversation
|
|
802
|
+
* Add metadata to an existing conversation. If a metadata field already exists, it will be overwritten.
|
|
784
803
|
*
|
|
785
804
|
* @param {string} conversationId - The ID of a conversation the metadata being added belongs to
|
|
786
805
|
* @param {Record<string, string>} request
|
|
@@ -807,12 +826,13 @@ export class Conversation {
|
|
|
807
826
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
808
827
|
"X-Fern-Language": "JavaScript",
|
|
809
828
|
"X-Fern-SDK-Name": "mavenagi",
|
|
810
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
829
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
811
830
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
812
831
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
813
832
|
},
|
|
814
833
|
contentType: "application/json",
|
|
815
|
-
|
|
834
|
+
requestType: "json",
|
|
835
|
+
body: serializers.conversation.addConversationMetadata.Request.jsonOrThrow(request, {
|
|
816
836
|
unrecognizedObjectKeys: "strip",
|
|
817
837
|
}),
|
|
818
838
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -820,7 +840,7 @@ export class Conversation {
|
|
|
820
840
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
821
841
|
});
|
|
822
842
|
if (_response.ok) {
|
|
823
|
-
return
|
|
843
|
+
return serializers.conversation.addConversationMetadata.Response.parseOrThrow(_response.body, {
|
|
824
844
|
unrecognizedObjectKeys: "passthrough",
|
|
825
845
|
allowUnrecognizedUnionMembers: true,
|
|
826
846
|
allowUnrecognizedEnumValues: true,
|
|
@@ -830,21 +850,21 @@ export class Conversation {
|
|
|
830
850
|
if (_response.error.reason === "status-code") {
|
|
831
851
|
switch (_response.error.statusCode) {
|
|
832
852
|
case 404:
|
|
833
|
-
throw new MavenAGI.NotFoundError(
|
|
853
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
834
854
|
unrecognizedObjectKeys: "passthrough",
|
|
835
855
|
allowUnrecognizedUnionMembers: true,
|
|
836
856
|
allowUnrecognizedEnumValues: true,
|
|
837
857
|
breadcrumbsPrefix: ["response"],
|
|
838
858
|
}));
|
|
839
859
|
case 400:
|
|
840
|
-
throw new MavenAGI.BadRequestError(
|
|
860
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
841
861
|
unrecognizedObjectKeys: "passthrough",
|
|
842
862
|
allowUnrecognizedUnionMembers: true,
|
|
843
863
|
allowUnrecognizedEnumValues: true,
|
|
844
864
|
breadcrumbsPrefix: ["response"],
|
|
845
865
|
}));
|
|
846
866
|
case 500:
|
|
847
|
-
throw new MavenAGI.ServerError(
|
|
867
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
848
868
|
unrecognizedObjectKeys: "passthrough",
|
|
849
869
|
allowUnrecognizedUnionMembers: true,
|
|
850
870
|
allowUnrecognizedEnumValues: true,
|
|
@@ -5,10 +5,8 @@ import * as MavenAGI from "../../../index";
|
|
|
5
5
|
export interface AskRequest {
|
|
6
6
|
/** Externally supplied ID to uniquely identify this message within the conversation */
|
|
7
7
|
conversationMessageId: MavenAGI.EntityIdBase;
|
|
8
|
+
/** Externally supplied ID to uniquely identify the user that created this message */
|
|
9
|
+
userId: MavenAGI.EntityIdBase;
|
|
8
10
|
/** The text of the message */
|
|
9
11
|
text: string;
|
|
10
|
-
/** The context of the message */
|
|
11
|
-
context?: MavenAGI.ConversationMessageContext;
|
|
12
|
-
/** Optional configuration for responses to this conversation. Only applies to new conversations. */
|
|
13
|
-
responseConfig?: MavenAGI.ResponseConfig;
|
|
14
12
|
}
|
|
@@ -5,4 +5,16 @@ import * as MavenAGI from "../../../index";
|
|
|
5
5
|
export interface ConversationBase {
|
|
6
6
|
/** Optional configurations for responses to this conversation */
|
|
7
7
|
responseConfig?: MavenAGI.ResponseConfig;
|
|
8
|
+
/** The subject of the conversation */
|
|
9
|
+
subject?: string;
|
|
10
|
+
/** The url of the conversation */
|
|
11
|
+
url?: string;
|
|
12
|
+
/** The date and time the conversation was created */
|
|
13
|
+
createdAt?: Date;
|
|
14
|
+
/** The date and time the conversation was last updated */
|
|
15
|
+
updatedAt?: Date;
|
|
16
|
+
/** The tags of the conversation. Used for filtering in Agent Designer. */
|
|
17
|
+
tags?: Set<string>;
|
|
18
|
+
/** The metadata of the conversation. */
|
|
19
|
+
metadata?: Record<string, string>;
|
|
8
20
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as MavenAGI from "../../../index";
|
|
5
4
|
export interface ConversationMessageBase {
|
|
6
|
-
/** The
|
|
7
|
-
|
|
5
|
+
/** The date and time the conversation was created */
|
|
6
|
+
createdAt?: Date;
|
|
7
|
+
/** The date and time the conversation was last updated */
|
|
8
|
+
updatedAt?: Date;
|
|
8
9
|
}
|
|
@@ -7,6 +7,4 @@ export interface ConversationRequest extends MavenAGI.ConversationBase {
|
|
|
7
7
|
conversationId: MavenAGI.EntityIdBase;
|
|
8
8
|
/** The messages in the conversation */
|
|
9
9
|
messages: MavenAGI.ConversationMessageRequest[];
|
|
10
|
-
/** The context of the conversation */
|
|
11
|
-
context?: MavenAGI.ConversationContext;
|
|
12
10
|
}
|
|
@@ -7,6 +7,4 @@ export interface ConversationResponse extends MavenAGI.ConversationBase {
|
|
|
7
7
|
conversationId: MavenAGI.EntityId;
|
|
8
8
|
/** The messages in the conversation */
|
|
9
9
|
messages: MavenAGI.ConversationMessageResponse[];
|
|
10
|
-
/** The context of the conversation */
|
|
11
|
-
context: MavenAGI.ConversationContext;
|
|
12
10
|
}
|
|
@@ -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
|
+
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as MavenAGI from "../../../index";
|
|
5
4
|
export interface SubmitActionFormRequest {
|
|
6
5
|
actionFormId: string;
|
|
7
|
-
|
|
8
|
-
/** Map of parameter names to values */
|
|
6
|
+
/** Map of parameter IDs to values provided by the user. All required action fields must be provided. */
|
|
9
7
|
parameters: Record<string, unknown>;
|
|
10
8
|
}
|