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
package/Client.d.ts
CHANGED
|
@@ -13,14 +13,23 @@ export declare namespace MavenAGIClient {
|
|
|
13
13
|
environment?: core.Supplier<environments.MavenAGIEnvironment | string>;
|
|
14
14
|
appId?: core.Supplier<string | undefined>;
|
|
15
15
|
appSecret?: core.Supplier<string | undefined>;
|
|
16
|
+
/** Override the X-Organization-Id header */
|
|
16
17
|
organizationId: core.Supplier<string>;
|
|
18
|
+
/** Override the X-Agent-Id header */
|
|
17
19
|
agentId: core.Supplier<string>;
|
|
18
20
|
fetcher?: core.FetchFunction;
|
|
19
21
|
}
|
|
20
22
|
interface RequestOptions {
|
|
23
|
+
/** The maximum time to wait for a response in seconds. */
|
|
21
24
|
timeoutInSeconds?: number;
|
|
25
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
22
26
|
maxRetries?: number;
|
|
27
|
+
/** A hook to abort the request. */
|
|
23
28
|
abortSignal?: AbortSignal;
|
|
29
|
+
/** Override the X-Organization-Id header */
|
|
30
|
+
organizationId?: string;
|
|
31
|
+
/** Override the X-Agent-Id header */
|
|
32
|
+
agentId?: string;
|
|
24
33
|
}
|
|
25
34
|
}
|
|
26
35
|
export declare class MavenAGIClient {
|
package/README.md
CHANGED
|
@@ -16,7 +16,6 @@ npm i -s mavenagi
|
|
|
16
16
|
Instantiate and use the client with the following:
|
|
17
17
|
|
|
18
18
|
```typescript
|
|
19
|
-
import * as environments from "../src/environments";
|
|
20
19
|
import { MavenAGIClient, MavenAGI } from "mavenagi";
|
|
21
20
|
|
|
22
21
|
const client = new MavenAGIClient({
|
|
@@ -30,12 +29,19 @@ await client.conversation.initialize({
|
|
|
30
29
|
referenceId: "string",
|
|
31
30
|
},
|
|
32
31
|
messages: [{}],
|
|
33
|
-
context: {},
|
|
34
32
|
responseConfig: {
|
|
35
33
|
capabilities: [MavenAGI.Capability.Markdown],
|
|
36
34
|
isCopilot: true,
|
|
37
35
|
responseLength: MavenAGI.ResponseLength.Short,
|
|
38
36
|
},
|
|
37
|
+
subject: "string",
|
|
38
|
+
url: "string",
|
|
39
|
+
createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
40
|
+
updatedAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
41
|
+
tags: new Set(["string"]),
|
|
42
|
+
metadata: {
|
|
43
|
+
string: "string",
|
|
44
|
+
},
|
|
39
45
|
});
|
|
40
46
|
```
|
|
41
47
|
|
|
@@ -48,7 +54,7 @@ will be thrown.
|
|
|
48
54
|
import { MavenAGIError } from "mavenagi";
|
|
49
55
|
|
|
50
56
|
try {
|
|
51
|
-
await client.initialize(...);
|
|
57
|
+
await client.conversation.initialize(...);
|
|
52
58
|
} catch (err) {
|
|
53
59
|
if (err instanceof MavenAGIError) {
|
|
54
60
|
console.log(err.statusCode);
|
|
@@ -113,7 +119,7 @@ A request is deemed retriable when any of the following HTTP status codes is ret
|
|
|
113
119
|
Use the `maxRetries` request option to configure this behavior.
|
|
114
120
|
|
|
115
121
|
```typescript
|
|
116
|
-
const response = await client.initialize(..., {
|
|
122
|
+
const response = await client.conversation.initialize(..., {
|
|
117
123
|
maxRetries: 0 // override maxRetries at the request level
|
|
118
124
|
});
|
|
119
125
|
```
|
|
@@ -123,11 +129,49 @@ const response = await client.initialize(..., {
|
|
|
123
129
|
The SDK defaults to a 60 second timeout. Use the `timeoutInSeconds` option to configure this behavior.
|
|
124
130
|
|
|
125
131
|
```typescript
|
|
126
|
-
const response = await client.initialize(..., {
|
|
132
|
+
const response = await client.conversation.initialize(..., {
|
|
127
133
|
timeoutInSeconds: 30 // override timeout to 30s
|
|
128
134
|
});
|
|
129
135
|
```
|
|
130
136
|
|
|
137
|
+
### Aborting Requests
|
|
138
|
+
|
|
139
|
+
The SDK allows users to abort requests at any point by passing in an abort signal.
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
const controller = new AbortController();
|
|
143
|
+
const response = await client.conversation.initialize(..., {
|
|
144
|
+
abortSignal: controller.signal
|
|
145
|
+
});
|
|
146
|
+
controller.abort(); // aborts the request
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Runtime Compatibility
|
|
150
|
+
|
|
151
|
+
The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following
|
|
152
|
+
runtimes:
|
|
153
|
+
|
|
154
|
+
- Node.js 18+
|
|
155
|
+
- Vercel
|
|
156
|
+
- Cloudflare Workers
|
|
157
|
+
- Deno v1.25+
|
|
158
|
+
- Bun 1.0+
|
|
159
|
+
- React Native
|
|
160
|
+
|
|
161
|
+
### Customizing Fetch Client
|
|
162
|
+
|
|
163
|
+
The SDK provides a way for your to customize the underlying HTTP client / Fetch function. If you're running in an
|
|
164
|
+
unsupported environment, this provides a way for you to break glass and ensure the SDK works.
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
import { MavenAGIClient } from "mavenagi";
|
|
168
|
+
|
|
169
|
+
const client = new MavenAGIClient({
|
|
170
|
+
...
|
|
171
|
+
fetcher: // provide your implementation here
|
|
172
|
+
});
|
|
173
|
+
```
|
|
174
|
+
|
|
131
175
|
## Contributing
|
|
132
176
|
|
|
133
177
|
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
@@ -9,14 +9,23 @@ export declare namespace Actions {
|
|
|
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 Actions {
|
|
@@ -56,18 +56,19 @@ export class Actions {
|
|
|
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.14",
|
|
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.ActionRequest.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.ActionResponse.parseOrThrow(_response.body, {
|
|
71
72
|
unrecognizedObjectKeys: "passthrough",
|
|
72
73
|
allowUnrecognizedUnionMembers: true,
|
|
73
74
|
allowUnrecognizedEnumValues: true,
|
|
@@ -77,21 +78,21 @@ export class Actions {
|
|
|
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 Actions {
|
|
|
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.14",
|
|
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.ActionResponse.parseOrThrow(_response.body, {
|
|
158
160
|
unrecognizedObjectKeys: "passthrough",
|
|
159
161
|
allowUnrecognizedUnionMembers: true,
|
|
160
162
|
allowUnrecognizedEnumValues: true,
|
|
@@ -164,21 +166,21 @@ export class Actions {
|
|
|
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,
|
|
@@ -231,11 +233,12 @@ export class Actions {
|
|
|
231
233
|
"X-Agent-Id": yield core.Supplier.get(this._options.agentId),
|
|
232
234
|
"X-Fern-Language": "JavaScript",
|
|
233
235
|
"X-Fern-SDK-Name": "mavenagi",
|
|
234
|
-
"X-Fern-SDK-Version": "0.0.0-alpha.
|
|
236
|
+
"X-Fern-SDK-Version": "0.0.0-alpha.14",
|
|
235
237
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
236
238
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
237
239
|
},
|
|
238
240
|
contentType: "application/json",
|
|
241
|
+
requestType: "json",
|
|
239
242
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
240
243
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
241
244
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -246,21 +249,21 @@ export class Actions {
|
|
|
246
249
|
if (_response.error.reason === "status-code") {
|
|
247
250
|
switch (_response.error.statusCode) {
|
|
248
251
|
case 404:
|
|
249
|
-
throw new MavenAGI.NotFoundError(
|
|
252
|
+
throw new MavenAGI.NotFoundError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
250
253
|
unrecognizedObjectKeys: "passthrough",
|
|
251
254
|
allowUnrecognizedUnionMembers: true,
|
|
252
255
|
allowUnrecognizedEnumValues: true,
|
|
253
256
|
breadcrumbsPrefix: ["response"],
|
|
254
257
|
}));
|
|
255
258
|
case 400:
|
|
256
|
-
throw new MavenAGI.BadRequestError(
|
|
259
|
+
throw new MavenAGI.BadRequestError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
257
260
|
unrecognizedObjectKeys: "passthrough",
|
|
258
261
|
allowUnrecognizedUnionMembers: true,
|
|
259
262
|
allowUnrecognizedEnumValues: true,
|
|
260
263
|
breadcrumbsPrefix: ["response"],
|
|
261
264
|
}));
|
|
262
265
|
case 500:
|
|
263
|
-
throw new MavenAGI.ServerError(
|
|
266
|
+
throw new MavenAGI.ServerError(serializers.ErrorMessage.parseOrThrow(_response.error.body, {
|
|
264
267
|
unrecognizedObjectKeys: "passthrough",
|
|
265
268
|
allowUnrecognizedUnionMembers: true,
|
|
266
269
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as MavenAGI from "../../../index";
|
|
5
5
|
export interface AppUser {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/** Used to determine whether two users from different apps are the same */
|
|
7
|
+
identifiers: MavenAGI.AppUserIdentifier[];
|
|
8
|
+
data: Record<string, MavenAGI.UserData>;
|
|
8
9
|
}
|
|
@@ -2,7 +2,25 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as MavenAGI from "../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* userId: {
|
|
9
|
+
* referenceId: "user-0"
|
|
10
|
+
* },
|
|
11
|
+
* identifiers: new Set([{
|
|
12
|
+
* value: "joe@myapp.com",
|
|
13
|
+
* type: MavenAGI.AppUserIdentifyingPropertyType.Email
|
|
14
|
+
* }]),
|
|
15
|
+
* data: {
|
|
16
|
+
* "name": {
|
|
17
|
+
* value: "Joe",
|
|
18
|
+
* visibility: MavenAGI.VisibilityType.Visible
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
5
23
|
export interface AppUserRequest extends MavenAGI.AppUser {
|
|
6
24
|
/** ID that uniquely identifies this app user */
|
|
7
|
-
|
|
25
|
+
userId: MavenAGI.EntityIdBase;
|
|
8
26
|
}
|
|
@@ -2,7 +2,39 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as MavenAGI from "../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* userId: {
|
|
9
|
+
* referenceId: "user-0",
|
|
10
|
+
* appId: "myapp",
|
|
11
|
+
* organizationId: "acme",
|
|
12
|
+
* agentId: "support",
|
|
13
|
+
* type: MavenAGI.EntityType.UserProfile
|
|
14
|
+
* },
|
|
15
|
+
* identifiers: new Set([{
|
|
16
|
+
* value: "joe@myapp.com",
|
|
17
|
+
* type: MavenAGI.AppUserIdentifyingPropertyType.Email
|
|
18
|
+
* }]),
|
|
19
|
+
* data: {
|
|
20
|
+
* "name": {
|
|
21
|
+
* value: "Joe",
|
|
22
|
+
* visibility: MavenAGI.VisibilityType.Visible
|
|
23
|
+
* }
|
|
24
|
+
* },
|
|
25
|
+
* allUserData: {
|
|
26
|
+
* "myapp": {
|
|
27
|
+
* "name": "Joe"
|
|
28
|
+
* },
|
|
29
|
+
* "defaultUserData": {
|
|
30
|
+
* "name": "Joe"
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
*/
|
|
5
35
|
export interface AppUserResponse extends MavenAGI.AppUser {
|
|
6
|
-
/** ID that uniquely identifies this
|
|
7
|
-
|
|
36
|
+
/** ID that uniquely identifies this user */
|
|
37
|
+
userId: MavenAGI.EntityId;
|
|
38
|
+
/** Data from all apps */
|
|
39
|
+
allUserData: Record<string, Record<string, string>>;
|
|
8
40
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export declare type EntityType = "CONVERSATION" | "CONVERSATION_MESSAGE" | "KNOWLEDGE_BASE" | "KNOWLEDGE_DOCUMENT" | "ACTION" | "USER" | "USER_EVENT" | "EVENT_TRIGGER" | "USER_PROFILE";
|
|
4
|
+
export declare type EntityType = "CONVERSATION" | "CONVERSATION_MESSAGE" | "KNOWLEDGE_BASE" | "KNOWLEDGE_DOCUMENT" | "ACTION" | "USER" | "USER_EVENT" | "EVENT_TRIGGER" | "USER_PROFILE" | "FEEDBACK";
|
|
5
5
|
export declare const EntityType: {
|
|
6
6
|
readonly Conversation: "CONVERSATION";
|
|
7
7
|
readonly ConversationMessage: "CONVERSATION_MESSAGE";
|
|
@@ -12,4 +12,5 @@ export declare const EntityType: {
|
|
|
12
12
|
readonly UserEvent: "USER_EVENT";
|
|
13
13
|
readonly EventTrigger: "EVENT_TRIGGER";
|
|
14
14
|
readonly UserProfile: "USER_PROFILE";
|
|
15
|
+
readonly Feedback: "FEEDBACK";
|
|
15
16
|
};
|
|
@@ -2,15 +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 interface Feedback {
|
|
5
|
+
export interface Feedback extends MavenAGI.FeedbackBase {
|
|
6
6
|
/** The ID of the piece of feedback */
|
|
7
|
-
|
|
7
|
+
feedbackId: MavenAGI.EntityId;
|
|
8
8
|
/** The ID of the conversation the feedback is about */
|
|
9
|
-
conversationId:
|
|
9
|
+
conversationId: MavenAGI.EntityId;
|
|
10
10
|
/** The ID of the conversation message the feedback is about */
|
|
11
|
-
conversationMessageId:
|
|
12
|
-
/** The type of feedback */
|
|
13
|
-
type: MavenAGI.FeedbackType;
|
|
14
|
-
/** The feedback text */
|
|
15
|
-
text?: string;
|
|
11
|
+
conversationMessageId: MavenAGI.EntityId;
|
|
16
12
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as MavenAGI from "../../../index";
|
|
5
|
+
export interface FeedbackBase {
|
|
6
|
+
/** The type of feedback */
|
|
7
|
+
type: MavenAGI.FeedbackType;
|
|
8
|
+
/** The feedback text */
|
|
9
|
+
text?: string;
|
|
10
|
+
}
|
|
@@ -2,10 +2,9 @@ export * from "./ErrorMessage";
|
|
|
2
2
|
export * from "./EntityType";
|
|
3
3
|
export * from "./EntityIdBase";
|
|
4
4
|
export * from "./EntityId";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./FeedbackBase";
|
|
6
6
|
export * from "./FeedbackType";
|
|
7
7
|
export * from "./Feedback";
|
|
8
|
-
export * from "./AppUserIdentification";
|
|
9
8
|
export * from "./AppUserIdentifier";
|
|
10
9
|
export * from "./AppUserIdentifyingPropertyType";
|
|
11
10
|
export * from "./AppUser";
|
|
@@ -13,3 +12,6 @@ export * from "./UserData";
|
|
|
13
12
|
export * from "./VisibilityType";
|
|
14
13
|
export * from "./AppUserRequest";
|
|
15
14
|
export * from "./AppUserResponse";
|
|
15
|
+
export * from "./EventTriggerBase";
|
|
16
|
+
export * from "./EventTriggerResponse";
|
|
17
|
+
export * from "./EventTriggerType";
|
|
@@ -2,10 +2,9 @@ export * from "./ErrorMessage";
|
|
|
2
2
|
export * from "./EntityType";
|
|
3
3
|
export * from "./EntityIdBase";
|
|
4
4
|
export * from "./EntityId";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./FeedbackBase";
|
|
6
6
|
export * from "./FeedbackType";
|
|
7
7
|
export * from "./Feedback";
|
|
8
|
-
export * from "./AppUserIdentification";
|
|
9
8
|
export * from "./AppUserIdentifier";
|
|
10
9
|
export * from "./AppUserIdentifyingPropertyType";
|
|
11
10
|
export * from "./AppUser";
|
|
@@ -13,3 +12,6 @@ export * from "./UserData";
|
|
|
13
12
|
export * from "./VisibilityType";
|
|
14
13
|
export * from "./AppUserRequest";
|
|
15
14
|
export * from "./AppUserResponse";
|
|
15
|
+
export * from "./EventTriggerBase";
|
|
16
|
+
export * from "./EventTriggerResponse";
|
|
17
|
+
export * from "./EventTriggerType";
|
|
@@ -9,21 +9,30 @@ 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
|
+
/** 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 Conversation {
|
|
23
32
|
protected readonly _options: Conversation.Options;
|
|
24
33
|
constructor(_options: Conversation.Options);
|
|
25
34
|
/**
|
|
26
|
-
*
|
|
35
|
+
* Initialize a new conversation. Only required if the ask request wishes to supply conversation level data or when syncing to external systems.
|
|
27
36
|
*
|
|
28
37
|
* @param {MavenAGI.ConversationRequest} request
|
|
29
38
|
* @param {Conversation.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -38,11 +47,18 @@ export declare class Conversation {
|
|
|
38
47
|
* referenceId: "string"
|
|
39
48
|
* },
|
|
40
49
|
* messages: [{}],
|
|
41
|
-
* context: {},
|
|
42
50
|
* responseConfig: {
|
|
43
51
|
* capabilities: [MavenAGI.Capability.Markdown],
|
|
44
52
|
* isCopilot: true,
|
|
45
53
|
* responseLength: MavenAGI.ResponseLength.Short
|
|
54
|
+
* },
|
|
55
|
+
* subject: "string",
|
|
56
|
+
* url: "string",
|
|
57
|
+
* createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
58
|
+
* updatedAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
59
|
+
* tags: new Set(["string"]),
|
|
60
|
+
* metadata: {
|
|
61
|
+
* "string": "string"
|
|
46
62
|
* }
|
|
47
63
|
* })
|
|
48
64
|
*/
|
|
@@ -77,14 +93,18 @@ export declare class Conversation {
|
|
|
77
93
|
* conversationMessageId: {
|
|
78
94
|
* referenceId: "string"
|
|
79
95
|
* },
|
|
96
|
+
* userId: {
|
|
97
|
+
* referenceId: "string"
|
|
98
|
+
* },
|
|
80
99
|
* text: "string",
|
|
81
100
|
* userMessageType: MavenAGI.UserConversationMessageType.User,
|
|
82
|
-
*
|
|
101
|
+
* createdAt: new Date("2024-01-15T09:30:00.000Z"),
|
|
102
|
+
* updatedAt: new Date("2024-01-15T09:30:00.000Z")
|
|
83
103
|
* }])
|
|
84
104
|
*/
|
|
85
105
|
appendNewMessages(conversationId: string, request: MavenAGI.ConversationMessageRequest[], requestOptions?: Conversation.RequestOptions): Promise<MavenAGI.ConversationResponse>;
|
|
86
106
|
/**
|
|
87
|
-
* Ask a question
|
|
107
|
+
* Ask a question
|
|
88
108
|
*
|
|
89
109
|
* @param {string} conversationId - The ID of a new or existing conversation to use as context for the question
|
|
90
110
|
* @param {MavenAGI.AskRequest} request
|
|
@@ -99,9 +119,10 @@ export declare class Conversation {
|
|
|
99
119
|
* conversationMessageId: {
|
|
100
120
|
* referenceId: "string"
|
|
101
121
|
* },
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
122
|
+
* userId: {
|
|
123
|
+
* referenceId: "string"
|
|
124
|
+
* },
|
|
125
|
+
* text: "string"
|
|
105
126
|
* })
|
|
106
127
|
*/
|
|
107
128
|
ask(conversationId: string, request: MavenAGI.AskRequest, requestOptions?: Conversation.RequestOptions): Promise<MavenAGI.ConversationResponse>;
|
|
@@ -140,14 +161,20 @@ export declare class Conversation {
|
|
|
140
161
|
*
|
|
141
162
|
* @example
|
|
142
163
|
* await client.conversation.createFeedback({
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
164
|
+
* feedbackId: {
|
|
165
|
+
* referenceId: "string"
|
|
166
|
+
* },
|
|
167
|
+
* conversationId: {
|
|
168
|
+
* referenceId: "string"
|
|
169
|
+
* },
|
|
170
|
+
* conversationMessageId: {
|
|
171
|
+
* referenceId: "string"
|
|
172
|
+
* },
|
|
146
173
|
* type: MavenAGI.FeedbackType.ThumbsUp,
|
|
147
174
|
* text: "string"
|
|
148
175
|
* })
|
|
149
176
|
*/
|
|
150
|
-
createFeedback(request: MavenAGI.FeedbackRequest, requestOptions?: Conversation.RequestOptions): Promise<
|
|
177
|
+
createFeedback(request: MavenAGI.FeedbackRequest, requestOptions?: Conversation.RequestOptions): Promise<MavenAGI.Feedback>;
|
|
151
178
|
/**
|
|
152
179
|
* Submit a filled out action form
|
|
153
180
|
*
|
|
@@ -162,16 +189,6 @@ export declare class Conversation {
|
|
|
162
189
|
* @example
|
|
163
190
|
* await client.conversation.submitActionForm("string", {
|
|
164
191
|
* actionFormId: "string",
|
|
165
|
-
* userContext: {
|
|
166
|
-
* name: "string",
|
|
167
|
-
* id: {
|
|
168
|
-
* "string": "string"
|
|
169
|
-
* },
|
|
170
|
-
* email: "string",
|
|
171
|
-
* context: {
|
|
172
|
-
* "string": "string"
|
|
173
|
-
* }
|
|
174
|
-
* },
|
|
175
192
|
* parameters: {
|
|
176
193
|
* "string": {
|
|
177
194
|
* "key": "value"
|
|
@@ -181,7 +198,7 @@ export declare class Conversation {
|
|
|
181
198
|
*/
|
|
182
199
|
submitActionForm(conversationId: string, request: MavenAGI.SubmitActionFormRequest, requestOptions?: Conversation.RequestOptions): Promise<MavenAGI.ConversationResponse>;
|
|
183
200
|
/**
|
|
184
|
-
* Add metadata to an existing conversation
|
|
201
|
+
* Add metadata to an existing conversation. If a metadata field already exists, it will be overwritten.
|
|
185
202
|
*
|
|
186
203
|
* @param {string} conversationId - The ID of a conversation the metadata being added belongs to
|
|
187
204
|
* @param {Record<string, string>} request
|