cmcts-c-agent-embedding 1.0.19 → 1.0.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmcts-c-agent-embedding",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "Javascript library to display flowise chatbot on your website",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/public/index.html CHANGED
@@ -8,150 +8,144 @@
8
8
 
9
9
  <!doctype html>
10
10
  <html lang="en">
11
+ <head>
12
+ <meta charset="UTF-8" />
13
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
14
+ <title>Flowise Chatbot Widget</title>
15
+ </head>
11
16
 
12
- <head>
13
- <meta charset="UTF-8" />
14
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
15
- <title>Flowise Chatbot Widget</title>
16
- </head>
17
+ <body>
18
+ <div id="root">
19
+ <flowise-fullchatbot></flowise-fullchatbot>
20
+ </div>
21
+ <script type="module">
22
+ import Chatbot from './web.js';
17
23
 
18
- <body>
19
- <div id="root">
20
- <flowise-fullchatbot></flowise-fullchatbot>
21
- </div>
22
- <script type="module">
23
- import Chatbot from './web.js';
24
+ const customStringify = (obj) => {
25
+ let stringified = JSON.stringify(obj, null, 4)
26
+ .replace(/"([^"]+)":/g, '$1:')
27
+ .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`))
28
+ .replace(/: "(true|false|\d+)"/g, ': $1')
29
+ .replace(/customCSS: ""/g, 'customCSS: ``');
30
+ return stringified
31
+ .split('\n')
32
+ .map((line, index) => {
33
+ if (index === 0) return line;
34
+ return ' '.repeat(8) + line;
35
+ })
36
+ .join('\n');
37
+ };
24
38
 
25
- const customStringify = (obj) => {
26
- let stringified = JSON.stringify(obj, null, 4)
27
- .replace(/"([^"]+)":/g, '$1:')
28
- .replace(/: "([^"]+)"/g, (match, value) => (value.includes('<') ? `: "${value}"` : `: '${value}'`))
29
- .replace(/: "(true|false|\d+)"/g, ': $1')
30
- .replace(/customCSS: ""/g, 'customCSS: ``');
31
- return stringified
32
- .split('\n')
33
- .map((line, index) => {
34
- if (index === 0) return line;
35
- return ' '.repeat(8) + line;
36
- })
37
- .join('\n');
38
- };
39
-
40
- // Example initialization:
41
- // If your .env contains:
42
- // agent1=xyz789-uvw456,https://example.com
43
- // support=abc123-def456,https://example.com
44
- // salesbot=ghi123-jkl456,https://example.com
45
- //
46
- // Then use the environment variable name as chatflowid:
47
- Chatbot.initFull({
48
- // chatflowid: '6a63bb88-88f7-4c4d-805e-9c027c85707b', // or 'support', 'salesbot', etc.
49
- // chatflowid: 'b573e66d-0e28-4798-8e4f-fbbaff8e236f', // or 'support', 'salesbot', etc.
50
- // chatflowid: '7ee803b4-e3f8-4f33-bf85-ef9ab9d6f693', // or 'support', 'salesbot', etc.
51
- chatflowid: 'ec022b4c-e0ec-4e9c-9fae-fdaf3298bf5d', // or 'support', 'salesbot', etc.
52
- apiHost: 'http://localhost:8080',
53
- // apiHost: 'https://c-agent.cmcts.studio.ai.vn',
54
- chatwootUrl: 'http://203.145.47.214:8003',
55
- roomIds: {
56
- '012345678': 'PED74dTXmVBBdjYGKntbFsMm', // CMC UNI thủ tục nhập học
57
- '023456781': 'NhRMijqmRGJ6wX657H62HNz5', // CMC UNI Chuyên ngành học
58
- '034567812': 'ATkjNjV9VBDr4jrN25zRAm1u', // Học phí
59
- '045678123': 'sWUzHjyjJ81QsdGQScwTkyxn', // CMC UNI công tác sinh viên
60
- '056781234': 'ncR4YYe2MMeBk6F2AGydw5g9', // CMC UNI General
61
- },
62
- theme: customStringify({
63
- button: {
64
- backgroundColor: '#3B81F6',
65
- right: 20,
66
- bottom: 20,
67
- size: 48,
68
- dragAndDrop: true,
69
- iconColor: 'white',
70
- customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
71
- autoWindowOpen: {
72
- autoOpen: true,
73
- openDelay: 2,
74
- autoOpenOnMobile: false,
75
- },
76
- },
77
- tooltip: {
78
- showTooltip: true,
79
- tooltipMessage: 'Hi There 👋!',
80
- tooltipBackgroundColor: 'black',
81
- tooltipTextColor: 'white',
82
- tooltipFontSize: 16,
39
+ // Example initialization:
40
+ // If your .env contains:
41
+ // agent1=xyz789-uvw456,https://example.com
42
+ // support=abc123-def456,https://example.com
43
+ // salesbot=ghi123-jkl456,https://example.com
44
+ //
45
+ // Then use the environment variable name as chatflowid:
46
+ Chatbot.initFull({
47
+ // chatflowid: '6a63bb88-88f7-4c4d-805e-9c027c85707b', // or 'support', 'salesbot', etc.
48
+ // chatflowid: 'b573e66d-0e28-4798-8e4f-fbbaff8e236f', // or 'support', 'salesbot', etc.
49
+ // chatflowid: '7ee803b4-e3f8-4f33-bf85-ef9ab9d6f693', // or 'support', 'salesbot', etc.
50
+ chatflowid: '217bfde9-d4cb-4b2a-b637-89890a9990ee', // or 'support', 'salesbot', etc.
51
+ apiHost: 'https://vib.cagent.cmcts.ai',
52
+ // apiHost: 'https://c-agent.cmcts.studio.ai.vn',
53
+ chatwootUrl: 'https://livechat.cagent.cmcts.ai',
54
+ roomIds: {
55
+ '0123456789': 'Xa6HmhfbU5K73ZhHnspzKhqs',
83
56
  },
84
- disclaimer: {
85
- title: 'Disclaimer',
86
- message: 'By using this chatbot, you agree to the <a target="_blank" href="https://flowiseai.com/terms">Terms & Condition</a>',
87
- textColor: 'black',
88
- buttonColor: '#3b82f6',
89
- buttonText: 'Start Chatting',
90
- buttonTextColor: 'white',
91
- blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)',
92
- backgroundColor: 'white',
93
- },
94
- customCSS: ``,
95
- chatWindow: {
96
- showTitle: true,
97
- showAgentMessages: true,
98
- title: 'Agent Studio Bot',
99
- titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
100
- welcomeMessage: 'Hello! This is custom welcome message',
101
- errorMessage: 'This is a custom error message',
102
- backgroundColor: '#ffffff',
103
- backgroundImage: 'enter image path or link',
104
- height: 700,
105
- width: 400,
106
- fontSize: 16,
107
- starterPrompts: ['What is a bot?', 'Who are you?'],
108
- starterPromptFontSize: 15,
109
- clearChatOnReload: false,
110
- sourceDocsTitle: 'Sources:',
111
- renderHTML: true,
112
- botMessage: {
113
- backgroundColor: '#f7f8ff',
114
- textColor: '#303235',
115
- showAvatar: true,
116
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
117
- },
118
- userMessage: {
57
+ theme: customStringify({
58
+ button: {
119
59
  backgroundColor: '#3B81F6',
120
- textColor: '#ffffff',
121
- showAvatar: true,
122
- avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
60
+ right: 20,
61
+ bottom: 20,
62
+ size: 48,
63
+ dragAndDrop: true,
64
+ iconColor: 'white',
65
+ customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
66
+ autoWindowOpen: {
67
+ autoOpen: true,
68
+ openDelay: 2,
69
+ autoOpenOnMobile: false,
70
+ },
123
71
  },
124
- textInput: {
125
- placeholder: 'Type your question',
126
- backgroundColor: '#ffffff',
127
- textColor: '#303235',
128
- sendButtonColor: '#3B81F6',
129
- maxChars: 50,
130
- maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
131
- autoFocus: true,
132
- sendMessageSound: true,
133
- sendSoundLocation: 'send_message.mp3',
134
- receiveMessageSound: true,
135
- receiveSoundLocation: 'receive_message.mp3',
136
- },
137
- feedback: {
138
- color: '#303235',
72
+ tooltip: {
73
+ showTooltip: true,
74
+ tooltipMessage: 'Hi There 👋!',
75
+ tooltipBackgroundColor: 'black',
76
+ tooltipTextColor: 'white',
77
+ tooltipFontSize: 16,
139
78
  },
140
- dateTimeToggle: {
141
- date: true,
142
- time: true,
79
+ disclaimer: {
80
+ title: 'Disclaimer',
81
+ message: 'By using this chatbot, you agree to the <a target="_blank" href="https://flowiseai.com/terms">Terms & Condition</a>',
82
+ textColor: 'black',
83
+ buttonColor: '#3b82f6',
84
+ buttonText: 'Start Chatting',
85
+ buttonTextColor: 'white',
86
+ blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)',
87
+ backgroundColor: 'white',
143
88
  },
144
- footer: {
145
- textColor: '#303235',
146
- text: 'Powered by',
147
- company: 'Agent Studio',
148
- // companyLink: 'https://flowiseai.com'
149
- companyLink: '#',
89
+ customCSS: ``,
90
+ chatWindow: {
91
+ showTitle: true,
92
+ showAgentMessages: true,
93
+ title: 'Agent Studio Bot',
94
+ titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
95
+ welcomeMessage: 'Hello! This is custom welcome message',
96
+ errorMessage: 'This is a custom error message',
97
+ backgroundColor: '#ffffff',
98
+ backgroundImage: 'enter image path or link',
99
+ height: 700,
100
+ width: 400,
101
+ fontSize: 16,
102
+ starterPrompts: ['What is a bot?', 'Who are you?'],
103
+ starterPromptFontSize: 15,
104
+ clearChatOnReload: false,
105
+ sourceDocsTitle: 'Sources:',
106
+ renderHTML: true,
107
+ botMessage: {
108
+ backgroundColor: '#f7f8ff',
109
+ textColor: '#303235',
110
+ showAvatar: true,
111
+ avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
112
+ },
113
+ userMessage: {
114
+ backgroundColor: '#3B81F6',
115
+ textColor: '#ffffff',
116
+ showAvatar: true,
117
+ avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
118
+ },
119
+ textInput: {
120
+ placeholder: 'Type your question',
121
+ backgroundColor: '#ffffff',
122
+ textColor: '#303235',
123
+ sendButtonColor: '#3B81F6',
124
+ maxChars: 50,
125
+ maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
126
+ autoFocus: true,
127
+ sendMessageSound: true,
128
+ sendSoundLocation: 'send_message.mp3',
129
+ receiveMessageSound: true,
130
+ receiveSoundLocation: 'receive_message.mp3',
131
+ },
132
+ feedback: {
133
+ color: '#303235',
134
+ },
135
+ dateTimeToggle: {
136
+ date: true,
137
+ time: true,
138
+ },
139
+ footer: {
140
+ textColor: '#303235',
141
+ text: 'Powered by',
142
+ company: 'Agent Studio',
143
+ // companyLink: 'https://flowiseai.com'
144
+ companyLink: '#',
145
+ },
150
146
  },
151
- },
152
- }),
153
- });
154
- </script>
155
- </body>
156
-
157
- </html>
147
+ }),
148
+ });
149
+ </script>
150
+ </body>
151
+ </html>