@cimulate/copilot-sdk 3.6.0 → 3.7.0
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/dist/{bundle.cimulate.copilot-sdk.528903a1.umd.js → bundle.cimulate.copilot-sdk.19bd46a0.umd.js} +2 -2
- package/dist/{bundle.cimulate.copilot-sdk.a9e69ca5.cjs.js.map → bundle.cimulate.copilot-sdk.19bd46a0.umd.js.map} +1 -1
- package/dist/{bundle.cimulate.copilot-sdk.a9e69ca5.cjs.js → bundle.cimulate.copilot-sdk.2fdeb472.cjs.js} +2 -2
- package/dist/{bundle.cimulate.copilot-sdk.528903a1.umd.js.map → bundle.cimulate.copilot-sdk.2fdeb472.cjs.js.map} +1 -1
- package/dist/{bundle.cimulate.copilot-sdk.1fbe1d17.esm.js → bundle.cimulate.copilot-sdk.77727d1e.esm.js} +2 -2
- package/dist/{bundle.cimulate.copilot-sdk.1fbe1d17.esm.js.map → bundle.cimulate.copilot-sdk.77727d1e.esm.js.map} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/copilot.d.ts +5 -3
- package/dist/types/model/CopilotApiAck.d.ts +3 -2
- package/dist/types/model/FollowUp.d.ts +2 -1
- package/dist/types/model/ProductView.d.ts +6 -0
- package/dist/types/model/ProductViewAck.d.ts +10 -0
- package/dist/types/model/ProductViewSuggestion.d.ts +7 -0
- package/dist/types/model/index.d.ts +3 -0
- package/examples/conversationReset.ts +2 -2
- package/package.json +1 -1
- package/src/copilot.ts +23 -3
- package/src/model/CopilotApiAck.ts +3 -1
- package/src/model/FollowUp.ts +2 -1
- package/src/model/ProductView.ts +7 -0
- package/src/model/ProductViewAck.ts +10 -0
- package/src/model/ProductViewSuggestion.ts +7 -0
- package/src/model/index.ts +3 -0
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
For any new event, manually create an entry here.
|
|
4
4
|
*/
|
|
5
5
|
import { CancelAck } from "./CancelAck";
|
|
6
|
+
import { ConversationResetAck } from "./ConversationResetAck";
|
|
6
7
|
import { CopilotError } from "./CopilotError";
|
|
7
8
|
import { CopilotSearchAck } from "./CopilotSearchAck";
|
|
8
9
|
import { FacetedNavigationAck } from "./FacetedNavigationAck";
|
|
9
|
-
import {
|
|
10
|
-
export type CopilotAPIAck = CancelAck | CopilotSearchAck | ConversationResetAck | FacetedNavigationAck | CopilotError;
|
|
10
|
+
import { ProductViewAck } from "./ProductViewAck";
|
|
11
|
+
export type CopilotAPIAck = CancelAck | CopilotSearchAck | ConversationResetAck | FacetedNavigationAck | ProductViewAck | CopilotError;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { CopilotSearchSuggestion } from './CopilotSearchSuggestion';
|
|
2
2
|
import { FacetedNavigationSuggestion } from './FacetedNavigationSuggestion';
|
|
3
|
+
import { ProductViewSuggestion } from './ProductViewSuggestion';
|
|
3
4
|
interface FollowUp {
|
|
4
5
|
sessionId: string;
|
|
5
6
|
id: string;
|
|
6
7
|
createdAt: string;
|
|
7
8
|
eventSourceId: string;
|
|
8
9
|
message: string;
|
|
9
|
-
suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion)[];
|
|
10
|
+
suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion | ProductViewSuggestion)[];
|
|
10
11
|
name: 'follow_up';
|
|
11
12
|
}
|
|
12
13
|
export { FollowUp };
|
|
@@ -27,6 +27,9 @@ export * from './FollowUp';
|
|
|
27
27
|
export * from './Inquiry';
|
|
28
28
|
export * from './OperationAck';
|
|
29
29
|
export * from './PartialInquiry';
|
|
30
|
+
export * from './ProductView';
|
|
31
|
+
export * from './ProductViewAck';
|
|
32
|
+
export * from './ProductViewSuggestion';
|
|
30
33
|
export * from './Progress';
|
|
31
34
|
export * from './ProgressToolKwargs';
|
|
32
35
|
export * from './RefinedSearch';
|
|
@@ -26,11 +26,11 @@ async function main() {
|
|
|
26
26
|
copilot.connect();
|
|
27
27
|
|
|
28
28
|
console.log("Reset conversaton with empty payload");
|
|
29
|
-
const response = await copilot.
|
|
29
|
+
const response = await copilot.conversationReset({});
|
|
30
30
|
console.log("Conversation reset response: ", response);
|
|
31
31
|
|
|
32
32
|
console.log("Reset conversaton with empty payload");
|
|
33
|
-
const responseWithUserReason = await copilot.
|
|
33
|
+
const responseWithUserReason = await copilot.conversationReset({
|
|
34
34
|
reason: "Clear the copilot context."
|
|
35
35
|
});
|
|
36
36
|
console.log("Conversation reset response: ", responseWithUserReason);
|
package/package.json
CHANGED
package/src/copilot.ts
CHANGED
|
@@ -13,6 +13,8 @@ import type {
|
|
|
13
13
|
CopilotSearchAck,
|
|
14
14
|
FacetedNavigation,
|
|
15
15
|
FacetedNavigationAck,
|
|
16
|
+
ProductView,
|
|
17
|
+
ProductViewAck,
|
|
16
18
|
ReturnedFields,
|
|
17
19
|
SessionInformation,
|
|
18
20
|
ConversationReset,
|
|
@@ -253,12 +255,12 @@ export default class CimulateCopilot<
|
|
|
253
255
|
);
|
|
254
256
|
}
|
|
255
257
|
|
|
256
|
-
async
|
|
257
|
-
async
|
|
258
|
+
async conversationReset(args: ConversationReset): Promise<CopilotResult<T, ConversationResetAck>>;
|
|
259
|
+
async conversationReset(
|
|
258
260
|
args: ConversationReset,
|
|
259
261
|
callback?: (event: ConversationResetAck) => void
|
|
260
262
|
): Promise<void>;
|
|
261
|
-
|
|
263
|
+
conversationReset(
|
|
262
264
|
args: ConversationReset,
|
|
263
265
|
callback?: (event: ConversationResetAck) => void
|
|
264
266
|
): Promise<CopilotResult<T, ConversationResetAck> | void> {
|
|
@@ -269,6 +271,24 @@ export default class CimulateCopilot<
|
|
|
269
271
|
);
|
|
270
272
|
}
|
|
271
273
|
|
|
274
|
+
async productView(
|
|
275
|
+
args: ProductView
|
|
276
|
+
): Promise<CopilotResult<T, ProductViewAck>>;
|
|
277
|
+
async productView(
|
|
278
|
+
args: ProductView,
|
|
279
|
+
callback?: (event: ProductViewAck) => void
|
|
280
|
+
): Promise<void>;
|
|
281
|
+
async productView(
|
|
282
|
+
args: ProductView,
|
|
283
|
+
callback?: (event: ProductViewAck) => void
|
|
284
|
+
): Promise<CopilotResult<T, ProductViewAck> | void> {
|
|
285
|
+
return this.asyncResponse<ProductView, ProductViewAck>(
|
|
286
|
+
"product_view",
|
|
287
|
+
args,
|
|
288
|
+
callback
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
272
292
|
async requestSessionInformation(): Promise<
|
|
273
293
|
CopilotResult<T, SessionInformation>
|
|
274
294
|
>;
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
For any new event, manually create an entry here.
|
|
4
4
|
*/
|
|
5
5
|
import { CancelAck } from "./CancelAck";
|
|
6
|
+
import { ConversationResetAck } from "./ConversationResetAck";
|
|
6
7
|
import { CopilotError } from "./CopilotError";
|
|
7
8
|
import { CopilotSearchAck } from "./CopilotSearchAck";
|
|
8
9
|
import { FacetedNavigationAck } from "./FacetedNavigationAck";
|
|
9
|
-
import {
|
|
10
|
+
import { ProductViewAck } from "./ProductViewAck"
|
|
10
11
|
|
|
11
12
|
export type CopilotAPIAck =
|
|
12
13
|
| CancelAck
|
|
13
14
|
| CopilotSearchAck
|
|
14
15
|
| ConversationResetAck
|
|
15
16
|
| FacetedNavigationAck
|
|
17
|
+
| ProductViewAck
|
|
16
18
|
| CopilotError;
|
package/src/model/FollowUp.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { CopilotSearchSuggestion } from './CopilotSearchSuggestion';
|
|
2
2
|
import { FacetedNavigationSuggestion } from './FacetedNavigationSuggestion';
|
|
3
|
+
import { ProductViewSuggestion } from './ProductViewSuggestion';
|
|
3
4
|
interface FollowUp {
|
|
4
5
|
sessionId: string;
|
|
5
6
|
id: string;
|
|
6
7
|
createdAt: string;
|
|
7
8
|
eventSourceId: string;
|
|
8
9
|
message: string;
|
|
9
|
-
suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion)[];
|
|
10
|
+
suggestions: (CopilotSearchSuggestion | FacetedNavigationSuggestion | ProductViewSuggestion)[];
|
|
10
11
|
name: 'follow_up';
|
|
11
12
|
}
|
|
12
13
|
export { FollowUp };
|
package/src/model/index.ts
CHANGED
|
@@ -27,6 +27,9 @@ export * from './FollowUp';
|
|
|
27
27
|
export * from './Inquiry';
|
|
28
28
|
export * from './OperationAck';
|
|
29
29
|
export * from './PartialInquiry';
|
|
30
|
+
export * from './ProductView';
|
|
31
|
+
export * from './ProductViewAck';
|
|
32
|
+
export * from './ProductViewSuggestion';
|
|
30
33
|
export * from './Progress';
|
|
31
34
|
export * from './ProgressToolKwargs';
|
|
32
35
|
export * from './RefinedSearch';
|