mavenagi 1.2.65 → 1.2.66
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/BaseClient.d.ts +4 -2
- package/BaseClient.js +8 -3
- package/README.md +2 -2
- package/api/resources/analytics/client/Client.d.ts +0 -38
- package/api/resources/analytics/client/Client.js +0 -120
- package/api/resources/analytics/types/AgentUserGroupBy.d.ts +15 -0
- package/api/resources/analytics/types/AgentUserRowIdentifier.d.ts +2 -0
- package/api/resources/analytics/types/AgentUserTableRequest.d.ts +7 -0
- package/api/resources/analytics/types/AgentUserTableResponse.d.ts +4 -1
- package/api/resources/analytics/types/index.d.ts +1 -10
- package/api/resources/analytics/types/index.js +1 -10
- package/api/resources/capabilities/client/requests/CapabilitiesSearchRequest.d.ts +0 -4
- package/api/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.d.ts +5 -0
- package/api/resources/capabilities/types/CapabilityExecutionBase.d.ts +5 -0
- package/api/resources/capabilities/types/CapabilityExecutionsSearchResponse.d.ts +3 -1
- package/api/resources/commons/types/AdditionalDataKey.d.ts +81 -3
- package/api/resources/commons/types/AdditionalDataKey.js +81 -3
- package/api/resources/commons/types/BaseConversationResponse.d.ts +6 -0
- package/api/resources/commons/types/BotMessage.d.ts +1 -1
- package/api/resources/commons/types/ConversationResponse.d.ts +1 -0
- package/api/resources/commons/types/ConversationValueSource.d.ts +4 -1
- package/api/resources/commons/types/ErrorReason.d.ts +2 -2
- package/api/resources/commons/types/ErrorReason.js +2 -2
- package/api/resources/commons/types/EventBaseNoId.d.ts +6 -0
- package/api/resources/commons/types/EventFilter.d.ts +2 -0
- package/api/resources/commons/types/EventTriggerType.d.ts +7 -0
- package/api/resources/commons/types/EventTriggerType.js +7 -0
- package/api/resources/commons/types/InitializeConversationResponse.d.ts +40 -0
- package/api/resources/commons/types/MetadataConversationValueFilter.d.ts +3 -3
- package/api/resources/commons/types/SimulationActionBehavior.d.ts +3 -2
- package/api/resources/commons/types/SimulationActionMock.d.ts +2 -1
- package/api/resources/commons/types/UserDataValueSource.d.ts +8 -0
- package/api/resources/commons/types/UserEventName.d.ts +79 -4
- package/api/resources/commons/types/UserEventName.js +79 -4
- package/api/resources/commons/types/index.d.ts +2 -0
- package/api/resources/commons/types/index.js +2 -0
- package/api/resources/conversation/client/Client.d.ts +42 -22
- package/api/resources/conversation/client/Client.js +44 -23
- package/api/resources/conversation/client/requests/ConversationGetRequest.d.ts +2 -0
- package/api/resources/conversation/types/ConversationRequest.d.ts +45 -0
- package/api/resources/conversation/types/DeliverConversationMessageRequest.d.ts +1 -1
- package/api/resources/conversation/types/index.d.ts +0 -3
- package/api/resources/conversation/types/index.js +0 -3
- package/api/resources/developersCommons/types/BaseDetailApp.d.ts +13 -4
- package/api/resources/developersCommons/types/Link.d.ts +1 -1
- package/api/resources/developersCommons/types/MarketplaceAppDetail.d.ts +2 -1
- package/api/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.d.ts +0 -2
- package/api/resources/knowledge/types/KnowledgeBaseFunctionBindings.d.ts +12 -0
- package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +1 -1
- package/api/resources/knowledge/types/index.d.ts +1 -0
- package/api/resources/knowledge/types/index.js +1 -0
- package/api/resources/organizations/client/Client.d.ts +13 -15
- package/api/resources/organizations/client/Client.js +13 -15
- package/api/resources/users/types/AgentUserField.d.ts +8 -0
- package/api/resources/users/types/AgentUserField.js +8 -0
- package/api/resources/users/types/AgentUserSearchRequest.d.ts +4 -0
- package/auth/AnyAuthProvider.d.ts +23 -0
- package/auth/AnyAuthProvider.js +46 -0
- package/auth/BearerAuthProvider.d.ts +20 -0
- package/auth/BearerAuthProvider.js +82 -0
- package/auth/index.d.ts +2 -0
- package/auth/index.js +5 -1
- package/package.json +1 -1
- package/reference.md +19 -117
- package/serialization/resources/analytics/types/AgentUserGroupBy.d.ts +15 -0
- package/serialization/resources/analytics/types/{FeedbackGroupBy.js → AgentUserGroupBy.js} +8 -4
- package/serialization/resources/analytics/types/AgentUserRowIdentifier.d.ts +2 -0
- package/serialization/resources/analytics/types/AgentUserRowIdentifier.js +2 -0
- package/serialization/resources/analytics/types/AgentUserTableRequest.d.ts +2 -0
- package/serialization/resources/analytics/types/AgentUserTableRequest.js +2 -0
- package/serialization/resources/analytics/types/index.d.ts +1 -10
- package/serialization/resources/analytics/types/index.js +1 -10
- package/serialization/resources/capabilities/client/requests/CapabilitiesSearchRequest.d.ts +0 -2
- package/serialization/resources/capabilities/client/requests/CapabilitiesSearchRequest.js +0 -2
- package/serialization/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.d.ts +2 -0
- package/serialization/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.js +2 -0
- package/serialization/resources/capabilities/types/CapabilityExecutionBase.d.ts +2 -0
- package/serialization/resources/capabilities/types/CapabilityExecutionBase.js +2 -0
- package/serialization/resources/commons/types/AdditionalDataKey.d.ts +1 -1
- package/serialization/resources/commons/types/AdditionalDataKey.js +26 -0
- package/serialization/resources/commons/types/BaseConversationResponse.d.ts +2 -0
- package/serialization/resources/commons/types/BaseConversationResponse.js +2 -0
- package/serialization/resources/commons/types/ConversationValueSource.d.ts +5 -1
- package/serialization/resources/commons/types/ConversationValueSource.js +2 -0
- package/serialization/resources/commons/types/EventBaseNoId.d.ts +2 -0
- package/serialization/resources/commons/types/EventBaseNoId.js +2 -0
- package/serialization/resources/commons/types/EventFilter.d.ts +2 -0
- package/serialization/resources/commons/types/EventFilter.js +2 -0
- package/serialization/resources/commons/types/UserDataValueSource.d.ts +9 -0
- package/serialization/resources/{analytics/types/FeedbackCount.js → commons/types/UserDataValueSource.js} +4 -2
- package/serialization/resources/commons/types/UserEventName.d.ts +1 -1
- package/serialization/resources/commons/types/UserEventName.js +25 -0
- package/serialization/resources/commons/types/index.d.ts +2 -0
- package/serialization/resources/commons/types/index.js +2 -0
- package/serialization/resources/conversation/types/ConversationFilter.d.ts +1 -1
- package/serialization/resources/conversation/types/ConversationFilter.js +1 -1
- package/serialization/resources/conversation/types/index.d.ts +0 -3
- package/serialization/resources/conversation/types/index.js +0 -3
- package/serialization/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.d.ts +0 -1
- package/serialization/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.js +0 -1
- package/serialization/resources/knowledge/types/KnowledgeBaseFunctionBindings.d.ts +12 -0
- package/serialization/resources/{analytics/types/FeedbackAnalyticsRequest.js → knowledge/types/KnowledgeBaseFunctionBindings.js} +6 -5
- package/serialization/resources/knowledge/types/index.d.ts +1 -0
- package/serialization/resources/knowledge/types/index.js +1 -0
- package/serialization/resources/users/types/AgentUserField.d.ts +1 -1
- package/serialization/resources/users/types/AgentUserField.js +1 -1
- package/serialization/resources/users/types/AgentUserFilter.d.ts +1 -1
- package/serialization/resources/users/types/AgentUserFilter.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/analytics/types/FeedbackAnalyticsRequest.d.ts +0 -11
- package/api/resources/analytics/types/FeedbackColumnDefinition.d.ts +0 -5
- package/api/resources/analytics/types/FeedbackCount.d.ts +0 -4
- package/api/resources/analytics/types/FeedbackDistinctCount.d.ts +0 -9
- package/api/resources/analytics/types/FeedbackDistinctCount.js +0 -3
- package/api/resources/analytics/types/FeedbackGroupBy.d.ts +0 -5
- package/api/resources/analytics/types/FeedbackGroupBy.js +0 -3
- package/api/resources/analytics/types/FeedbackMetric.d.ts +0 -13
- package/api/resources/analytics/types/FeedbackMetric.js +0 -3
- package/api/resources/analytics/types/FeedbackRow.d.ts +0 -11
- package/api/resources/analytics/types/FeedbackRow.js +0 -3
- package/api/resources/analytics/types/FeedbackRowIdentifier.d.ts +0 -5
- package/api/resources/analytics/types/FeedbackRowIdentifier.js +0 -3
- package/api/resources/analytics/types/FeedbackTableRequest.d.ts +0 -38
- package/api/resources/analytics/types/FeedbackTableRequest.js +0 -3
- package/api/resources/analytics/types/FeedbackTableResponse.d.ts +0 -56
- package/api/resources/analytics/types/FeedbackTableResponse.js +0 -3
- package/api/resources/conversation/types/FeedbackField.d.ts +0 -7
- package/api/resources/conversation/types/FeedbackField.js +0 -10
- package/api/resources/conversation/types/FeedbackFilter.d.ts +0 -9
- package/api/resources/conversation/types/FeedbackFilter.js +0 -3
- package/serialization/resources/analytics/types/FeedbackAnalyticsRequest.d.ts +0 -11
- package/serialization/resources/analytics/types/FeedbackColumnDefinition.d.ts +0 -11
- package/serialization/resources/analytics/types/FeedbackColumnDefinition.js +0 -45
- package/serialization/resources/analytics/types/FeedbackCount.d.ts +0 -7
- package/serialization/resources/analytics/types/FeedbackDistinctCount.d.ts +0 -10
- package/serialization/resources/analytics/types/FeedbackDistinctCount.js +0 -42
- package/serialization/resources/analytics/types/FeedbackGroupBy.d.ts +0 -11
- package/serialization/resources/analytics/types/FeedbackMetric.d.ts +0 -15
- package/serialization/resources/analytics/types/FeedbackMetric.js +0 -49
- package/serialization/resources/analytics/types/FeedbackRow.d.ts +0 -14
- package/serialization/resources/analytics/types/FeedbackRow.js +0 -48
- package/serialization/resources/analytics/types/FeedbackRowIdentifier.d.ts +0 -11
- package/serialization/resources/analytics/types/FeedbackRowIdentifier.js +0 -45
- package/serialization/resources/analytics/types/FeedbackTableRequest.d.ts +0 -15
- package/serialization/resources/analytics/types/FeedbackTableRequest.js +0 -49
- package/serialization/resources/analytics/types/FeedbackTableResponse.d.ts +0 -11
- package/serialization/resources/analytics/types/FeedbackTableResponse.js +0 -45
- package/serialization/resources/conversation/types/FeedbackField.d.ts +0 -7
- package/serialization/resources/conversation/types/FeedbackField.js +0 -39
- package/serialization/resources/conversation/types/FeedbackFilter.d.ts +0 -15
- package/serialization/resources/conversation/types/FeedbackFilter.js +0 -47
- /package/api/resources/analytics/types/{FeedbackAnalyticsRequest.js → AgentUserGroupBy.js} +0 -0
- /package/api/resources/{conversation → commons}/types/SimulationFilter.d.ts +0 -0
- /package/api/resources/{conversation → commons}/types/SimulationFilter.js +0 -0
- /package/api/resources/{analytics/types/FeedbackColumnDefinition.js → commons/types/UserDataValueSource.js} +0 -0
- /package/api/resources/{analytics/types/FeedbackCount.js → knowledge/types/KnowledgeBaseFunctionBindings.js} +0 -0
- /package/serialization/resources/{conversation → commons}/types/SimulationFilter.d.ts +0 -0
- /package/serialization/resources/{conversation → commons}/types/SimulationFilter.js +0 -0
|
@@ -2,9 +2,12 @@ import type * as MavenAGI from "../../../index";
|
|
|
2
2
|
/**
|
|
3
3
|
* Where on a conversation a value is read from.
|
|
4
4
|
*/
|
|
5
|
-
export type ConversationValueSource = MavenAGI.ConversationValueSource.ConversationMetadata;
|
|
5
|
+
export type ConversationValueSource = MavenAGI.ConversationValueSource.ConversationMetadata | MavenAGI.ConversationValueSource.UserData;
|
|
6
6
|
export declare namespace ConversationValueSource {
|
|
7
7
|
interface ConversationMetadata extends MavenAGI.ConversationMetadataValueSource {
|
|
8
8
|
type: "conversationMetadata";
|
|
9
9
|
}
|
|
10
|
+
interface UserData extends MavenAGI.UserDataValueSource {
|
|
11
|
+
type: "userData";
|
|
12
|
+
}
|
|
10
13
|
}
|
|
@@ -19,10 +19,10 @@ export declare const ErrorReason: {
|
|
|
19
19
|
* The ID requested for a new variant is already taken. */
|
|
20
20
|
readonly VariantAlreadyExists: "VARIANT_ALREADY_EXISTS";
|
|
21
21
|
/**
|
|
22
|
-
* The agent is at its limit of ACTIVE variants, so no variant can be created, forked, committed or set back to ACTIVE. Archive or delete one first. */
|
|
22
|
+
* The agent is at its limit of ACTIVE variants, so no variant can be created, forked, committed or set back to ACTIVE. Archive or delete one first. A commit that archives its source doesn't add one, so it isn't refused at the limit. */
|
|
23
23
|
readonly VariantLimitReached: "VARIANT_LIMIT_REACHED";
|
|
24
24
|
/**
|
|
25
|
-
* The variant is receiving live traffic, so it can't be archived or deleted. Move its traffic elsewhere first. */
|
|
25
|
+
* The variant is receiving live traffic, so it can't be archived or deleted, including by a commit that archives its source. Move its traffic elsewhere first. */
|
|
26
26
|
readonly CannotArchiveLiveVariant: "CANNOT_ARCHIVE_LIVE_VARIANT";
|
|
27
27
|
/**
|
|
28
28
|
* A traffic rule, a simulation or an eval run names a variant with staged edits. Publish or discard them first. */
|
|
@@ -23,10 +23,10 @@ exports.ErrorReason = {
|
|
|
23
23
|
* The ID requested for a new variant is already taken. */
|
|
24
24
|
VariantAlreadyExists: "VARIANT_ALREADY_EXISTS",
|
|
25
25
|
/**
|
|
26
|
-
* The agent is at its limit of ACTIVE variants, so no variant can be created, forked, committed or set back to ACTIVE. Archive or delete one first. */
|
|
26
|
+
* The agent is at its limit of ACTIVE variants, so no variant can be created, forked, committed or set back to ACTIVE. Archive or delete one first. A commit that archives its source doesn't add one, so it isn't refused at the limit. */
|
|
27
27
|
VariantLimitReached: "VARIANT_LIMIT_REACHED",
|
|
28
28
|
/**
|
|
29
|
-
* The variant is receiving live traffic, so it can't be archived or deleted. Move its traffic elsewhere first. */
|
|
29
|
+
* The variant is receiving live traffic, so it can't be archived or deleted, including by a commit that archives its source. Move its traffic elsewhere first. */
|
|
30
30
|
CannotArchiveLiveVariant: "CANNOT_ARCHIVE_LIVE_VARIANT",
|
|
31
31
|
/**
|
|
32
32
|
* A traffic rule, a simulation or an eval run names a variant with staged edits. Publish or discard them first. */
|
|
@@ -5,4 +5,10 @@ export interface EventBaseNoId {
|
|
|
5
5
|
sourceInfo?: MavenAGI.SourceInfo;
|
|
6
6
|
sessionInfo?: MavenAGI.SessionInfo;
|
|
7
7
|
contextInfo?: MavenAGI.ContextInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the event happened on live data or in a simulation. Defaults to `LIVE` when
|
|
10
|
+
* creating an event, and is always set on a returned event. Creating a `SIMULATION` event
|
|
11
|
+
* requires the `create:simulations` permission.
|
|
12
|
+
*/
|
|
13
|
+
executionMode?: MavenAGI.ExecutionMode;
|
|
8
14
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as MavenAGI from "../../../index";
|
|
2
2
|
export interface EventFilter {
|
|
3
3
|
search?: string;
|
|
4
|
+
/** Whether to include simulation events in search results. Defaults to only non-simulation events. */
|
|
5
|
+
simulationFilter?: MavenAGI.SimulationFilter;
|
|
4
6
|
createdAfter?: Date;
|
|
5
7
|
createdBefore?: Date;
|
|
6
8
|
references?: MavenAGI.ScopedEntity[];
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
export declare const EventTriggerType: {
|
|
2
|
+
/**
|
|
3
|
+
* Deprecated. Use `EVENT_CREATED` instead. Never fires for simulation conversations; an
|
|
4
|
+
* `EVENT_CREATED` trigger also fires for simulation events, with
|
|
5
|
+
* `executionContext.mode: SIMULATION`. */
|
|
2
6
|
readonly ConversationCreated: "CONVERSATION_CREATED";
|
|
3
7
|
/**
|
|
4
8
|
* Deprecated. Use `EVENT_CREATED` instead. */
|
|
5
9
|
readonly FeedbackCreated: "FEEDBACK_CREATED";
|
|
6
10
|
readonly InboxItemCreated: "INBOX_ITEM_CREATED";
|
|
11
|
+
/**
|
|
12
|
+
* Fires for live and simulation events alike. The app is told which in
|
|
13
|
+
* `executionContext.mode`. */
|
|
7
14
|
readonly EventCreated: "EVENT_CREATED";
|
|
8
15
|
};
|
|
9
16
|
export type EventTriggerType = (typeof EventTriggerType)[keyof typeof EventTriggerType] | string;
|
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.EventTriggerType = void 0;
|
|
5
5
|
exports.EventTriggerType = {
|
|
6
|
+
/**
|
|
7
|
+
* Deprecated. Use `EVENT_CREATED` instead. Never fires for simulation conversations; an
|
|
8
|
+
* `EVENT_CREATED` trigger also fires for simulation events, with
|
|
9
|
+
* `executionContext.mode: SIMULATION`. */
|
|
6
10
|
ConversationCreated: "CONVERSATION_CREATED",
|
|
7
11
|
/**
|
|
8
12
|
* Deprecated. Use `EVENT_CREATED` instead. */
|
|
9
13
|
FeedbackCreated: "FEEDBACK_CREATED",
|
|
10
14
|
InboxItemCreated: "INBOX_ITEM_CREATED",
|
|
15
|
+
/**
|
|
16
|
+
* Fires for live and simulation events alike. The app is told which in
|
|
17
|
+
* `executionContext.mode`. */
|
|
11
18
|
EventCreated: "EVENT_CREATED",
|
|
12
19
|
};
|
|
@@ -3,6 +3,46 @@ import type * as MavenAGI from "../../../index";
|
|
|
3
3
|
* A conversation as returned by the `initialize` endpoint. Extends the shared
|
|
4
4
|
* ConversationResponse with the Conversation Kickoff result, which is only available at
|
|
5
5
|
* initialization time.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* {
|
|
9
|
+
* conversationId: {
|
|
10
|
+
* referenceId: "conversation-0",
|
|
11
|
+
* appId: "myapp",
|
|
12
|
+
* organizationId: "acme",
|
|
13
|
+
* agentId: "support",
|
|
14
|
+
* type: MavenAGI.EntityType.Conversation
|
|
15
|
+
* },
|
|
16
|
+
* deleted: false,
|
|
17
|
+
* open: true,
|
|
18
|
+
* llmEnabled: true,
|
|
19
|
+
* conversationMode: MavenAGI.ConversationMode.Text,
|
|
20
|
+
* analysis: {},
|
|
21
|
+
* summary: {
|
|
22
|
+
* actionIds: [],
|
|
23
|
+
* incompleteActionIds: [],
|
|
24
|
+
* matchedCharterIds: [],
|
|
25
|
+
* matchedCharterNames: [],
|
|
26
|
+
* matchedSegmentedCharterNames: [],
|
|
27
|
+
* insertCount: 0,
|
|
28
|
+
* thumbsUpCount: 0,
|
|
29
|
+
* thumbsDownCount: 0,
|
|
30
|
+
* handoffCount: 0,
|
|
31
|
+
* userMessageCount: 0,
|
|
32
|
+
* botMessageCount: 0,
|
|
33
|
+
* humanAgents: [],
|
|
34
|
+
* humanAgentsWithInserts: [],
|
|
35
|
+
* users: [],
|
|
36
|
+
* userIdentifiers: [],
|
|
37
|
+
* involvedAppIds: new Set(["myapp"])
|
|
38
|
+
* },
|
|
39
|
+
* metadata: {},
|
|
40
|
+
* allMetadata: {},
|
|
41
|
+
* attachments: [],
|
|
42
|
+
* messages: [],
|
|
43
|
+
* executionMode: MavenAGI.ExecutionMode.Live,
|
|
44
|
+
* conversationKickoffResults: []
|
|
45
|
+
* }
|
|
6
46
|
*/
|
|
7
47
|
export interface InitializeConversationResponse extends MavenAGI.ConversationResponse {
|
|
8
48
|
/**
|
|
@@ -3,9 +3,9 @@ import type * as MavenAGI from "../../../index";
|
|
|
3
3
|
* Matches documents whose value under `key` equals a value read from the conversation
|
|
4
4
|
* being answered, so one filter follows each conversation instead of naming a fixed value.
|
|
5
5
|
*
|
|
6
|
-
* When the conversation has no value at `source`, nothing matches.
|
|
7
|
-
*
|
|
8
|
-
* `state = All`.
|
|
6
|
+
* When the conversation has no value at `source`, nothing matches. For `userData`, that
|
|
7
|
+
* includes a conversation with no user. To also keep documents that apply everywhere,
|
|
8
|
+
* combine this with an entry in an `OR` group, for example `state = All`.
|
|
9
9
|
*/
|
|
10
10
|
export interface MetadataConversationValueFilter {
|
|
11
11
|
/** The document metadata key to test, as in `MetadataEntryCondition`. */
|
|
@@ -2,8 +2,9 @@ import type * as MavenAGI from "../../../index";
|
|
|
2
2
|
export type SimulationActionBehavior =
|
|
3
3
|
/**
|
|
4
4
|
* The platform does not call the action's app and uses this result as the action's
|
|
5
|
-
* result. `response` and `errorMessage` are Handlebars templates
|
|
6
|
-
* parameters, such as `{{parameterId}}`, rendered without HTML
|
|
5
|
+
* result. `response` is required. `response` and `errorMessage` are Handlebars templates
|
|
6
|
+
* over the action's input parameters, such as `{{parameterId}}`, rendered without HTML
|
|
7
|
+
* escaping. Set `status` to `ERROR` to mock a failed action. */
|
|
7
8
|
MavenAGI.SimulationActionBehavior.FixedResponse
|
|
8
9
|
/**
|
|
9
10
|
* The platform calls the action's app instead of returning a mocked result. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as MavenAGI from "../../../index";
|
|
2
2
|
export interface SimulationActionMock {
|
|
3
|
-
/** The action this entry applies to. */
|
|
3
|
+
/** The action this entry applies to. Its `type` must be `ACTION`. */
|
|
4
4
|
actionId: MavenAGI.EntityIdWithoutAgent;
|
|
5
|
+
/** What the platform does when the agent executes this action. */
|
|
5
6
|
behavior: MavenAGI.SimulationActionBehavior;
|
|
6
7
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value from the data of the user the conversation is with. User data set by different apps
|
|
3
|
+
* is read together, the same way a segment's `user` condition reads it.
|
|
4
|
+
*/
|
|
5
|
+
export interface UserDataValueSource {
|
|
6
|
+
/** The user data key to read. */
|
|
7
|
+
key: string;
|
|
8
|
+
}
|
|
@@ -39,7 +39,7 @@ export declare const UserEventName: {
|
|
|
39
39
|
* Content was translated into another language */
|
|
40
40
|
readonly ContentTranslated: "CONTENT_TRANSLATED";
|
|
41
41
|
/**
|
|
42
|
-
* A search query was submitted */
|
|
42
|
+
* A search query was submitted. `contextInfo.additionalData` carries `query` (see `AdditionalDataKey`). */
|
|
43
43
|
readonly SearchSubmitted: "SEARCH_SUBMITTED";
|
|
44
44
|
/**
|
|
45
45
|
* A search result was opened */
|
|
@@ -75,10 +75,10 @@ export declare const UserEventName: {
|
|
|
75
75
|
* The user left a multi-step flow partway through. Pair with an `EVENT_CREATED` trigger to follow up on an onboarding or checkout that was never finished. Name the flow and the step it stopped on in `contextInfo.additionalData`. */
|
|
76
76
|
readonly FlowAbandoned: "FLOW_ABANDONED";
|
|
77
77
|
/**
|
|
78
|
-
* The user created an account */
|
|
78
|
+
* The user created an account. `contextInfo.additionalData` carries `method` (see `AdditionalDataKey`). */
|
|
79
79
|
readonly AccountCreated: "ACCOUNT_CREATED";
|
|
80
80
|
/**
|
|
81
|
-
* The user signed in */
|
|
81
|
+
* The user signed in. `contextInfo.additionalData` carries `method` (see `AdditionalDataKey`). */
|
|
82
82
|
readonly SignedIn: "SIGNED_IN";
|
|
83
83
|
/**
|
|
84
84
|
* The user signed out */
|
|
@@ -90,7 +90,7 @@ export declare const UserEventName: {
|
|
|
90
90
|
* The user cancelled a subscription or plan */
|
|
91
91
|
readonly SubscriptionCancelled: "SUBSCRIPTION_CANCELLED";
|
|
92
92
|
/**
|
|
93
|
-
* The user placed an order */
|
|
93
|
+
* The user placed an order. `contextInfo.additionalData` carries `transactionId`, `amount`, `currency`, `coupon`, `shipping`, `tax`, `customerType` and `items` (see `AdditionalDataKey`). */
|
|
94
94
|
readonly OrderPlaced: "ORDER_PLACED";
|
|
95
95
|
/**
|
|
96
96
|
* The user cancelled an order */
|
|
@@ -101,5 +101,80 @@ export declare const UserEventName: {
|
|
|
101
101
|
/**
|
|
102
102
|
* The user was shown an error */
|
|
103
103
|
readonly ErrorDisplayed: "ERROR_DISPLAYED";
|
|
104
|
+
/**
|
|
105
|
+
* The user was shown an ad. `contextInfo.additionalData` carries `adPlatform`, `adSource`, `adFormat`, `adUnitName`, `amount` and `currency` (see `AdditionalDataKey`). */
|
|
106
|
+
readonly AdImpression: "AD_IMPRESSION";
|
|
107
|
+
/**
|
|
108
|
+
* The user earned points, credits or another in-app currency. `contextInfo.additionalData` carries `virtualCurrencyName` and `virtualCurrencyAmount` (see `AdditionalDataKey`). */
|
|
109
|
+
readonly EarnVirtualCurrency: "EARN_VIRTUAL_CURRENCY";
|
|
110
|
+
/**
|
|
111
|
+
* The user joined a group, team or community. `contextInfo.additionalData` carries `groupId` (see `AdditionalDataKey`). */
|
|
112
|
+
readonly JoinGroup: "JOIN_GROUP";
|
|
113
|
+
/**
|
|
114
|
+
* The user selected a piece of content, such as a video or a card. `contextInfo.additionalData` carries `contentType` and `contentId` (see `AdditionalDataKey`). */
|
|
115
|
+
readonly SelectContent: "SELECT_CONTENT";
|
|
116
|
+
/**
|
|
117
|
+
* The user shared content. `contextInfo.additionalData` carries `method`, `contentType` and `contentId` (see `AdditionalDataKey`). */
|
|
118
|
+
readonly Share: "SHARE";
|
|
119
|
+
/**
|
|
120
|
+
* The user spent points, credits or another in-app currency. `contextInfo.additionalData` carries `virtualCurrencyName`, `virtualCurrencyAmount` and `name` (see `AdditionalDataKey`). */
|
|
121
|
+
readonly SpendVirtualCurrency: "SPEND_VIRTUAL_CURRENCY";
|
|
122
|
+
/**
|
|
123
|
+
* The user was shown a list of products, such as category or search results. `contextInfo.additionalData` carries `itemListId`, `itemListName` and `items` (see `AdditionalDataKey`). */
|
|
124
|
+
readonly ViewItemList: "VIEW_ITEM_LIST";
|
|
125
|
+
/**
|
|
126
|
+
* The user selected a product from a list. `contextInfo.additionalData` carries `itemListId`, `itemListName` and `items` (see `AdditionalDataKey`). */
|
|
127
|
+
readonly SelectItem: "SELECT_ITEM";
|
|
128
|
+
/**
|
|
129
|
+
* The user viewed a product. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
130
|
+
readonly ViewItem: "VIEW_ITEM";
|
|
131
|
+
/**
|
|
132
|
+
* The user was shown a promotion. `contextInfo.additionalData` carries `promotionId`, `promotionName`, `creativeName`, `creativeSlot` and `items` (see `AdditionalDataKey`). */
|
|
133
|
+
readonly ViewPromotion: "VIEW_PROMOTION";
|
|
134
|
+
/**
|
|
135
|
+
* The user selected a promotion. `contextInfo.additionalData` carries `promotionId`, `promotionName`, `creativeName`, `creativeSlot` and `items` (see `AdditionalDataKey`). */
|
|
136
|
+
readonly SelectPromotion: "SELECT_PROMOTION";
|
|
137
|
+
/**
|
|
138
|
+
* The user added a product to a wishlist. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
139
|
+
readonly AddToWishlist: "ADD_TO_WISHLIST";
|
|
140
|
+
/**
|
|
141
|
+
* The user added a product to their cart. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
142
|
+
readonly AddToCart: "ADD_TO_CART";
|
|
143
|
+
/**
|
|
144
|
+
* The user removed a product from their cart. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
145
|
+
readonly RemoveFromCart: "REMOVE_FROM_CART";
|
|
146
|
+
/**
|
|
147
|
+
* The user viewed their cart. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
148
|
+
readonly ViewCart: "VIEW_CART";
|
|
149
|
+
/**
|
|
150
|
+
* The user started checkout. `contextInfo.additionalData` carries `amount`, `currency`, `coupon` and `items` (see `AdditionalDataKey`). */
|
|
151
|
+
readonly BeginCheckout: "BEGIN_CHECKOUT";
|
|
152
|
+
/**
|
|
153
|
+
* The user submitted shipping information during checkout. `contextInfo.additionalData` carries `amount`, `currency`, `coupon`, `shippingTier` and `items` (see `AdditionalDataKey`). */
|
|
154
|
+
readonly AddShippingInfo: "ADD_SHIPPING_INFO";
|
|
155
|
+
/**
|
|
156
|
+
* The user submitted payment information during checkout. `contextInfo.additionalData` carries `amount`, `currency`, `coupon`, `paymentType` and `items` (see `AdditionalDataKey`). */
|
|
157
|
+
readonly AddPaymentInfo: "ADD_PAYMENT_INFO";
|
|
158
|
+
/**
|
|
159
|
+
* An order, or part of one, was refunded. `contextInfo.additionalData` carries `transactionId`, `amount`, `currency`, `coupon`, `shipping`, `tax` and `items` (see `AdditionalDataKey`). */
|
|
160
|
+
readonly Refund: "REFUND";
|
|
161
|
+
/**
|
|
162
|
+
* The user became a lead, for example by submitting a contact form. `contextInfo.additionalData` carries `amount`, `currency` and `leadSource` (see `AdditionalDataKey`). */
|
|
163
|
+
readonly GenerateLead: "GENERATE_LEAD";
|
|
164
|
+
/**
|
|
165
|
+
* A lead was marked qualified. `contextInfo.additionalData` carries `amount` and `currency` (see `AdditionalDataKey`). */
|
|
166
|
+
readonly QualifyLead: "QUALIFY_LEAD";
|
|
167
|
+
/**
|
|
168
|
+
* A lead was marked disqualified. `contextInfo.additionalData` carries `amount`, `currency` and `reason` (see `AdditionalDataKey`). */
|
|
169
|
+
readonly DisqualifyLead: "DISQUALIFY_LEAD";
|
|
170
|
+
/**
|
|
171
|
+
* A lead was contacted and is being worked. `contextInfo.additionalData` carries `amount`, `currency` and `leadStatus` (see `AdditionalDataKey`). */
|
|
172
|
+
readonly WorkingLead: "WORKING_LEAD";
|
|
173
|
+
/**
|
|
174
|
+
* A lead converted into a customer. `contextInfo.additionalData` carries `amount` and `currency` (see `AdditionalDataKey`). */
|
|
175
|
+
readonly CloseConvertLead: "CLOSE_CONVERT_LEAD";
|
|
176
|
+
/**
|
|
177
|
+
* A lead was closed without converting. `contextInfo.additionalData` carries `amount`, `currency` and `reason` (see `AdditionalDataKey`). */
|
|
178
|
+
readonly CloseUnconvertLead: "CLOSE_UNCONVERT_LEAD";
|
|
104
179
|
};
|
|
105
180
|
export type UserEventName = (typeof UserEventName)[keyof typeof UserEventName] | string;
|
|
@@ -43,7 +43,7 @@ exports.UserEventName = {
|
|
|
43
43
|
* Content was translated into another language */
|
|
44
44
|
ContentTranslated: "CONTENT_TRANSLATED",
|
|
45
45
|
/**
|
|
46
|
-
* A search query was submitted */
|
|
46
|
+
* A search query was submitted. `contextInfo.additionalData` carries `query` (see `AdditionalDataKey`). */
|
|
47
47
|
SearchSubmitted: "SEARCH_SUBMITTED",
|
|
48
48
|
/**
|
|
49
49
|
* A search result was opened */
|
|
@@ -79,10 +79,10 @@ exports.UserEventName = {
|
|
|
79
79
|
* The user left a multi-step flow partway through. Pair with an `EVENT_CREATED` trigger to follow up on an onboarding or checkout that was never finished. Name the flow and the step it stopped on in `contextInfo.additionalData`. */
|
|
80
80
|
FlowAbandoned: "FLOW_ABANDONED",
|
|
81
81
|
/**
|
|
82
|
-
* The user created an account */
|
|
82
|
+
* The user created an account. `contextInfo.additionalData` carries `method` (see `AdditionalDataKey`). */
|
|
83
83
|
AccountCreated: "ACCOUNT_CREATED",
|
|
84
84
|
/**
|
|
85
|
-
* The user signed in */
|
|
85
|
+
* The user signed in. `contextInfo.additionalData` carries `method` (see `AdditionalDataKey`). */
|
|
86
86
|
SignedIn: "SIGNED_IN",
|
|
87
87
|
/**
|
|
88
88
|
* The user signed out */
|
|
@@ -94,7 +94,7 @@ exports.UserEventName = {
|
|
|
94
94
|
* The user cancelled a subscription or plan */
|
|
95
95
|
SubscriptionCancelled: "SUBSCRIPTION_CANCELLED",
|
|
96
96
|
/**
|
|
97
|
-
* The user placed an order */
|
|
97
|
+
* The user placed an order. `contextInfo.additionalData` carries `transactionId`, `amount`, `currency`, `coupon`, `shipping`, `tax`, `customerType` and `items` (see `AdditionalDataKey`). */
|
|
98
98
|
OrderPlaced: "ORDER_PLACED",
|
|
99
99
|
/**
|
|
100
100
|
* The user cancelled an order */
|
|
@@ -105,4 +105,79 @@ exports.UserEventName = {
|
|
|
105
105
|
/**
|
|
106
106
|
* The user was shown an error */
|
|
107
107
|
ErrorDisplayed: "ERROR_DISPLAYED",
|
|
108
|
+
/**
|
|
109
|
+
* The user was shown an ad. `contextInfo.additionalData` carries `adPlatform`, `adSource`, `adFormat`, `adUnitName`, `amount` and `currency` (see `AdditionalDataKey`). */
|
|
110
|
+
AdImpression: "AD_IMPRESSION",
|
|
111
|
+
/**
|
|
112
|
+
* The user earned points, credits or another in-app currency. `contextInfo.additionalData` carries `virtualCurrencyName` and `virtualCurrencyAmount` (see `AdditionalDataKey`). */
|
|
113
|
+
EarnVirtualCurrency: "EARN_VIRTUAL_CURRENCY",
|
|
114
|
+
/**
|
|
115
|
+
* The user joined a group, team or community. `contextInfo.additionalData` carries `groupId` (see `AdditionalDataKey`). */
|
|
116
|
+
JoinGroup: "JOIN_GROUP",
|
|
117
|
+
/**
|
|
118
|
+
* The user selected a piece of content, such as a video or a card. `contextInfo.additionalData` carries `contentType` and `contentId` (see `AdditionalDataKey`). */
|
|
119
|
+
SelectContent: "SELECT_CONTENT",
|
|
120
|
+
/**
|
|
121
|
+
* The user shared content. `contextInfo.additionalData` carries `method`, `contentType` and `contentId` (see `AdditionalDataKey`). */
|
|
122
|
+
Share: "SHARE",
|
|
123
|
+
/**
|
|
124
|
+
* The user spent points, credits or another in-app currency. `contextInfo.additionalData` carries `virtualCurrencyName`, `virtualCurrencyAmount` and `name` (see `AdditionalDataKey`). */
|
|
125
|
+
SpendVirtualCurrency: "SPEND_VIRTUAL_CURRENCY",
|
|
126
|
+
/**
|
|
127
|
+
* The user was shown a list of products, such as category or search results. `contextInfo.additionalData` carries `itemListId`, `itemListName` and `items` (see `AdditionalDataKey`). */
|
|
128
|
+
ViewItemList: "VIEW_ITEM_LIST",
|
|
129
|
+
/**
|
|
130
|
+
* The user selected a product from a list. `contextInfo.additionalData` carries `itemListId`, `itemListName` and `items` (see `AdditionalDataKey`). */
|
|
131
|
+
SelectItem: "SELECT_ITEM",
|
|
132
|
+
/**
|
|
133
|
+
* The user viewed a product. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
134
|
+
ViewItem: "VIEW_ITEM",
|
|
135
|
+
/**
|
|
136
|
+
* The user was shown a promotion. `contextInfo.additionalData` carries `promotionId`, `promotionName`, `creativeName`, `creativeSlot` and `items` (see `AdditionalDataKey`). */
|
|
137
|
+
ViewPromotion: "VIEW_PROMOTION",
|
|
138
|
+
/**
|
|
139
|
+
* The user selected a promotion. `contextInfo.additionalData` carries `promotionId`, `promotionName`, `creativeName`, `creativeSlot` and `items` (see `AdditionalDataKey`). */
|
|
140
|
+
SelectPromotion: "SELECT_PROMOTION",
|
|
141
|
+
/**
|
|
142
|
+
* The user added a product to a wishlist. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
143
|
+
AddToWishlist: "ADD_TO_WISHLIST",
|
|
144
|
+
/**
|
|
145
|
+
* The user added a product to their cart. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
146
|
+
AddToCart: "ADD_TO_CART",
|
|
147
|
+
/**
|
|
148
|
+
* The user removed a product from their cart. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
149
|
+
RemoveFromCart: "REMOVE_FROM_CART",
|
|
150
|
+
/**
|
|
151
|
+
* The user viewed their cart. `contextInfo.additionalData` carries `amount`, `currency` and `items` (see `AdditionalDataKey`). */
|
|
152
|
+
ViewCart: "VIEW_CART",
|
|
153
|
+
/**
|
|
154
|
+
* The user started checkout. `contextInfo.additionalData` carries `amount`, `currency`, `coupon` and `items` (see `AdditionalDataKey`). */
|
|
155
|
+
BeginCheckout: "BEGIN_CHECKOUT",
|
|
156
|
+
/**
|
|
157
|
+
* The user submitted shipping information during checkout. `contextInfo.additionalData` carries `amount`, `currency`, `coupon`, `shippingTier` and `items` (see `AdditionalDataKey`). */
|
|
158
|
+
AddShippingInfo: "ADD_SHIPPING_INFO",
|
|
159
|
+
/**
|
|
160
|
+
* The user submitted payment information during checkout. `contextInfo.additionalData` carries `amount`, `currency`, `coupon`, `paymentType` and `items` (see `AdditionalDataKey`). */
|
|
161
|
+
AddPaymentInfo: "ADD_PAYMENT_INFO",
|
|
162
|
+
/**
|
|
163
|
+
* An order, or part of one, was refunded. `contextInfo.additionalData` carries `transactionId`, `amount`, `currency`, `coupon`, `shipping`, `tax` and `items` (see `AdditionalDataKey`). */
|
|
164
|
+
Refund: "REFUND",
|
|
165
|
+
/**
|
|
166
|
+
* The user became a lead, for example by submitting a contact form. `contextInfo.additionalData` carries `amount`, `currency` and `leadSource` (see `AdditionalDataKey`). */
|
|
167
|
+
GenerateLead: "GENERATE_LEAD",
|
|
168
|
+
/**
|
|
169
|
+
* A lead was marked qualified. `contextInfo.additionalData` carries `amount` and `currency` (see `AdditionalDataKey`). */
|
|
170
|
+
QualifyLead: "QUALIFY_LEAD",
|
|
171
|
+
/**
|
|
172
|
+
* A lead was marked disqualified. `contextInfo.additionalData` carries `amount`, `currency` and `reason` (see `AdditionalDataKey`). */
|
|
173
|
+
DisqualifyLead: "DISQUALIFY_LEAD",
|
|
174
|
+
/**
|
|
175
|
+
* A lead was contacted and is being worked. `contextInfo.additionalData` carries `amount`, `currency` and `leadStatus` (see `AdditionalDataKey`). */
|
|
176
|
+
WorkingLead: "WORKING_LEAD",
|
|
177
|
+
/**
|
|
178
|
+
* A lead converted into a customer. `contextInfo.additionalData` carries `amount` and `currency` (see `AdditionalDataKey`). */
|
|
179
|
+
CloseConvertLead: "CLOSE_CONVERT_LEAD",
|
|
180
|
+
/**
|
|
181
|
+
* A lead was closed without converting. `contextInfo.additionalData` carries `amount`, `currency` and `reason` (see `AdditionalDataKey`). */
|
|
182
|
+
CloseUnconvertLead: "CLOSE_UNCONVERT_LEAD",
|
|
108
183
|
};
|
|
@@ -218,6 +218,7 @@ export * from "./SimulationActionBehavior";
|
|
|
218
218
|
export * from "./SimulationActionCallApp";
|
|
219
219
|
export * from "./SimulationActionMock";
|
|
220
220
|
export * from "./SimulationContext";
|
|
221
|
+
export * from "./SimulationFilter";
|
|
221
222
|
export * from "./Source";
|
|
222
223
|
export * from "./SourceInfo";
|
|
223
224
|
export * from "./SourceType";
|
|
@@ -239,6 +240,7 @@ export * from "./TextSettingsSchemaEntry";
|
|
|
239
240
|
export * from "./UniversalCondition";
|
|
240
241
|
export * from "./UserConversationMessageType";
|
|
241
242
|
export * from "./UserData";
|
|
243
|
+
export * from "./UserDataValueSource";
|
|
242
244
|
export * from "./UserDataWithReference";
|
|
243
245
|
export * from "./UserEvent";
|
|
244
246
|
export * from "./UserEventName";
|
|
@@ -234,6 +234,7 @@ __exportStar(require("./SimulationActionBehavior"), exports);
|
|
|
234
234
|
__exportStar(require("./SimulationActionCallApp"), exports);
|
|
235
235
|
__exportStar(require("./SimulationActionMock"), exports);
|
|
236
236
|
__exportStar(require("./SimulationContext"), exports);
|
|
237
|
+
__exportStar(require("./SimulationFilter"), exports);
|
|
237
238
|
__exportStar(require("./Source"), exports);
|
|
238
239
|
__exportStar(require("./SourceInfo"), exports);
|
|
239
240
|
__exportStar(require("./SourceType"), exports);
|
|
@@ -255,6 +256,7 @@ __exportStar(require("./TextSettingsSchemaEntry"), exports);
|
|
|
255
256
|
__exportStar(require("./UniversalCondition"), exports);
|
|
256
257
|
__exportStar(require("./UserConversationMessageType"), exports);
|
|
257
258
|
__exportStar(require("./UserData"), exports);
|
|
259
|
+
__exportStar(require("./UserDataValueSource"), exports);
|
|
258
260
|
__exportStar(require("./UserDataWithReference"), exports);
|
|
259
261
|
__exportStar(require("./UserEvent"), exports);
|
|
260
262
|
__exportStar(require("./UserEventName"), exports);
|
|
@@ -34,27 +34,45 @@ export declare class ConversationClient {
|
|
|
34
34
|
* @example
|
|
35
35
|
* await client.conversation.initialize({
|
|
36
36
|
* conversationId: {
|
|
37
|
-
* referenceId: "
|
|
37
|
+
* referenceId: "conversation-0"
|
|
38
|
+
* },
|
|
39
|
+
* messages: []
|
|
40
|
+
* })
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.conversation.initialize({
|
|
44
|
+
* conversationId: {
|
|
45
|
+
* referenceId: "simulation-0"
|
|
46
|
+
* },
|
|
47
|
+
* simulationContext: {
|
|
48
|
+
* actionMocks: [{
|
|
49
|
+
* actionId: {
|
|
50
|
+
* type: "ACTION",
|
|
51
|
+
* appId: "my-app",
|
|
52
|
+
* referenceId: "refund-order"
|
|
53
|
+
* },
|
|
54
|
+
* behavior: {
|
|
55
|
+
* type: "fixedResponse",
|
|
56
|
+
* response: "Refunded order {{orderId}}"
|
|
57
|
+
* }
|
|
58
|
+
* }, {
|
|
59
|
+
* actionId: {
|
|
60
|
+
* type: "ACTION",
|
|
61
|
+
* appId: "my-app",
|
|
62
|
+
* referenceId: "get-order-status"
|
|
63
|
+
* },
|
|
64
|
+
* behavior: {
|
|
65
|
+
* type: "fixedResponse",
|
|
66
|
+
* status: "ERROR",
|
|
67
|
+
* response: "Order {{orderId}} was not found",
|
|
68
|
+
* errorMessage: "No order with ID {{orderId}}"
|
|
69
|
+
* }
|
|
70
|
+
* }],
|
|
71
|
+
* defaultActionBehavior: {
|
|
72
|
+
* type: "callApp"
|
|
73
|
+
* }
|
|
38
74
|
* },
|
|
39
|
-
* messages: [
|
|
40
|
-
* conversationMessageId: {
|
|
41
|
-
* referenceId: "x"
|
|
42
|
-
* },
|
|
43
|
-
* userId: {
|
|
44
|
-
* referenceId: "x"
|
|
45
|
-
* },
|
|
46
|
-
* text: "text",
|
|
47
|
-
* userMessageType: "USER"
|
|
48
|
-
* }, {
|
|
49
|
-
* conversationMessageId: {
|
|
50
|
-
* referenceId: "x"
|
|
51
|
-
* },
|
|
52
|
-
* userId: {
|
|
53
|
-
* referenceId: "x"
|
|
54
|
-
* },
|
|
55
|
-
* text: "text",
|
|
56
|
-
* userMessageType: "USER"
|
|
57
|
-
* }]
|
|
75
|
+
* messages: []
|
|
58
76
|
* })
|
|
59
77
|
*/
|
|
60
78
|
initialize(request: MavenAGI.ConversationRequest, requestOptions?: ConversationClient.RequestOptions): core.HttpResponsePromise<MavenAGI.InitializeConversationResponse>;
|
|
@@ -502,9 +520,11 @@ export declare class ConversationClient {
|
|
|
502
520
|
*
|
|
503
521
|
* Deliver a message to a user or conversation.
|
|
504
522
|
*
|
|
523
|
+
* A closed conversation (`open` set to false) takes no new messages and returns a 400.
|
|
524
|
+
*
|
|
505
525
|
* <Warning>
|
|
506
|
-
* Currently, messages can only be successfully delivered to conversations with the `ASYNC` capability
|
|
507
|
-
* User message delivery is not yet supported.
|
|
526
|
+
* Currently, messages can only be successfully delivered to conversations with the `ASYNC` capability.
|
|
527
|
+
* User message delivery is not yet supported and returns a 400.
|
|
508
528
|
* </Warning>
|
|
509
529
|
*
|
|
510
530
|
* @param {MavenAGI.DeliverMessageRequest} request
|
|
@@ -82,27 +82,45 @@ class ConversationClient {
|
|
|
82
82
|
* @example
|
|
83
83
|
* await client.conversation.initialize({
|
|
84
84
|
* conversationId: {
|
|
85
|
-
* referenceId: "
|
|
85
|
+
* referenceId: "conversation-0"
|
|
86
|
+
* },
|
|
87
|
+
* messages: []
|
|
88
|
+
* })
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* await client.conversation.initialize({
|
|
92
|
+
* conversationId: {
|
|
93
|
+
* referenceId: "simulation-0"
|
|
94
|
+
* },
|
|
95
|
+
* simulationContext: {
|
|
96
|
+
* actionMocks: [{
|
|
97
|
+
* actionId: {
|
|
98
|
+
* type: "ACTION",
|
|
99
|
+
* appId: "my-app",
|
|
100
|
+
* referenceId: "refund-order"
|
|
101
|
+
* },
|
|
102
|
+
* behavior: {
|
|
103
|
+
* type: "fixedResponse",
|
|
104
|
+
* response: "Refunded order {{orderId}}"
|
|
105
|
+
* }
|
|
106
|
+
* }, {
|
|
107
|
+
* actionId: {
|
|
108
|
+
* type: "ACTION",
|
|
109
|
+
* appId: "my-app",
|
|
110
|
+
* referenceId: "get-order-status"
|
|
111
|
+
* },
|
|
112
|
+
* behavior: {
|
|
113
|
+
* type: "fixedResponse",
|
|
114
|
+
* status: "ERROR",
|
|
115
|
+
* response: "Order {{orderId}} was not found",
|
|
116
|
+
* errorMessage: "No order with ID {{orderId}}"
|
|
117
|
+
* }
|
|
118
|
+
* }],
|
|
119
|
+
* defaultActionBehavior: {
|
|
120
|
+
* type: "callApp"
|
|
121
|
+
* }
|
|
86
122
|
* },
|
|
87
|
-
* messages: [
|
|
88
|
-
* conversationMessageId: {
|
|
89
|
-
* referenceId: "x"
|
|
90
|
-
* },
|
|
91
|
-
* userId: {
|
|
92
|
-
* referenceId: "x"
|
|
93
|
-
* },
|
|
94
|
-
* text: "text",
|
|
95
|
-
* userMessageType: "USER"
|
|
96
|
-
* }, {
|
|
97
|
-
* conversationMessageId: {
|
|
98
|
-
* referenceId: "x"
|
|
99
|
-
* },
|
|
100
|
-
* userId: {
|
|
101
|
-
* referenceId: "x"
|
|
102
|
-
* },
|
|
103
|
-
* text: "text",
|
|
104
|
-
* userMessageType: "USER"
|
|
105
|
-
* }]
|
|
123
|
+
* messages: []
|
|
106
124
|
* })
|
|
107
125
|
*/
|
|
108
126
|
initialize(request, requestOptions) {
|
|
@@ -323,10 +341,11 @@ class ConversationClient {
|
|
|
323
341
|
__get(conversationId_1) {
|
|
324
342
|
return __awaiter(this, arguments, void 0, function* (conversationId, request = {}, requestOptions) {
|
|
325
343
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
326
|
-
const { appId, translationLanguage } = request;
|
|
344
|
+
const { appId, translationLanguage, includeLogic } = request;
|
|
327
345
|
const _queryParams = {
|
|
328
346
|
appId,
|
|
329
347
|
translationLanguage,
|
|
348
|
+
includeLogic,
|
|
330
349
|
};
|
|
331
350
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
332
351
|
const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({
|
|
@@ -1865,9 +1884,11 @@ class ConversationClient {
|
|
|
1865
1884
|
*
|
|
1866
1885
|
* Deliver a message to a user or conversation.
|
|
1867
1886
|
*
|
|
1887
|
+
* A closed conversation (`open` set to false) takes no new messages and returns a 400.
|
|
1888
|
+
*
|
|
1868
1889
|
* <Warning>
|
|
1869
|
-
* Currently, messages can only be successfully delivered to conversations with the `ASYNC` capability
|
|
1870
|
-
* User message delivery is not yet supported.
|
|
1890
|
+
* Currently, messages can only be successfully delivered to conversations with the `ASYNC` capability.
|
|
1891
|
+
* User message delivery is not yet supported and returns a 400.
|
|
1871
1892
|
* </Warning>
|
|
1872
1893
|
*
|
|
1873
1894
|
* @param {MavenAGI.DeliverMessageRequest} request
|
|
@@ -7,4 +7,6 @@ export interface ConversationGetRequest {
|
|
|
7
7
|
appId?: string;
|
|
8
8
|
/** The language to translate the conversation analysis into */
|
|
9
9
|
translationLanguage?: string;
|
|
10
|
+
/** Whether to return `logic` on each bot message. Defaults to `true`. Pass `false` to leave it out, which makes the response much smaller. */
|
|
11
|
+
includeLogic?: boolean;
|
|
10
12
|
}
|