@eeacms/volto-eea-chatbot 1.0.9
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/.coverage.babel.config.js +9 -0
- package/.eslintrc.js +68 -0
- package/.husky/pre-commit +2 -0
- package/.release-it.json +17 -0
- package/AGENTS.md +89 -0
- package/CHANGELOG.md +770 -0
- package/DEVELOP.md +124 -0
- package/LICENSE.md +9 -0
- package/README.md +170 -0
- package/RELEASE.md +74 -0
- package/TESTING.md +5 -0
- package/babel.config.js +17 -0
- package/bootstrap +41 -0
- package/cypress.config.js +27 -0
- package/docker-compose.yml +32 -0
- package/jest-addon.config.js +465 -0
- package/jest.setup.js +65 -0
- package/locales/de/LC_MESSAGES/volto.po +14 -0
- package/locales/en/LC_MESSAGES/volto.po +14 -0
- package/locales/it/LC_MESSAGES/volto.po +14 -0
- package/locales/ro/LC_MESSAGES/volto.po +14 -0
- package/locales/volto.pot +16 -0
- package/package.json +98 -0
- package/razzle.extend.js +40 -0
- package/src/ChatBlock/ChatBlockEdit.jsx +46 -0
- package/src/ChatBlock/ChatBlockView.jsx +21 -0
- package/src/ChatBlock/chat/AIMessage.tsx +566 -0
- package/src/ChatBlock/chat/ChatMessage.tsx +35 -0
- package/src/ChatBlock/chat/ChatWindow.tsx +288 -0
- package/src/ChatBlock/chat/UserMessage.tsx +27 -0
- package/src/ChatBlock/chat/index.ts +4 -0
- package/src/ChatBlock/components/AutoResizeTextarea.jsx +67 -0
- package/src/ChatBlock/components/BlinkingDot.tsx +3 -0
- package/src/ChatBlock/components/ChatMessageFeedback.jsx +77 -0
- package/src/ChatBlock/components/EmptyState.jsx +70 -0
- package/src/ChatBlock/components/FeedbackModal.jsx +125 -0
- package/src/ChatBlock/components/HalloumiFeedback.jsx +126 -0
- package/src/ChatBlock/components/Icon.tsx +35 -0
- package/src/ChatBlock/components/QualityCheckToggle.jsx +26 -0
- package/src/ChatBlock/components/RelatedQuestions.jsx +59 -0
- package/src/ChatBlock/components/Source.jsx +93 -0
- package/src/ChatBlock/components/SourceChip.tsx +55 -0
- package/src/ChatBlock/components/Spinner.jsx +3 -0
- package/src/ChatBlock/components/UserActionsToolbar.jsx +44 -0
- package/src/ChatBlock/components/WebResultIcon.tsx +42 -0
- package/src/ChatBlock/components/markdown/Citation.jsx +70 -0
- package/src/ChatBlock/components/markdown/ClaimModal.jsx +98 -0
- package/src/ChatBlock/components/markdown/ClaimSegments.jsx +172 -0
- package/src/ChatBlock/components/markdown/RenderClaimView.jsx +96 -0
- package/src/ChatBlock/components/markdown/colors.js +29 -0
- package/src/ChatBlock/components/markdown/colors.less +52 -0
- package/src/ChatBlock/components/markdown/colors.test.js +69 -0
- package/src/ChatBlock/components/markdown/index.js +115 -0
- package/src/ChatBlock/fonts/DejaVuSans.ttf +0 -0
- package/src/ChatBlock/hocs/withOnyxData.jsx +46 -0
- package/src/ChatBlock/hooks/index.ts +7 -0
- package/src/ChatBlock/hooks/useChatController.ts +333 -0
- package/src/ChatBlock/hooks/useChatStreaming.ts +82 -0
- package/src/ChatBlock/hooks/useDeepCompareMemoize.js +17 -0
- package/src/ChatBlock/hooks/useMarked.js +44 -0
- package/src/ChatBlock/hooks/useQualityMarkers.js +119 -0
- package/src/ChatBlock/hooks/useScrollonStream.ts +131 -0
- package/src/ChatBlock/hooks/useToolDisplayTiming.ts +80 -0
- package/src/ChatBlock/index.js +32 -0
- package/src/ChatBlock/packets/MultiToolRenderer.tsx +235 -0
- package/src/ChatBlock/packets/RendererComponent.tsx +115 -0
- package/src/ChatBlock/packets/index.ts +4 -0
- package/src/ChatBlock/packets/renderers/CustomToolRenderer.tsx +63 -0
- package/src/ChatBlock/packets/renderers/FetchToolRenderer.tsx +59 -0
- package/src/ChatBlock/packets/renderers/ImageToolRenderer.tsx +62 -0
- package/src/ChatBlock/packets/renderers/MessageTextRenderer.tsx +172 -0
- package/src/ChatBlock/packets/renderers/ReasoningRenderer.tsx +122 -0
- package/src/ChatBlock/packets/renderers/SearchToolRenderer.tsx +323 -0
- package/src/ChatBlock/packets/renderers/index.ts +6 -0
- package/src/ChatBlock/schema.js +403 -0
- package/src/ChatBlock/services/index.ts +3 -0
- package/src/ChatBlock/services/messageProcessor.ts +348 -0
- package/src/ChatBlock/services/packetUtils.ts +48 -0
- package/src/ChatBlock/services/streamingService.ts +342 -0
- package/src/ChatBlock/style.less +1881 -0
- package/src/ChatBlock/tests/AIMessage.test.jsx +95 -0
- package/src/ChatBlock/tests/AutoResizeTextarea.test.jsx +49 -0
- package/src/ChatBlock/tests/BlinkingDot.test.jsx +71 -0
- package/src/ChatBlock/tests/ChatMessageFeedback.test.jsx +73 -0
- package/src/ChatBlock/tests/Citation.test.jsx +107 -0
- package/src/ChatBlock/tests/EmptyState.test.jsx +137 -0
- package/src/ChatBlock/tests/FeedbackModal.test.jsx +138 -0
- package/src/ChatBlock/tests/HalloumiFeedback.test.jsx +94 -0
- package/src/ChatBlock/tests/QualityCheckToggle.test.jsx +105 -0
- package/src/ChatBlock/tests/RelatedQuestions.test.jsx +215 -0
- package/src/ChatBlock/tests/Source.test.jsx +79 -0
- package/src/ChatBlock/tests/Spinner.test.jsx +18 -0
- package/src/ChatBlock/tests/index.test.js +51 -0
- package/src/ChatBlock/tests/messageProcessor.test.jsx +154 -0
- package/src/ChatBlock/tests/schema.test.js +166 -0
- package/src/ChatBlock/tests/useDeepCompareMemoize.test.js +107 -0
- package/src/ChatBlock/tests/useToolDisplayTiming.test.jsx +151 -0
- package/src/ChatBlock/types/cssmodules.d.ts +7 -0
- package/src/ChatBlock/types/interfaces.ts +154 -0
- package/src/ChatBlock/types/slate.d.ts +3 -0
- package/src/ChatBlock/types/streamingModels.ts +267 -0
- package/src/ChatBlock/types/volto.d.ts +3 -0
- package/src/ChatBlock/utils/citations.ts +25 -0
- package/src/ChatBlock/utils/index.tsx +114 -0
- package/src/halloumi/README.md +1 -0
- package/src/halloumi/generative.js +219 -0
- package/src/halloumi/generative.test.js +88 -0
- package/src/halloumi/middleware.js +70 -0
- package/src/halloumi/postprocessing.js +273 -0
- package/src/halloumi/postprocessing.test.js +441 -0
- package/src/halloumi/preprocessing.js +115 -0
- package/src/halloumi/preprocessing.test.js +245 -0
- package/src/icons/bot.svg +1 -0
- package/src/icons/check.svg +1 -0
- package/src/icons/chevron.svg +3 -0
- package/src/icons/clear.svg +1 -0
- package/src/icons/copy.svg +1 -0
- package/src/icons/done.svg +5 -0
- package/src/icons/external-link.svg +1 -0
- package/src/icons/file.svg +1 -0
- package/src/icons/glasses.svg +1 -0
- package/src/icons/globe.svg +1 -0
- package/src/icons/rotate.svg +1 -0
- package/src/icons/search.svg +5 -0
- package/src/icons/send.svg +1 -0
- package/src/icons/square-pen.svg +1 -0
- package/src/icons/stop.svg +9 -0
- package/src/icons/thumbs-down.svg +1 -0
- package/src/icons/thumbs-up.svg +1 -0
- package/src/icons/user.svg +1 -0
- package/src/index.js +58 -0
- package/src/middleware.js +250 -0
- package/tsconfig.json +40 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { PacketType } from './types/streamingModels';
|
|
2
|
+
|
|
3
|
+
const ScoreRangeSchema = {
|
|
4
|
+
title: 'Score Range',
|
|
5
|
+
fieldsets: [
|
|
6
|
+
{
|
|
7
|
+
id: 'default',
|
|
8
|
+
title: 'Default',
|
|
9
|
+
fields: ['start', 'end', 'label', 'color'],
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
properties: {
|
|
13
|
+
start: {
|
|
14
|
+
title: 'Score start',
|
|
15
|
+
description: 'Lower bound for this range',
|
|
16
|
+
type: 'number',
|
|
17
|
+
},
|
|
18
|
+
end: {
|
|
19
|
+
title: 'Score end',
|
|
20
|
+
description: 'Upper bound for this range',
|
|
21
|
+
type: 'number',
|
|
22
|
+
},
|
|
23
|
+
label: {
|
|
24
|
+
title: 'Label',
|
|
25
|
+
widget: 'slate',
|
|
26
|
+
description:
|
|
27
|
+
'Message to be shown to the users (rich text). If you include the {score} placeholder, it will be replaced with the score.',
|
|
28
|
+
},
|
|
29
|
+
// icon: {
|
|
30
|
+
// title: 'Icon name',
|
|
31
|
+
// description: 'Semantic-ui Icon names',
|
|
32
|
+
// default: 'exclamation',
|
|
33
|
+
// },
|
|
34
|
+
color: {
|
|
35
|
+
title: 'Message color',
|
|
36
|
+
description: (
|
|
37
|
+
<>
|
|
38
|
+
Color for the message box. See{' '}
|
|
39
|
+
<a href="https://react.semantic-ui.com/collections/message/#variations-color">
|
|
40
|
+
documentation
|
|
41
|
+
</a>
|
|
42
|
+
</>
|
|
43
|
+
),
|
|
44
|
+
choices: [
|
|
45
|
+
['red', 'red'],
|
|
46
|
+
['orange', 'orange'],
|
|
47
|
+
['yellow', 'yellow'],
|
|
48
|
+
['olive', 'olive'],
|
|
49
|
+
['green', 'green'],
|
|
50
|
+
['teal', 'teal'],
|
|
51
|
+
['blue', 'blue'],
|
|
52
|
+
['violet', 'violet'],
|
|
53
|
+
['purple', 'purple'],
|
|
54
|
+
['pink', 'pink'],
|
|
55
|
+
['brown', 'brown'],
|
|
56
|
+
['black', 'black'],
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export function ChatBlockSchema({ assistants, data }) {
|
|
62
|
+
const assistantChoices = () =>
|
|
63
|
+
Array.isArray(assistants)
|
|
64
|
+
? assistants.map(({ id, name }) => [id.toString(), name])
|
|
65
|
+
: [];
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
title: 'Chatbot',
|
|
69
|
+
fieldsets: [
|
|
70
|
+
{
|
|
71
|
+
id: 'default',
|
|
72
|
+
title: 'Default',
|
|
73
|
+
fields: [
|
|
74
|
+
'chatTitle',
|
|
75
|
+
'assistant',
|
|
76
|
+
'qgenAsistantId',
|
|
77
|
+
'placeholderPrompt',
|
|
78
|
+
'height',
|
|
79
|
+
'enableStarterPrompts',
|
|
80
|
+
...(data.enableStarterPrompts ? ['starterPrompts'] : []),
|
|
81
|
+
'starterPromptsHeading',
|
|
82
|
+
'starterPromptsPosition',
|
|
83
|
+
'showAssistantPrompts',
|
|
84
|
+
'enableQgen',
|
|
85
|
+
'deepResearch',
|
|
86
|
+
'enableShowTotalFailMessage',
|
|
87
|
+
...(data.enableShowTotalFailMessage ? ['totalFailMessage'] : []),
|
|
88
|
+
'qualityCheck',
|
|
89
|
+
...(data.qualityCheck && data.qualityCheck === 'ondemand_toggle'
|
|
90
|
+
? ['onDemandInputToggle']
|
|
91
|
+
: []),
|
|
92
|
+
...(data.qualityCheck && data.qualityCheck !== 'disabled'
|
|
93
|
+
? [
|
|
94
|
+
'maxContextSegments',
|
|
95
|
+
'noSupportDocumentsMessage',
|
|
96
|
+
'qualityCheckContext',
|
|
97
|
+
'qualityCheckStages',
|
|
98
|
+
]
|
|
99
|
+
: []),
|
|
100
|
+
'enableFeedback',
|
|
101
|
+
...(data.enableFeedback ? ['feedbackReasons'] : []),
|
|
102
|
+
'showTools',
|
|
103
|
+
'enableMatomoTracking',
|
|
104
|
+
'scrollToInput',
|
|
105
|
+
'showAssistantTitle',
|
|
106
|
+
'showAssistantDescription',
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
properties: {
|
|
111
|
+
enableShowTotalFailMessage: {
|
|
112
|
+
title: 'Show total failure message',
|
|
113
|
+
type: 'boolean',
|
|
114
|
+
default: false,
|
|
115
|
+
},
|
|
116
|
+
totalFailMessage: {
|
|
117
|
+
title: "Message when there's no citations",
|
|
118
|
+
widget: 'slate',
|
|
119
|
+
default: [
|
|
120
|
+
{
|
|
121
|
+
type: 'p',
|
|
122
|
+
children: [
|
|
123
|
+
{
|
|
124
|
+
text: "The AI provided answer doesn't include citations. For safety reasons we will not show it.",
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
noSupportDocumentsMessage: {
|
|
131
|
+
title: 'No sources message',
|
|
132
|
+
description: 'This message will be shown instead of the sources',
|
|
133
|
+
widget: 'slate',
|
|
134
|
+
default: [
|
|
135
|
+
{
|
|
136
|
+
type: 'p',
|
|
137
|
+
children: [
|
|
138
|
+
{ text: 'No supported information found in the documents' },
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
deepResearch: {
|
|
144
|
+
title: 'Deep research',
|
|
145
|
+
choices: [
|
|
146
|
+
['always_on', 'Always on'],
|
|
147
|
+
['unavailable', 'Unavailable'],
|
|
148
|
+
['user_on', 'User choice, on by default'],
|
|
149
|
+
['user_off', 'User choice, off by default'],
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
assistant: {
|
|
153
|
+
title: 'Assistant',
|
|
154
|
+
choices: assistantChoices(),
|
|
155
|
+
},
|
|
156
|
+
qgenAsistantId: {
|
|
157
|
+
title: 'QAssistant',
|
|
158
|
+
choices: assistantChoices(),
|
|
159
|
+
description: 'The assistant used to generate the related questions',
|
|
160
|
+
},
|
|
161
|
+
enableQgen: {
|
|
162
|
+
title: 'Enable related question generation',
|
|
163
|
+
type: 'boolean',
|
|
164
|
+
default: false,
|
|
165
|
+
},
|
|
166
|
+
enableFeedback: {
|
|
167
|
+
title: 'Enable feedback',
|
|
168
|
+
type: 'boolean',
|
|
169
|
+
default: true,
|
|
170
|
+
},
|
|
171
|
+
qualityCheck: {
|
|
172
|
+
title: 'Quality checks',
|
|
173
|
+
choices: [
|
|
174
|
+
['disabled', 'Disabled'],
|
|
175
|
+
['enabled', 'Enabled'],
|
|
176
|
+
['ondemand', 'On demand'],
|
|
177
|
+
['ondemand_toggle', 'On demand (show toggle on input)'],
|
|
178
|
+
],
|
|
179
|
+
default: 'disabled',
|
|
180
|
+
description: 'Show Halloumi-based automated quality check',
|
|
181
|
+
},
|
|
182
|
+
onDemandInputToggle: {
|
|
183
|
+
title: 'Fact-check AI toggle default state',
|
|
184
|
+
type: 'boolean',
|
|
185
|
+
default: true,
|
|
186
|
+
description:
|
|
187
|
+
'Sets the default state of the fact-check AI toggle. When enabled, quality checks run automatically; when disabled, users must enable them manually.',
|
|
188
|
+
},
|
|
189
|
+
qualityCheckContext: {
|
|
190
|
+
title: 'Context documents',
|
|
191
|
+
default: 'citations',
|
|
192
|
+
choices: [
|
|
193
|
+
['citations', 'Only cited documents'],
|
|
194
|
+
['all', 'All documents passed to LLM'],
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
qualityCheckStages: {
|
|
198
|
+
title: 'Score ranges',
|
|
199
|
+
widget: 'object_list',
|
|
200
|
+
schema: ScoreRangeSchema,
|
|
201
|
+
description: `Messages to be shown based on the averaged Halloumi
|
|
202
|
+
score. Make sure that there are no gaps in the ranges and that the entire
|
|
203
|
+
range is from 0 to 100`,
|
|
204
|
+
default: [
|
|
205
|
+
{
|
|
206
|
+
'@id': 'one',
|
|
207
|
+
label:
|
|
208
|
+
'❌ {score} factuality score. Not supported by our content. Likely guesses—always double-check.',
|
|
209
|
+
start: 0,
|
|
210
|
+
end: 19,
|
|
211
|
+
color: 'red',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
'@id': 'two',
|
|
215
|
+
label:
|
|
216
|
+
'❗ {score} factuality score. Mostly not supported—likely based on AI logic. Please verify elsewhere.',
|
|
217
|
+
start: 20,
|
|
218
|
+
end: 39,
|
|
219
|
+
color: 'orange',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
'@id': 'three',
|
|
223
|
+
label:
|
|
224
|
+
'⚠️ {score} factuality score. Partially supported. Double-check if using for important decisions.',
|
|
225
|
+
start: 40,
|
|
226
|
+
end: 79,
|
|
227
|
+
color: 'yellow',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
'@id': 'four',
|
|
231
|
+
label:
|
|
232
|
+
'ℹ️ {score} factuality score. Mostly supported, but some parts may not be. Consider checking key points.',
|
|
233
|
+
start: 80,
|
|
234
|
+
end: 94,
|
|
235
|
+
color: 'olive',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
'@id': 'five',
|
|
239
|
+
label:
|
|
240
|
+
'✅ {score} factuality score. Fully supported by our content. Safe to trust—no need to double-check.',
|
|
241
|
+
start: 95,
|
|
242
|
+
end: 100,
|
|
243
|
+
color: 'green',
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
},
|
|
247
|
+
maxContextSegments: {
|
|
248
|
+
title: 'Max context segments',
|
|
249
|
+
type: 'number',
|
|
250
|
+
default: 100,
|
|
251
|
+
description:
|
|
252
|
+
'Optimize quality check performance by grouping sentences into a max number of segments. Set to 0 to disable grouping and instead use one sentence per segment.',
|
|
253
|
+
},
|
|
254
|
+
feedbackReasons: {
|
|
255
|
+
title: 'Feedback reasons',
|
|
256
|
+
description: 'Select the reasons for negative feedback.',
|
|
257
|
+
choices: [
|
|
258
|
+
['Repetitive', 'Repetitive'],
|
|
259
|
+
['Irrelevant', 'Irrelevant'],
|
|
260
|
+
['Inaccurate/Incomplete', 'Inaccurate/Incomplete'],
|
|
261
|
+
['Unclear', 'Unclear'],
|
|
262
|
+
['Slow', 'Slow'],
|
|
263
|
+
['Wrong source(s)', 'Wrong source(s)'],
|
|
264
|
+
['Too long', 'Too long'],
|
|
265
|
+
['Too short', 'Too short'],
|
|
266
|
+
['Outdated sources', 'Outdated sources'],
|
|
267
|
+
[
|
|
268
|
+
'Too many follow-up questions needed',
|
|
269
|
+
'Too many follow-up questions needed',
|
|
270
|
+
],
|
|
271
|
+
],
|
|
272
|
+
isMulti: true,
|
|
273
|
+
default: [
|
|
274
|
+
'Repetitive',
|
|
275
|
+
'Irrelevant',
|
|
276
|
+
'Inaccurate/Incomplete',
|
|
277
|
+
'Unclear',
|
|
278
|
+
'Slow',
|
|
279
|
+
'Wrong source(s)',
|
|
280
|
+
'Too long',
|
|
281
|
+
'Too short',
|
|
282
|
+
'Outdated sources',
|
|
283
|
+
'Too many follow-up questions needed',
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
enableStarterPrompts: {
|
|
287
|
+
title: 'Enable custom starter prompts',
|
|
288
|
+
type: 'boolean',
|
|
289
|
+
default: false,
|
|
290
|
+
description:
|
|
291
|
+
'Define custom clickable messages to initiate a chat with the assistant.',
|
|
292
|
+
},
|
|
293
|
+
starterPrompts: {
|
|
294
|
+
title: 'Starter prompts',
|
|
295
|
+
widget: 'object_list',
|
|
296
|
+
schema: {
|
|
297
|
+
title: 'Prompt',
|
|
298
|
+
fieldsets: [
|
|
299
|
+
{
|
|
300
|
+
id: 'default',
|
|
301
|
+
title: 'Default',
|
|
302
|
+
fields: ['name', 'description', 'message'],
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
properties: {
|
|
306
|
+
name: {
|
|
307
|
+
title: 'Title',
|
|
308
|
+
description: 'Starter prompt title shown on the button.',
|
|
309
|
+
},
|
|
310
|
+
description: {
|
|
311
|
+
title: 'Description',
|
|
312
|
+
description: 'Starter prompt description shown on the button.',
|
|
313
|
+
},
|
|
314
|
+
message: {
|
|
315
|
+
title: 'Message',
|
|
316
|
+
type: 'string',
|
|
317
|
+
description:
|
|
318
|
+
'Message sent to the assistant when the button is clicked.',
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
required: ['message', 'name'],
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
starterPromptsPosition: {
|
|
325
|
+
title: 'Prompts Position',
|
|
326
|
+
type: 'string',
|
|
327
|
+
choices: [
|
|
328
|
+
['top', 'Top'],
|
|
329
|
+
['bottom', 'Bottom'],
|
|
330
|
+
],
|
|
331
|
+
default: 'top',
|
|
332
|
+
},
|
|
333
|
+
starterPromptsHeading: {
|
|
334
|
+
title: 'Prompts Heading',
|
|
335
|
+
type: 'string',
|
|
336
|
+
description:
|
|
337
|
+
'Heading shown above the starter prompts (e.g. "Try the following questions")',
|
|
338
|
+
},
|
|
339
|
+
enableMatomoTracking: {
|
|
340
|
+
type: 'boolean',
|
|
341
|
+
title: 'Enable Matomo tracking',
|
|
342
|
+
configPath: 'enableMatomoTracking',
|
|
343
|
+
default: true,
|
|
344
|
+
description:
|
|
345
|
+
'Enable tracking of user interactions via Matomo Analytics. When enabled, the chatbot will send events for: ' +
|
|
346
|
+
'starter prompt clicks, user-submitted questions, clicks on related questions, and feedback on answers (positive/negative).',
|
|
347
|
+
},
|
|
348
|
+
showTools: {
|
|
349
|
+
title: 'Show tools',
|
|
350
|
+
type: 'string',
|
|
351
|
+
choices: [
|
|
352
|
+
[PacketType.SEARCH_TOOL_START, 'Search tool'],
|
|
353
|
+
[PacketType.REASONING_START, 'Reasoning tool'],
|
|
354
|
+
],
|
|
355
|
+
isMulti: true,
|
|
356
|
+
},
|
|
357
|
+
placeholderPrompt: {
|
|
358
|
+
default: 'Ask a question',
|
|
359
|
+
title: 'Prompt',
|
|
360
|
+
},
|
|
361
|
+
showAssistantTitle: {
|
|
362
|
+
title: 'Show assistant title',
|
|
363
|
+
type: 'boolean',
|
|
364
|
+
default: true,
|
|
365
|
+
},
|
|
366
|
+
showAssistantDescription: {
|
|
367
|
+
title: 'Show assistant description',
|
|
368
|
+
type: 'boolean',
|
|
369
|
+
default: true,
|
|
370
|
+
},
|
|
371
|
+
showAssistantPrompts: {
|
|
372
|
+
title: 'Show predefined prompts',
|
|
373
|
+
type: 'boolean',
|
|
374
|
+
default: true,
|
|
375
|
+
description: 'Display assistant-provided prompts.',
|
|
376
|
+
},
|
|
377
|
+
chatTitle: {
|
|
378
|
+
title: 'Chat title',
|
|
379
|
+
description: 'Chat are saved with this title. Visible only in Onyx',
|
|
380
|
+
default: 'Online public chat',
|
|
381
|
+
},
|
|
382
|
+
height: {
|
|
383
|
+
title: (
|
|
384
|
+
<a
|
|
385
|
+
target="_blank"
|
|
386
|
+
rel="noreferrer"
|
|
387
|
+
href="https://developer.mozilla.org/en-US/docs/Web/CSS/height"
|
|
388
|
+
>
|
|
389
|
+
Height
|
|
390
|
+
</a>
|
|
391
|
+
),
|
|
392
|
+
description:
|
|
393
|
+
'Chat window height. ' +
|
|
394
|
+
'Use CSS numeric dimension (ex: 500px or 70vh).',
|
|
395
|
+
},
|
|
396
|
+
scrollToInput: {
|
|
397
|
+
title: 'Scroll the page to focus on the chat input',
|
|
398
|
+
type: 'boolean',
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
required: [],
|
|
402
|
+
};
|
|
403
|
+
}
|