@koredev/agentai-web-sdk 1.2.6-rc → 1.2.8-rc

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/README.md CHANGED
@@ -1,33 +1,94 @@
1
+ # Agent AI Web SDK
2
+ Kore.ai offers the Agent AI Web SDK, a versatile and customizable solution for integrating Agent AI into your web application. It is built using JavaScript, Preact, and CSS/SCSS, enabling dynamic HTML generation and customization through a comprehensive event system.
3
+
4
+ With just few lines of code, you can embed our Kore.ai Agent AI Web SDK into your applications to enable end-users to interact with your applications using Natural Language. For more information, refer to
5
+
1
6
  Agent AI Web SDK
2
7
 
3
- To show
8
+ ## 💡 Getting Started
9
+
10
+ First, install Agent AI web SDK via the [npm](https://www.npmjs.com/get-npm) package manager:
11
+
12
+ ```bash
13
+ npm install --save npm i @koreai/agentai-web-sdk
14
+ ```
15
+
16
+ Get AAWindow and AAConfig
17
+
18
+ ```js
19
+ import { AAConfig, AAWindow } from '@koreai/agentai-web-sdk';
20
+ ```
21
+ Configure AAConfig
22
+
23
+
24
+
25
+ ```js
26
+
27
+ aaConfig.connectionDetails = {
28
+ conversationId: "PLEASE_ENTER_CONVERSATION_ID",
29
+ botId : "PLEASE_ENTER_BOT_ID",
30
+ domainURL: "PLEASE_ENETR_DOMAIN_URL",
31
+ token: "PLEASE_ENTER_TOKEN",
32
+ interactiveLanguage: "PLEASE_ENTER_LANGUAGE",
33
+ customData: "PLEASE_ENTER_CUSTOM_DATA",
34
+ userName: "PLEASE_ENTER_USER_NAME",
35
+ channel: "PLEASE_ENTER_CHANNEL",
36
+ sessionId: "PLEASE_ENTER_SESSION_ID",
37
+ summaryEnabled: "PLEASE_ENTER_SUMMARY_ENABLED"
38
+ };
39
+ aaConfig.container = 'aa-web-sdk';
40
+ aaConfig.branding.colors.primay = '#2970FF';
41
+
42
+ /*
43
+ Important Note: These keys are provided here for quick demos to generate JWT token at client side but not for Production environment.
44
+ Refer below document for JWT token generation at server side. Client Id and Client secret should maintained at server end.
45
+ https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/
46
+ **/
47
+
48
+ ```
49
+
50
+
51
+ Create AAWindow instance and trigger show method
52
+ ```js
53
+ var chatWindowInstance = new aaWindow(aaConfig);
54
+ chatWindowInstance.show(aaConfig);
4
55
  ```
5
- <!DOCTYPE html>
6
- <html lang="en">
7
- <header>
8
- <script src="https://cdn.jsdelivr.net/npm/@koredev/agentai-web-sdk@1.1.8-rc/dist/umd/agentai-web-sdk-umd.min.js"></script>
9
- </header>
10
- <body>
11
- <script>
56
+
57
+ ## 💡 Using Agent AI via CDN
58
+
59
+ include the following script in your html file and configure bot configurations
60
+
61
+ ```js
62
+
63
+ <script src="https://cdn.jsdelivr.net/npm/@koredai/agentai-web-sdk@1.0.0/dist/umd/agentai-web-sdk-umd.min.js"><script>
64
+
65
+ <script>
12
66
  var aaWindow=KoreAASDK.AAWindow;
13
67
  var aaConfig=KoreAASDK.AAConfig;
14
- let botOptions = aaConfig;
15
- var conversationId = 'XXXX';
16
- var botId = "XXXX";
17
- botOptions.connectionDetails = {
18
- conversationId,
19
- botId,
20
- "domainURL": "https://huddl-agentassist-dev.kore.ai",
21
- "token": "",
22
- "interactiveLanguage": "en",
23
- "customData": {},
24
- "userName": "",
25
- "channel": "chat",
26
- "sessionId": ""
68
+
69
+ aaConfig.connectionDetails = {
70
+ conversationId: "PLEASE_ENTER_CONVERSATION_ID",
71
+ botId : "PLEASE_ENTER_BOT_ID",
72
+ domainURL: "PLEASE_ENETR_DOMAIN_URL",
73
+ token: "PLEASE_ENTER_TOKEN",
74
+ interactiveLanguage: "PLEASE_ENTER_LANGUAGE",
75
+ customData: "PLEASE_ENTER_CUSTOM_DATA",
76
+ userName: "PLEASE_ENTER_USER_NAME",
77
+ channel: "PLEASE_ENTER_CHANNEL",
78
+ sessionId: "PLEASE_ENTER_SESSION_ID",
79
+ summaryEnabled: "PLEASE_ENTER_SUMMARY_ENABLED"
27
80
  };
28
- botOptions.container = 'aa-web-sdk';
29
- var chatWindowInstance = new aaWindow(botOptions);
30
- chatWindowInstance.show(botOptions);
81
+ aaConfig.container = 'aa-web-sdk';
82
+ aaConfig.branding.colors.primay = '#2970FF';
83
+
84
+ /*
85
+ Important Note: These keys are provided here for quick demos to generate JWT token at client side but not for Production environment.
86
+ Refer below document for JWT token generation at server side. Client Id and Client secret should maintained at server end.
87
+ https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/
88
+ **/
89
+
90
+ var chatWindowInstance = new aaWindow(aaConfig);
91
+ chatWindowInstance.show(aaConfig);
31
92
  </script>
32
93
  </body>
33
94
  </html>
@@ -8,8 +8,8 @@ declare class AAWindow extends EventEmitter {
8
8
  eventManager: any;
9
9
  constructor();
10
10
  show(config: any): void;
11
- handleAgentUserMessage(data: any): void;
12
- emitUserAgentMessage(payload: any, eType?: string): void;
11
+ sendUserMessage(_data: any): void;
12
+ sendAgentMessage(_data: any): void;
13
13
  initShow(config: any): void;
14
14
  getAASettings(botId: string): Promise<any>;
15
15
  JWTSetup(options: any): Promise<any>;
@@ -66,7 +66,8 @@ export declare enum SDK_EVENTS {
66
66
  'SEARCH_FILE_TEMPLATE' = "SEARCH_FILE_TEMPLATE",
67
67
  'SEARCH_FAQ_TEMPLATE' = "SEARCH_FAQ_TEMPLATE",
68
68
  'CONVERSATION_SUMMARY_TEMPLATE' = "CONVERSATION_SUMMARY_TEMPLATE",
69
- 'SUMMARY_TEMPLATE_ASSIST' = "SUMMARY_TEMPLATE_ASSIST"
69
+ 'SUMMARY_TEMPLATE_ASSIST' = "SUMMARY_TEMPLATE_ASSIST",
70
+ 'ON_ERROR' = "ON_ERROR"
70
71
  }
71
72
  export declare enum DATA_EVENTS {
72
73
  'AGENT_COACHING_RESPONSES' = "AGENT_COACHING_RESPONSES",
@@ -81,5 +82,6 @@ export declare enum INTERNAL_EVENTS {
81
82
  'USER_TRANSCRIPT_MSG' = "USER_TRANSCRIPT_MSG",
82
83
  'AGENT_TRANSCRIPT_MSG' = "AGENT_TRANSCRIPT_MSG",
83
84
  'END_OF_CONVERSATION' = "END_OF_CONVERSATION",
84
- 'CONVERSATION_SUMMARY_IN_ASSIST' = "CONVERSATION_SUMMARY_IN_ASSIST"
85
+ 'CONVERSATION_SUMMARY_IN_ASSIST' = "CONVERSATION_SUMMARY_IN_ASSIST",
86
+ 'ON_ERROR' = "ON_ERROR"
85
87
  }