cmcts-c-agent-embedding 1.0.23 → 1.0.25
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
package/public/index.html
CHANGED
|
@@ -8,144 +8,146 @@
|
|
|
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>
|
|
16
11
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import Chatbot from './web.js';
|
|
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>
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
};
|
|
18
|
+
<body>
|
|
19
|
+
<div id="root">
|
|
20
|
+
<flowise-fullchatbot></flowise-fullchatbot>
|
|
21
|
+
</div>
|
|
22
|
+
<script type="module">
|
|
23
|
+
import Chatbot from './web.js';
|
|
38
24
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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: '217bfde9-d4cb-4b2a-b637-89890a9990ee', // or 'support', 'salesbot', etc.
|
|
52
|
+
apiHost: 'http://localhost:8080',
|
|
53
|
+
// apiHost: 'https://c-agent.cmcts.studio.ai.vn',
|
|
54
|
+
chatwootUrl: 'https://livechat.cagent.cmcts.ai',
|
|
55
|
+
roomIds: {
|
|
56
|
+
'0123456789': 'Xa6HmhfbU5K73ZhHnspzKhqs',
|
|
57
|
+
},
|
|
58
|
+
theme: customStringify({
|
|
59
|
+
button: {
|
|
60
|
+
backgroundColor: '#3B81F6',
|
|
61
|
+
right: 20,
|
|
62
|
+
bottom: 20,
|
|
63
|
+
size: 48,
|
|
64
|
+
dragAndDrop: true,
|
|
65
|
+
iconColor: 'white',
|
|
66
|
+
customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
|
|
67
|
+
autoWindowOpen: {
|
|
68
|
+
autoOpen: true,
|
|
69
|
+
openDelay: 2,
|
|
70
|
+
autoOpenOnMobile: false,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
tooltip: {
|
|
74
|
+
showTooltip: true,
|
|
75
|
+
tooltipMessage: 'Hi There 👋!',
|
|
76
|
+
tooltipBackgroundColor: 'black',
|
|
77
|
+
tooltipTextColor: 'white',
|
|
78
|
+
tooltipFontSize: 16,
|
|
56
79
|
},
|
|
57
|
-
|
|
58
|
-
|
|
80
|
+
disclaimer: {
|
|
81
|
+
title: 'Disclaimer',
|
|
82
|
+
message: 'By using this chatbot, you agree to the <a target="_blank" href="https://flowiseai.com/terms">Terms & Condition</a>',
|
|
83
|
+
textColor: 'black',
|
|
84
|
+
buttonColor: '#3b82f6',
|
|
85
|
+
buttonText: 'Start Chatting',
|
|
86
|
+
buttonTextColor: 'white',
|
|
87
|
+
blurredBackgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
88
|
+
backgroundColor: 'white',
|
|
89
|
+
},
|
|
90
|
+
customCSS: ``,
|
|
91
|
+
chatWindow: {
|
|
92
|
+
showTitle: true,
|
|
93
|
+
showAgentMessages: true,
|
|
94
|
+
title: 'Agent Studio Bot',
|
|
95
|
+
titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
|
|
96
|
+
welcomeMessage: 'Hello! This is custom welcome message',
|
|
97
|
+
errorMessage: 'This is a custom error message',
|
|
98
|
+
backgroundColor: '#ffffff',
|
|
99
|
+
backgroundImage: 'enter image path or link',
|
|
100
|
+
height: 700,
|
|
101
|
+
width: 400,
|
|
102
|
+
fontSize: 16,
|
|
103
|
+
starterPrompts: ['What is a bot?', 'Who are you?'],
|
|
104
|
+
starterPromptFontSize: 15,
|
|
105
|
+
clearChatOnReload: false,
|
|
106
|
+
sourceDocsTitle: 'Sources:',
|
|
107
|
+
renderHTML: true,
|
|
108
|
+
botMessage: {
|
|
109
|
+
backgroundColor: '#f7f8ff',
|
|
110
|
+
textColor: '#303235',
|
|
111
|
+
showAvatar: true,
|
|
112
|
+
avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
|
|
113
|
+
},
|
|
114
|
+
userMessage: {
|
|
59
115
|
backgroundColor: '#3B81F6',
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
},
|
|
116
|
+
textColor: '#ffffff',
|
|
117
|
+
showAvatar: true,
|
|
118
|
+
avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
|
|
71
119
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
120
|
+
textInput: {
|
|
121
|
+
placeholder: 'Type your question',
|
|
122
|
+
backgroundColor: '#ffffff',
|
|
123
|
+
textColor: '#303235',
|
|
124
|
+
sendButtonColor: '#3B81F6',
|
|
125
|
+
maxChars: 50,
|
|
126
|
+
maxCharsWarningMessage: 'You exceeded the characters limit. Please input less than 50 characters.',
|
|
127
|
+
autoFocus: true,
|
|
128
|
+
sendMessageSound: true,
|
|
129
|
+
sendSoundLocation: 'send_message.mp3',
|
|
130
|
+
receiveMessageSound: true,
|
|
131
|
+
receiveSoundLocation: 'receive_message.mp3',
|
|
78
132
|
},
|
|
79
|
-
|
|
80
|
-
|
|
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',
|
|
133
|
+
feedback: {
|
|
134
|
+
color: '#303235',
|
|
88
135
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
},
|
|
136
|
+
dateTimeToggle: {
|
|
137
|
+
date: true,
|
|
138
|
+
time: true,
|
|
139
|
+
},
|
|
140
|
+
footer: {
|
|
141
|
+
textColor: '#303235',
|
|
142
|
+
text: 'Powered by',
|
|
143
|
+
company: 'Agent Studio',
|
|
144
|
+
// companyLink: 'https://flowiseai.com'
|
|
145
|
+
companyLink: '#',
|
|
146
146
|
},
|
|
147
|
-
}
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
</
|
|
151
|
-
</
|
|
147
|
+
},
|
|
148
|
+
}),
|
|
149
|
+
});
|
|
150
|
+
</script>
|
|
151
|
+
</body>
|
|
152
|
+
|
|
153
|
+
</html>
|