@sinequa/assistant 3.8.0 → 3.9.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.
Files changed (151) hide show
  1. package/chat/charts/chart/chart.component.d.ts +13 -13
  2. package/chat/chat-message/chat-message.component.d.ts +85 -81
  3. package/chat/chat-message/i18n/en.json +11 -0
  4. package/chat/chat-message/i18n/fr.json +11 -0
  5. package/chat/chat-reference/chat-reference.component.d.ts +14 -14
  6. package/chat/chat-reference/i18n/en.json +4 -0
  7. package/chat/chat-reference/i18n/fr.json +4 -0
  8. package/chat/chat-settings-v3/chat-settings-v3.component.d.ts +48 -50
  9. package/chat/chat-settings-v3/i18n/en.json +14 -0
  10. package/chat/chat-settings-v3/i18n/fr.json +14 -0
  11. package/chat/chat.component.d.ts +388 -1405
  12. package/chat/chat.service.d.ts +247 -228
  13. package/chat/debug-message/debug-message.component.d.ts +17 -17
  14. package/chat/debug-message/i18n/en.json +3 -0
  15. package/chat/debug-message/i18n/fr.json +3 -0
  16. package/chat/dialogs/delete-saved-chat.component.d.ts +22 -0
  17. package/chat/dialogs/i18n/en.json +19 -0
  18. package/chat/dialogs/i18n/fr.json +19 -0
  19. package/chat/dialogs/rename-saved-chat.component.d.ts +21 -0
  20. package/chat/dialogs/updates.component.d.ts +15 -0
  21. package/chat/documents-upload/document-list/document-list.component.d.ts +68 -77
  22. package/chat/documents-upload/document-overview/document-overview.component.d.ts +31 -41
  23. package/chat/documents-upload/document-upload/document-upload.component.d.ts +96 -98
  24. package/chat/documents-upload/documents-upload.model.d.ts +66 -66
  25. package/chat/documents-upload/documents-upload.service.d.ts +170 -174
  26. package/chat/documents-upload/i18n/en.json +24 -0
  27. package/chat/documents-upload/i18n/fr.json +24 -0
  28. package/chat/format-icon/format-icon.component.d.ts +10 -10
  29. package/chat/format-icon/icons.d.ts +5 -5
  30. package/chat/i18n/en.json +42 -0
  31. package/chat/i18n/fr.json +42 -0
  32. package/chat/index.d.ts +5 -5
  33. package/chat/initials-avatar/initials-avatar.component.d.ts +35 -35
  34. package/chat/instance-manager.service.d.ts +28 -28
  35. package/chat/pipes/message-content.pipe.d.ts +16 -0
  36. package/chat/prompt.component.d.ts +25 -21
  37. package/chat/public-api.d.ts +17 -17
  38. package/chat/references/i18n/en.json +6 -0
  39. package/chat/references/i18n/fr.json +6 -0
  40. package/chat/references/inline-image-reference.d.ts +21 -0
  41. package/chat/references/inline-page-reference.d.ts +21 -0
  42. package/chat/rest-chat.service.d.ts +31 -33
  43. package/chat/saved-chats/i18n/en.json +4 -0
  44. package/chat/saved-chats/i18n/fr.json +4 -0
  45. package/chat/saved-chats/saved-chats.component.d.ts +30 -36
  46. package/chat/services/app.service.d.ts +8 -0
  47. package/chat/services/dialog.service.d.ts +12 -0
  48. package/chat/services/notification.service.d.ts +10 -0
  49. package/chat/services/principal.service.d.ts +7 -0
  50. package/chat/services/search.service.d.ts +7 -0
  51. package/chat/services/signalR.web.service.d.ts +45 -0
  52. package/chat/services/ui.service.d.ts +13 -0
  53. package/chat/services/user-settings.service.d.ts +7 -0
  54. package/chat/token-progress-bar/i18n/en.json +4 -0
  55. package/chat/token-progress-bar/i18n/fr.json +4 -0
  56. package/chat/token-progress-bar/token-progress-bar.component.d.ts +24 -27
  57. package/chat/tooltip/tooltip.component.d.ts +12 -0
  58. package/chat/tooltip/tooltip.directive.d.ts +81 -0
  59. package/chat/types/message-content.types.d.ts +54 -0
  60. package/chat/types/message-reference.types.d.ts +11 -0
  61. package/chat/types.d.ts +913 -873
  62. package/chat/unified-plugins/embedded-image-reference.plugin.d.ts +3 -0
  63. package/chat/unified-plugins/embedded-page-reference.plugin.d.ts +3 -0
  64. package/chat/utils/assistant-json.d.ts +2 -0
  65. package/chat/websocket-chat.service.d.ts +102 -103
  66. package/esm2022/chat/charts/chart/chart.component.mjs +40 -0
  67. package/esm2022/chat/chat-message/chat-message.component.mjs +351 -0
  68. package/esm2022/chat/chat-reference/chat-reference.component.mjs +40 -0
  69. package/esm2022/chat/chat-settings-v3/chat-settings-v3.component.mjs +118 -0
  70. package/esm2022/chat/chat.component.mjs +1090 -0
  71. package/esm2022/chat/chat.service.mjs +417 -0
  72. package/esm2022/chat/debug-message/debug-message.component.mjs +43 -0
  73. package/esm2022/chat/dialogs/delete-saved-chat.component.mjs +81 -0
  74. package/esm2022/chat/dialogs/rename-saved-chat.component.mjs +84 -0
  75. package/esm2022/chat/dialogs/updates.component.mjs +61 -0
  76. package/esm2022/chat/documents-upload/document-list/document-list.component.mjs +140 -0
  77. package/esm2022/chat/documents-upload/document-overview/document-overview.component.mjs +65 -0
  78. package/esm2022/chat/documents-upload/document-upload/document-upload.component.mjs +256 -0
  79. package/{esm2020 → esm2022}/chat/documents-upload/documents-upload.model.mjs +1 -1
  80. package/esm2022/chat/documents-upload/documents-upload.service.mjs +291 -0
  81. package/{esm2020 → esm2022}/chat/format-icon/format-icon.component.mjs +23 -23
  82. package/{esm2020 → esm2022}/chat/format-icon/icons.mjs +137 -137
  83. package/{esm2020 → esm2022}/chat/initials-avatar/initials-avatar.component.mjs +60 -60
  84. package/esm2022/chat/instance-manager.service.mjs +46 -0
  85. package/esm2022/chat/pipes/message-content.pipe.mjs +34 -0
  86. package/esm2022/chat/prompt.component.mjs +88 -0
  87. package/{esm2020 → esm2022}/chat/public-api.mjs +18 -18
  88. package/esm2022/chat/references/inline-image-reference.mjs +110 -0
  89. package/esm2022/chat/references/inline-page-reference.mjs +110 -0
  90. package/esm2022/chat/rest-chat.service.mjs +296 -0
  91. package/esm2022/chat/saved-chats/saved-chats.component.mjs +82 -0
  92. package/esm2022/chat/services/app.service.mjs +19 -0
  93. package/esm2022/chat/services/dialog.service.mjs +40 -0
  94. package/esm2022/chat/services/notification.service.mjs +25 -0
  95. package/esm2022/chat/services/principal.service.mjs +16 -0
  96. package/esm2022/chat/services/search.service.mjs +13 -0
  97. package/esm2022/chat/services/signalR.web.service.mjs +79 -0
  98. package/esm2022/chat/services/ui.service.mjs +61 -0
  99. package/esm2022/chat/services/user-settings.service.mjs +22 -0
  100. package/{esm2020 → esm2022}/chat/sinequa-assistant-chat.mjs +4 -4
  101. package/esm2022/chat/token-progress-bar/token-progress-bar.component.mjs +52 -0
  102. package/esm2022/chat/tooltip/tooltip.component.mjs +44 -0
  103. package/esm2022/chat/tooltip/tooltip.directive.mjs +203 -0
  104. package/esm2022/chat/types/message-content.types.mjs +2 -0
  105. package/esm2022/chat/types/message-reference.types.mjs +2 -0
  106. package/esm2022/chat/types.mjs +130 -0
  107. package/esm2022/chat/unified-plugins/embedded-image-reference.plugin.mjs +57 -0
  108. package/esm2022/chat/unified-plugins/embedded-page-reference.plugin.mjs +57 -0
  109. package/esm2022/chat/utils/assistant-json.mjs +12 -0
  110. package/esm2022/chat/websocket-chat.service.mjs +654 -0
  111. package/{esm2020 → esm2022}/public-api.mjs +2 -2
  112. package/{esm2020 → esm2022}/sinequa-assistant.mjs +4 -4
  113. package/fesm2022/sinequa-assistant-chat.mjs +5340 -0
  114. package/fesm2022/sinequa-assistant-chat.mjs.map +1 -0
  115. package/{fesm2015 → fesm2022}/sinequa-assistant.mjs +3 -3
  116. package/index.d.ts +5 -5
  117. package/package.json +52 -25
  118. package/public-api.d.ts +1 -1
  119. package/chat/messages/de.d.ts +0 -4
  120. package/chat/messages/en.d.ts +0 -4
  121. package/chat/messages/fr.d.ts +0 -4
  122. package/chat/messages/index.d.ts +0 -4
  123. package/esm2020/chat/charts/chart/chart.component.mjs +0 -40
  124. package/esm2020/chat/chat-message/chat-message.component.mjs +0 -263
  125. package/esm2020/chat/chat-reference/chat-reference.component.mjs +0 -40
  126. package/esm2020/chat/chat-settings-v3/chat-settings-v3.component.mjs +0 -117
  127. package/esm2020/chat/chat.component.mjs +0 -1069
  128. package/esm2020/chat/chat.service.mjs +0 -333
  129. package/esm2020/chat/debug-message/debug-message.component.mjs +0 -43
  130. package/esm2020/chat/documents-upload/document-list/document-list.component.mjs +0 -191
  131. package/esm2020/chat/documents-upload/document-overview/document-overview.component.mjs +0 -80
  132. package/esm2020/chat/documents-upload/document-upload/document-upload.component.mjs +0 -258
  133. package/esm2020/chat/documents-upload/documents-upload.service.mjs +0 -289
  134. package/esm2020/chat/instance-manager.service.mjs +0 -46
  135. package/esm2020/chat/messages/de.mjs +0 -4
  136. package/esm2020/chat/messages/en.mjs +0 -4
  137. package/esm2020/chat/messages/fr.mjs +0 -4
  138. package/esm2020/chat/messages/index.mjs +0 -9
  139. package/esm2020/chat/prompt.component.mjs +0 -88
  140. package/esm2020/chat/rest-chat.service.mjs +0 -241
  141. package/esm2020/chat/saved-chats/saved-chats.component.mjs +0 -175
  142. package/esm2020/chat/token-progress-bar/token-progress-bar.component.mjs +0 -54
  143. package/esm2020/chat/types.mjs +0 -112
  144. package/esm2020/chat/websocket-chat.service.mjs +0 -641
  145. package/fesm2015/sinequa-assistant-chat.mjs +0 -4200
  146. package/fesm2015/sinequa-assistant-chat.mjs.map +0 -1
  147. package/fesm2020/sinequa-assistant-chat.mjs +0 -4171
  148. package/fesm2020/sinequa-assistant-chat.mjs.map +0 -1
  149. package/fesm2020/sinequa-assistant.mjs +0 -9
  150. package/fesm2020/sinequa-assistant.mjs.map +0 -1
  151. /package/{fesm2015 → fesm2022}/sinequa-assistant.mjs.map +0 -0
@@ -1,1405 +1,388 @@
1
- import { ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from "@angular/core";
2
- import { HubConnection } from "@microsoft/signalr";
3
- import { BehaviorSubject } from "rxjs";
4
- import { Action } from "@sinequa/components/action";
5
- import { AbstractFacet } from "@sinequa/components/facet";
6
- import { SearchService } from "@sinequa/components/search";
7
- import { AppService, Query } from "@sinequa/core/app-utils";
8
- import { LoginService } from "@sinequa/core/login";
9
- import { NotificationsService } from "@sinequa/core/notification";
10
- import { PrincipalWebService } from "@sinequa/core/web-services";
11
- import { ChatService } from "./chat.service";
12
- import { InstanceManagerService } from "./instance-manager.service";
13
- import { RestChatService } from "./rest-chat.service";
14
- import { ChatConfig, ChatContextAttachment, ChatMessage, DebugMessage, GllmModelDescription, InitChat, MessageHandler, RawMessage, SuggestedAction } from "./types";
15
- import { WebSocketChatService } from "./websocket-chat.service";
16
- import * as i0 from "@angular/core";
17
- export declare class ChatComponent extends AbstractFacet implements OnInit, OnChanges, OnDestroy {
18
- loginService: LoginService;
19
- websocketService: WebSocketChatService;
20
- restService: RestChatService;
21
- instanceManagerService: InstanceManagerService;
22
- searchService: SearchService<{
23
- sort: string;
24
- id: string;
25
- columnCount: number;
26
- attributes: {
27
- processingtime: string;
28
- rowfetchtime: string;
29
- cachehit: string;
30
- matchingrowcount: string;
31
- queryid?: string | undefined;
32
- searchid?: string | undefined;
33
- internalqueryanalysis?: string | undefined;
34
- internalquerylog?: string | undefined;
35
- };
36
- tabs: {
37
- name: string;
38
- display: string;
39
- value: string;
40
- count: number;
41
- }[];
42
- pageSize: number;
43
- aggregations: ({
44
- name: string;
45
- items: ({
46
- value: string | number | boolean | null;
47
- count: number;
48
- display?: string | undefined;
49
- score?: number | undefined;
50
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
51
- $selected?: boolean | undefined;
52
- $excluded?: boolean | undefined;
53
- $filtered?: boolean | undefined;
54
- $column?: {
55
- type: string;
56
- name: string;
57
- eType: import("@sinequa/core/web-services").EngineType;
58
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
59
- description?: string | undefined;
60
- label?: string | undefined;
61
- labelPlural?: string | undefined;
62
- formatter?: string | undefined;
63
- transforms?: string | undefined;
64
- parser?: string | undefined;
65
- aliases?: string[] | undefined;
66
- typeModifier?: string | undefined;
67
- } | undefined;
68
- } | ({
69
- value: string;
70
- count: number;
71
- display?: string | undefined;
72
- score?: number | undefined;
73
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
74
- $selected?: boolean | undefined;
75
- $excluded?: boolean | undefined;
76
- $filtered?: boolean | undefined;
77
- $column?: {
78
- type: string;
79
- name: string;
80
- eType: import("@sinequa/core/web-services").EngineType;
81
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
82
- description?: string | undefined;
83
- label?: string | undefined;
84
- labelPlural?: string | undefined;
85
- formatter?: string | undefined;
86
- transforms?: string | undefined;
87
- parser?: string | undefined;
88
- aliases?: string[] | undefined;
89
- typeModifier?: string | undefined;
90
- } | undefined;
91
- hasChildren?: boolean | undefined;
92
- $path?: string | undefined;
93
- $opened?: boolean | undefined;
94
- $opening?: boolean | undefined;
95
- $level?: number | undefined;
96
- } & {
97
- items: any[];
98
- }))[];
99
- column: string;
100
- $filtered: {
101
- value: string | number | boolean | null;
102
- count: number;
103
- display?: string | undefined;
104
- score?: number | undefined;
105
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
106
- $selected?: boolean | undefined;
107
- $excluded?: boolean | undefined;
108
- $filtered?: boolean | undefined;
109
- $column?: {
110
- type: string;
111
- name: string;
112
- eType: import("@sinequa/core/web-services").EngineType;
113
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
114
- description?: string | undefined;
115
- label?: string | undefined;
116
- labelPlural?: string | undefined;
117
- formatter?: string | undefined;
118
- transforms?: string | undefined;
119
- parser?: string | undefined;
120
- aliases?: string[] | undefined;
121
- typeModifier?: string | undefined;
122
- } | undefined;
123
- }[];
124
- $cccount: number;
125
- $remainingFiltered: {
126
- value: string | number | boolean | null;
127
- count: number;
128
- display?: string | undefined;
129
- score?: number | undefined;
130
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
131
- $selected?: boolean | undefined;
132
- $excluded?: boolean | undefined;
133
- $filtered?: boolean | undefined;
134
- $column?: {
135
- type: string;
136
- name: string;
137
- eType: import("@sinequa/core/web-services").EngineType;
138
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
139
- description?: string | undefined;
140
- label?: string | undefined;
141
- labelPlural?: string | undefined;
142
- formatter?: string | undefined;
143
- transforms?: string | undefined;
144
- parser?: string | undefined;
145
- aliases?: string[] | undefined;
146
- typeModifier?: string | undefined;
147
- } | undefined;
148
- }[];
149
- isDistribution?: boolean | undefined;
150
- isTree?: boolean | undefined;
151
- valuesAreExpressions?: boolean | undefined;
152
- $ccaggregation?: {
153
- name: string;
154
- mask: string;
155
- order: string;
156
- column: string;
157
- includeInStandardSearch: boolean;
158
- count: number;
159
- distribution: string;
160
- tabBehavior: "" | "Default" | "LoadForSelectedTab" | "LoadForAllTabs";
161
- keySeparator: string;
162
- displayKeySeparator: string;
163
- } | undefined;
164
- $cccolumn?: {
165
- type: string;
166
- name: string;
167
- eType: import("@sinequa/core/web-services").EngineType;
168
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
169
- description?: string | undefined;
170
- label?: string | undefined;
171
- labelPlural?: string | undefined;
172
- formatter?: string | undefined;
173
- transforms?: string | undefined;
174
- parser?: string | undefined;
175
- aliases?: string[] | undefined;
176
- typeModifier?: string | undefined;
177
- } | undefined;
178
- $hasMore?: boolean | undefined;
179
- } | {
180
- name: string;
181
- items: ({
182
- value: string;
183
- count: number;
184
- display?: string | undefined;
185
- score?: number | undefined;
186
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
187
- $selected?: boolean | undefined;
188
- $excluded?: boolean | undefined;
189
- $filtered?: boolean | undefined;
190
- $column?: {
191
- type: string;
192
- name: string;
193
- eType: import("@sinequa/core/web-services").EngineType;
194
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
195
- description?: string | undefined;
196
- label?: string | undefined;
197
- labelPlural?: string | undefined;
198
- formatter?: string | undefined;
199
- transforms?: string | undefined;
200
- parser?: string | undefined;
201
- aliases?: string[] | undefined;
202
- typeModifier?: string | undefined;
203
- } | undefined;
204
- hasChildren?: boolean | undefined;
205
- $path?: string | undefined;
206
- $opened?: boolean | undefined;
207
- $opening?: boolean | undefined;
208
- $level?: number | undefined;
209
- } & {
210
- items: any[];
211
- })[];
212
- column: string;
213
- $filtered: ({
214
- value: string;
215
- count: number;
216
- display?: string | undefined;
217
- score?: number | undefined;
218
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
219
- $selected?: boolean | undefined;
220
- $excluded?: boolean | undefined;
221
- $filtered?: boolean | undefined;
222
- $column?: {
223
- type: string;
224
- name: string;
225
- eType: import("@sinequa/core/web-services").EngineType;
226
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
227
- description?: string | undefined;
228
- label?: string | undefined;
229
- labelPlural?: string | undefined;
230
- formatter?: string | undefined;
231
- transforms?: string | undefined;
232
- parser?: string | undefined;
233
- aliases?: string[] | undefined;
234
- typeModifier?: string | undefined;
235
- } | undefined;
236
- hasChildren?: boolean | undefined;
237
- $path?: string | undefined;
238
- $opened?: boolean | undefined;
239
- $opening?: boolean | undefined;
240
- $level?: number | undefined;
241
- } & {
242
- items: any[];
243
- })[];
244
- $cccount: number;
245
- $remainingFiltered: {
246
- value: string | number | boolean | null;
247
- count: number;
248
- display?: string | undefined;
249
- score?: number | undefined;
250
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
251
- $selected?: boolean | undefined;
252
- $excluded?: boolean | undefined;
253
- $filtered?: boolean | undefined;
254
- $column?: {
255
- type: string;
256
- name: string;
257
- eType: import("@sinequa/core/web-services").EngineType;
258
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
259
- description?: string | undefined;
260
- label?: string | undefined;
261
- labelPlural?: string | undefined;
262
- formatter?: string | undefined;
263
- transforms?: string | undefined;
264
- parser?: string | undefined;
265
- aliases?: string[] | undefined;
266
- typeModifier?: string | undefined;
267
- } | undefined;
268
- }[];
269
- isDistribution?: boolean | undefined;
270
- isTree?: boolean | undefined;
271
- valuesAreExpressions?: boolean | undefined;
272
- $ccaggregation?: {
273
- name: string;
274
- mask: string;
275
- order: string;
276
- column: string;
277
- includeInStandardSearch: boolean;
278
- count: number;
279
- distribution: string;
280
- tabBehavior: "" | "Default" | "LoadForSelectedTab" | "LoadForAllTabs";
281
- keySeparator: string;
282
- displayKeySeparator: string;
283
- } | undefined;
284
- $cccolumn?: {
285
- type: string;
286
- name: string;
287
- eType: import("@sinequa/core/web-services").EngineType;
288
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
289
- description?: string | undefined;
290
- label?: string | undefined;
291
- labelPlural?: string | undefined;
292
- formatter?: string | undefined;
293
- transforms?: string | undefined;
294
- parser?: string | undefined;
295
- aliases?: string[] | undefined;
296
- typeModifier?: string | undefined;
297
- } | undefined;
298
- $hasMore?: boolean | undefined;
299
- hasChildren?: boolean | undefined;
300
- })[];
301
- page: number;
302
- rowCount: number;
303
- totalRowCount: number;
304
- cursorRowCount: number;
305
- tab: string;
306
- queryIntents: import("@sinequa/core/web-services").QueryIntent[];
307
- records: {
308
- filename: string;
309
- id: string;
310
- title: string;
311
- text: string;
312
- size: number;
313
- $selected: boolean;
314
- matchlocations: string[];
315
- rank: number;
316
- databasealias: string;
317
- matchingpartnames: string[];
318
- matchlocationsperpartname: {
319
- matchlocations: {
320
- data: string;
321
- partname: string;
322
- }[];
323
- }[];
324
- documentlanguages: string[];
325
- documentweight: string;
326
- modified: string;
327
- indexationtime: string;
328
- version: string;
329
- treepath: string[];
330
- fileext: string;
331
- flags: string[];
332
- collection: string[];
333
- docformat: string;
334
- url1: string;
335
- authors: string[];
336
- rfmEnabled: boolean;
337
- termspresence: {
338
- term: string;
339
- presence: "found" | "missing";
340
- }[];
341
- $isDuplicate: boolean;
342
- $duplicateCount: number;
343
- globalrelevance?: number | undefined;
344
- displayTitle?: string | undefined;
345
- doctype?: string | undefined;
346
- url2?: string | undefined;
347
- relevantExtracts?: string | undefined;
348
- extracts?: {
349
- score: number;
350
- highlighted: string;
351
- locations: string;
352
- originalLocations: string;
353
- partname?: string | undefined;
354
- }[] | undefined;
355
- accesslists?: {
356
- accessListIndices: number[];
357
- authorizedLists: {
358
- id: string;
359
- domain: string;
360
- }[];
361
- deniedLists: {
362
- id: string;
363
- domain: string;
364
- }[];
365
- } | undefined;
366
- thumbnailUrl?: string | undefined;
367
- originalUrl?: string | undefined;
368
- pdfUrl?: string | undefined;
369
- rfm?: {
370
- click?: {
371
- image: import("@sinequa/core/web-services").RFMDisplay;
372
- status: import("@sinequa/core/web-services").RFMDisplay;
373
- eventCount: number;
374
- average: number;
375
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
376
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
377
- } | undefined;
378
- like?: {
379
- image: import("@sinequa/core/web-services").RFMDisplay;
380
- status: import("@sinequa/core/web-services").RFMDisplay;
381
- eventCount: number;
382
- average: number;
383
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
384
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
385
- } | undefined;
386
- important?: {
387
- image: import("@sinequa/core/web-services").RFMDisplay;
388
- status: import("@sinequa/core/web-services").RFMDisplay;
389
- eventCount: number;
390
- average: number;
391
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
392
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
393
- } | undefined;
394
- } | undefined;
395
- groupcount?: number | undefined;
396
- nearhash?: string | undefined;
397
- exacthash?: string | undefined;
398
- containerid?: string | undefined;
399
- $page?: number | undefined;
400
- matchingpassages?: {
401
- passages: {
402
- location: number[];
403
- id: number;
404
- score: number;
405
- rlocation: number[];
406
- highlightedText: string;
407
- $expanded?: boolean | undefined;
408
- }[];
409
- } | undefined;
410
- $hasPassages?: boolean | undefined;
411
- }[];
412
- queryName: string;
413
- hasRelevance: boolean;
414
- attributeCount?: number | undefined;
415
- scope?: string | undefined;
416
- didYouMean?: {
417
- text: {
418
- original: string;
419
- corrected: string;
420
- };
421
- spellingCorrectionMode: "default" | "classic" | "false" | "smart" | "correct" | "dymonly" | "force";
422
- } | undefined;
423
- queryAnalysis?: {
424
- text: string;
425
- elements: import("@sinequa/core/web-services").QueryAnalysisElement[];
426
- initial: boolean;
427
- queryLanguage?: string | undefined;
428
- } | undefined;
429
- rfmQueryHash?: string | undefined;
430
- statements?: string[] | undefined;
431
- answers?: {
432
- answers: {
433
- text: string;
434
- score: number;
435
- passage: {
436
- location: number[];
437
- id: number;
438
- rlocation: number[];
439
- highlightedText: string;
440
- };
441
- recordId: string;
442
- "af.score": number;
443
- "rm.score": number;
444
- $record?: {
445
- filename: string;
446
- id: string;
447
- title: string;
448
- text: string;
449
- size: number;
450
- $selected: boolean;
451
- matchlocations: string[];
452
- rank: number;
453
- databasealias: string;
454
- matchingpartnames: string[];
455
- matchlocationsperpartname: {
456
- matchlocations: {
457
- data: string;
458
- partname: string;
459
- }[];
460
- }[];
461
- documentlanguages: string[];
462
- documentweight: string;
463
- modified: string;
464
- indexationtime: string;
465
- version: string;
466
- treepath: string[];
467
- fileext: string;
468
- flags: string[];
469
- collection: string[];
470
- docformat: string;
471
- url1: string;
472
- authors: string[];
473
- rfmEnabled: boolean;
474
- termspresence: {
475
- term: string;
476
- presence: "found" | "missing";
477
- }[];
478
- $isDuplicate: boolean;
479
- $duplicateCount: number;
480
- globalrelevance?: number | undefined;
481
- displayTitle?: string | undefined;
482
- doctype?: string | undefined;
483
- url2?: string | undefined;
484
- relevantExtracts?: string | undefined;
485
- extracts?: {
486
- score: number;
487
- highlighted: string;
488
- locations: string;
489
- originalLocations: string;
490
- partname?: string | undefined;
491
- }[] | undefined;
492
- accesslists?: {
493
- accessListIndices: number[];
494
- authorizedLists: {
495
- id: string;
496
- domain: string;
497
- }[];
498
- deniedLists: {
499
- id: string;
500
- domain: string;
501
- }[];
502
- } | undefined;
503
- thumbnailUrl?: string | undefined;
504
- originalUrl?: string | undefined;
505
- pdfUrl?: string | undefined;
506
- rfm?: {
507
- click?: {
508
- image: import("@sinequa/core/web-services").RFMDisplay;
509
- status: import("@sinequa/core/web-services").RFMDisplay;
510
- eventCount: number;
511
- average: number;
512
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
513
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
514
- } | undefined;
515
- like?: {
516
- image: import("@sinequa/core/web-services").RFMDisplay;
517
- status: import("@sinequa/core/web-services").RFMDisplay;
518
- eventCount: number;
519
- average: number;
520
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
521
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
522
- } | undefined;
523
- important?: {
524
- image: import("@sinequa/core/web-services").RFMDisplay;
525
- status: import("@sinequa/core/web-services").RFMDisplay;
526
- eventCount: number;
527
- average: number;
528
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
529
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
530
- } | undefined;
531
- } | undefined;
532
- groupcount?: number | undefined;
533
- nearhash?: string | undefined;
534
- exacthash?: string | undefined;
535
- containerid?: string | undefined;
536
- $page?: number | undefined;
537
- matchingpassages?: {
538
- passages: {
539
- location: number[];
540
- id: number;
541
- score: number;
542
- rlocation: number[];
543
- highlightedText: string;
544
- $expanded?: boolean | undefined;
545
- }[];
546
- } | undefined;
547
- $hasPassages?: boolean | undefined;
548
- } | undefined;
549
- $liked?: boolean | undefined;
550
- }[];
551
- } | null | undefined;
552
- topPassages?: {
553
- passages?: {
554
- index: string;
555
- location: [number, number];
556
- id: number;
557
- text: string;
558
- score: number;
559
- recordId: string;
560
- answer?: string | undefined;
561
- answerScore?: number | undefined;
562
- $record?: {
563
- filename: string;
564
- id: string;
565
- title: string;
566
- text: string;
567
- size: number;
568
- $selected: boolean;
569
- matchlocations: string[];
570
- rank: number;
571
- databasealias: string;
572
- matchingpartnames: string[];
573
- matchlocationsperpartname: {
574
- matchlocations: {
575
- data: string;
576
- partname: string;
577
- }[];
578
- }[];
579
- documentlanguages: string[];
580
- documentweight: string;
581
- modified: string;
582
- indexationtime: string;
583
- version: string;
584
- treepath: string[];
585
- fileext: string;
586
- flags: string[];
587
- collection: string[];
588
- docformat: string;
589
- url1: string;
590
- authors: string[];
591
- rfmEnabled: boolean;
592
- termspresence: {
593
- term: string;
594
- presence: "found" | "missing";
595
- }[];
596
- $isDuplicate: boolean;
597
- $duplicateCount: number;
598
- globalrelevance?: number | undefined;
599
- displayTitle?: string | undefined;
600
- doctype?: string | undefined;
601
- url2?: string | undefined;
602
- relevantExtracts?: string | undefined;
603
- extracts?: {
604
- score: number;
605
- highlighted: string;
606
- locations: string;
607
- originalLocations: string;
608
- partname?: string | undefined;
609
- }[] | undefined;
610
- accesslists?: {
611
- accessListIndices: number[];
612
- authorizedLists: {
613
- id: string;
614
- domain: string;
615
- }[];
616
- deniedLists: {
617
- id: string;
618
- domain: string;
619
- }[];
620
- } | undefined;
621
- thumbnailUrl?: string | undefined;
622
- originalUrl?: string | undefined;
623
- pdfUrl?: string | undefined;
624
- rfm?: {
625
- click?: {
626
- image: import("@sinequa/core/web-services").RFMDisplay;
627
- status: import("@sinequa/core/web-services").RFMDisplay;
628
- eventCount: number;
629
- average: number;
630
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
631
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
632
- } | undefined;
633
- like?: {
634
- image: import("@sinequa/core/web-services").RFMDisplay;
635
- status: import("@sinequa/core/web-services").RFMDisplay;
636
- eventCount: number;
637
- average: number;
638
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
639
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
640
- } | undefined;
641
- important?: {
642
- image: import("@sinequa/core/web-services").RFMDisplay;
643
- status: import("@sinequa/core/web-services").RFMDisplay;
644
- eventCount: number;
645
- average: number;
646
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
647
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
648
- } | undefined;
649
- } | undefined;
650
- groupcount?: number | undefined;
651
- nearhash?: string | undefined;
652
- exacthash?: string | undefined;
653
- containerid?: string | undefined;
654
- $page?: number | undefined;
655
- matchingpassages?: {
656
- passages: {
657
- location: number[];
658
- id: number;
659
- score: number;
660
- rlocation: number[];
661
- highlightedText: string;
662
- $expanded?: boolean | undefined;
663
- }[];
664
- } | undefined;
665
- $hasPassages?: boolean | undefined;
666
- } | undefined;
667
- }[] | undefined;
668
- } | null | undefined;
669
- } & {
670
- $aggregationMap: Record<string, {
671
- name: string;
672
- items: ({
673
- value: string | number | boolean | null;
674
- count: number;
675
- display?: string | undefined;
676
- score?: number | undefined;
677
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
678
- $selected?: boolean | undefined;
679
- $excluded?: boolean | undefined;
680
- $filtered?: boolean | undefined;
681
- $column?: {
682
- type: string;
683
- name: string;
684
- eType: import("@sinequa/core/web-services").EngineType;
685
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
686
- description?: string | undefined;
687
- label?: string | undefined;
688
- labelPlural?: string | undefined;
689
- formatter?: string | undefined;
690
- transforms?: string | undefined;
691
- parser?: string | undefined;
692
- aliases?: string[] | undefined;
693
- typeModifier?: string | undefined;
694
- } | undefined;
695
- } | ({
696
- value: string;
697
- count: number;
698
- display?: string | undefined;
699
- score?: number | undefined;
700
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
701
- $selected?: boolean | undefined;
702
- $excluded?: boolean | undefined;
703
- $filtered?: boolean | undefined;
704
- $column?: {
705
- type: string;
706
- name: string;
707
- eType: import("@sinequa/core/web-services").EngineType;
708
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
709
- description?: string | undefined;
710
- label?: string | undefined;
711
- labelPlural?: string | undefined;
712
- formatter?: string | undefined;
713
- transforms?: string | undefined;
714
- parser?: string | undefined;
715
- aliases?: string[] | undefined;
716
- typeModifier?: string | undefined;
717
- } | undefined;
718
- hasChildren?: boolean | undefined;
719
- $path?: string | undefined;
720
- $opened?: boolean | undefined;
721
- $opening?: boolean | undefined;
722
- $level?: number | undefined;
723
- } & {
724
- items: any[];
725
- }))[];
726
- column: string;
727
- $filtered: {
728
- value: string | number | boolean | null;
729
- count: number;
730
- display?: string | undefined;
731
- score?: number | undefined;
732
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
733
- $selected?: boolean | undefined;
734
- $excluded?: boolean | undefined;
735
- $filtered?: boolean | undefined;
736
- $column?: {
737
- type: string;
738
- name: string;
739
- eType: import("@sinequa/core/web-services").EngineType;
740
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
741
- description?: string | undefined;
742
- label?: string | undefined;
743
- labelPlural?: string | undefined;
744
- formatter?: string | undefined;
745
- transforms?: string | undefined;
746
- parser?: string | undefined;
747
- aliases?: string[] | undefined;
748
- typeModifier?: string | undefined;
749
- } | undefined;
750
- }[];
751
- $cccount: number;
752
- $remainingFiltered: {
753
- value: string | number | boolean | null;
754
- count: number;
755
- display?: string | undefined;
756
- score?: number | undefined;
757
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
758
- $selected?: boolean | undefined;
759
- $excluded?: boolean | undefined;
760
- $filtered?: boolean | undefined;
761
- $column?: {
762
- type: string;
763
- name: string;
764
- eType: import("@sinequa/core/web-services").EngineType;
765
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
766
- description?: string | undefined;
767
- label?: string | undefined;
768
- labelPlural?: string | undefined;
769
- formatter?: string | undefined;
770
- transforms?: string | undefined;
771
- parser?: string | undefined;
772
- aliases?: string[] | undefined;
773
- typeModifier?: string | undefined;
774
- } | undefined;
775
- }[];
776
- isDistribution?: boolean | undefined;
777
- isTree?: boolean | undefined;
778
- valuesAreExpressions?: boolean | undefined;
779
- $ccaggregation?: {
780
- name: string;
781
- mask: string;
782
- order: string;
783
- column: string;
784
- includeInStandardSearch: boolean;
785
- count: number;
786
- distribution: string;
787
- tabBehavior: "" | "Default" | "LoadForSelectedTab" | "LoadForAllTabs";
788
- keySeparator: string;
789
- displayKeySeparator: string;
790
- } | undefined;
791
- $cccolumn?: {
792
- type: string;
793
- name: string;
794
- eType: import("@sinequa/core/web-services").EngineType;
795
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
796
- description?: string | undefined;
797
- label?: string | undefined;
798
- labelPlural?: string | undefined;
799
- formatter?: string | undefined;
800
- transforms?: string | undefined;
801
- parser?: string | undefined;
802
- aliases?: string[] | undefined;
803
- typeModifier?: string | undefined;
804
- } | undefined;
805
- $hasMore?: boolean | undefined;
806
- } | {
807
- name: string;
808
- items: ({
809
- value: string;
810
- count: number;
811
- display?: string | undefined;
812
- score?: number | undefined;
813
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
814
- $selected?: boolean | undefined;
815
- $excluded?: boolean | undefined;
816
- $filtered?: boolean | undefined;
817
- $column?: {
818
- type: string;
819
- name: string;
820
- eType: import("@sinequa/core/web-services").EngineType;
821
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
822
- description?: string | undefined;
823
- label?: string | undefined;
824
- labelPlural?: string | undefined;
825
- formatter?: string | undefined;
826
- transforms?: string | undefined;
827
- parser?: string | undefined;
828
- aliases?: string[] | undefined;
829
- typeModifier?: string | undefined;
830
- } | undefined;
831
- hasChildren?: boolean | undefined;
832
- $path?: string | undefined;
833
- $opened?: boolean | undefined;
834
- $opening?: boolean | undefined;
835
- $level?: number | undefined;
836
- } & {
837
- items: any[];
838
- })[];
839
- column: string;
840
- $filtered: ({
841
- value: string;
842
- count: number;
843
- display?: string | undefined;
844
- score?: number | undefined;
845
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
846
- $selected?: boolean | undefined;
847
- $excluded?: boolean | undefined;
848
- $filtered?: boolean | undefined;
849
- $column?: {
850
- type: string;
851
- name: string;
852
- eType: import("@sinequa/core/web-services").EngineType;
853
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
854
- description?: string | undefined;
855
- label?: string | undefined;
856
- labelPlural?: string | undefined;
857
- formatter?: string | undefined;
858
- transforms?: string | undefined;
859
- parser?: string | undefined;
860
- aliases?: string[] | undefined;
861
- typeModifier?: string | undefined;
862
- } | undefined;
863
- hasChildren?: boolean | undefined;
864
- $path?: string | undefined;
865
- $opened?: boolean | undefined;
866
- $opening?: boolean | undefined;
867
- $level?: number | undefined;
868
- } & {
869
- items: any[];
870
- })[];
871
- $cccount: number;
872
- $remainingFiltered: {
873
- value: string | number | boolean | null;
874
- count: number;
875
- display?: string | undefined;
876
- score?: number | undefined;
877
- operatorResults?: Partial<Record<"max" | "min" | "sum" | "avg" | "stddev" | "variance", number | Date>> | undefined;
878
- $selected?: boolean | undefined;
879
- $excluded?: boolean | undefined;
880
- $filtered?: boolean | undefined;
881
- $column?: {
882
- type: string;
883
- name: string;
884
- eType: import("@sinequa/core/web-services").EngineType;
885
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
886
- description?: string | undefined;
887
- label?: string | undefined;
888
- labelPlural?: string | undefined;
889
- formatter?: string | undefined;
890
- transforms?: string | undefined;
891
- parser?: string | undefined;
892
- aliases?: string[] | undefined;
893
- typeModifier?: string | undefined;
894
- } | undefined;
895
- }[];
896
- isDistribution?: boolean | undefined;
897
- isTree?: boolean | undefined;
898
- valuesAreExpressions?: boolean | undefined;
899
- $ccaggregation?: {
900
- name: string;
901
- mask: string;
902
- order: string;
903
- column: string;
904
- includeInStandardSearch: boolean;
905
- count: number;
906
- distribution: string;
907
- tabBehavior: "" | "Default" | "LoadForSelectedTab" | "LoadForAllTabs";
908
- keySeparator: string;
909
- displayKeySeparator: string;
910
- } | undefined;
911
- $cccolumn?: {
912
- type: string;
913
- name: string;
914
- eType: import("@sinequa/core/web-services").EngineType;
915
- eTypeModifier: import("@sinequa/core/web-services").EngineTypeModifier;
916
- description?: string | undefined;
917
- label?: string | undefined;
918
- labelPlural?: string | undefined;
919
- formatter?: string | undefined;
920
- transforms?: string | undefined;
921
- parser?: string | undefined;
922
- aliases?: string[] | undefined;
923
- typeModifier?: string | undefined;
924
- } | undefined;
925
- $hasMore?: boolean | undefined;
926
- hasChildren?: boolean | undefined;
927
- }>;
928
- }>;
929
- principalService: PrincipalWebService;
930
- cdr: ChangeDetectorRef;
931
- appService: AppService;
932
- notificationsService: NotificationsService;
933
- /** Define the key based on it, the chat service instance will be stored */
934
- instanceId: string;
935
- /** Define the query to use to fetch answers */
936
- query: Query;
937
- /** Function that determines whether the chat should be reloaded after the query changes
938
- * If not provided, the chat will be reloaded by default
939
- * @param prevQuery The previous query
940
- * @param newQuery The new query
941
- * @returns true if the chat should be reloaded, false otherwise
942
- */
943
- queryChangeShouldTriggerReload: (prevQuery: Query, newQuery: Query) => boolean;
944
- /** Define the protocol to be used for this chat instance*/
945
- protocol: 'REST' | 'WEBSOCKET';
946
- /** Map of listeners overriding default registered ones*/
947
- messageHandlers: Map<string, MessageHandler<any>>;
948
- /** When the assistant answer a user question, automatically scroll down to the bottom of the discussion */
949
- automaticScrollToLastResponse: boolean;
950
- /** When the assistant answer a user question, automatically focus to the chat input */
951
- focusAfterResponse: boolean;
952
- /** A chat discussion that the component should get initialized with it */
953
- chat?: InitChat;
954
- /** Icon to use for the assistant messages */
955
- assistantMessageIcon: string;
956
- /** Icon to use for the user messages */
957
- userMessageIcon: string;
958
- /** Icon to use for the connection error messages */
959
- connectionErrorMessageIcon: string;
960
- /** Icon to use for the search warning messages */
961
- searchWarningMessageIcon: string;
962
- /** Event emitter triggered once the signalR connection is established */
963
- connection: EventEmitter<HubConnection>;
964
- /** Event emitter triggered each time the assistant updates the current chat */
965
- /** Event emitter triggered when the chat is loading new content */
966
- loading$: EventEmitter<boolean>;
967
- /** Emits the assistant configuration used when instantiating the component */
968
- _config: EventEmitter<ChatConfig>;
969
- data: EventEmitter<ChatMessage[]>;
970
- /** Event emitter triggered when the user clicks to open the original document representing the context attachment*/
971
- openDocument: EventEmitter<{
972
- filename: string;
973
- id: string;
974
- title: string;
975
- text: string;
976
- size: number;
977
- $selected: boolean;
978
- matchlocations: string[];
979
- rank: number;
980
- databasealias: string;
981
- matchingpartnames: string[];
982
- matchlocationsperpartname: {
983
- matchlocations: {
984
- data: string;
985
- partname: string;
986
- }[];
987
- }[];
988
- documentlanguages: string[];
989
- documentweight: string;
990
- modified: string;
991
- indexationtime: string;
992
- version: string;
993
- treepath: string[];
994
- fileext: string;
995
- flags: string[];
996
- collection: string[];
997
- docformat: string;
998
- url1: string;
999
- authors: string[];
1000
- rfmEnabled: boolean;
1001
- termspresence: {
1002
- term: string;
1003
- presence: "found" | "missing";
1004
- }[];
1005
- $isDuplicate: boolean;
1006
- $duplicateCount: number;
1007
- globalrelevance?: number | undefined;
1008
- displayTitle?: string | undefined;
1009
- doctype?: string | undefined;
1010
- url2?: string | undefined;
1011
- relevantExtracts?: string | undefined;
1012
- extracts?: {
1013
- score: number;
1014
- highlighted: string;
1015
- locations: string;
1016
- originalLocations: string;
1017
- partname?: string | undefined;
1018
- }[] | undefined;
1019
- accesslists?: {
1020
- accessListIndices: number[];
1021
- authorizedLists: {
1022
- id: string;
1023
- domain: string;
1024
- }[];
1025
- deniedLists: {
1026
- id: string;
1027
- domain: string;
1028
- }[];
1029
- } | undefined;
1030
- thumbnailUrl?: string | undefined;
1031
- originalUrl?: string | undefined;
1032
- pdfUrl?: string | undefined;
1033
- rfm?: {
1034
- click?: {
1035
- image: import("@sinequa/core/web-services").RFMDisplay;
1036
- status: import("@sinequa/core/web-services").RFMDisplay;
1037
- eventCount: number;
1038
- average: number;
1039
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
1040
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
1041
- } | undefined;
1042
- like?: {
1043
- image: import("@sinequa/core/web-services").RFMDisplay;
1044
- status: import("@sinequa/core/web-services").RFMDisplay;
1045
- eventCount: number;
1046
- average: number;
1047
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
1048
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
1049
- } | undefined; /**
1050
- * To remove the handler for onreconnected() after it's been registered,cannot directly use off() like you would for normal events registered with connection.on().
1051
- * Instead, you need to explicitly remove or reset the handler by assigning it to null or an empty function
1052
- */
1053
- important?: {
1054
- image: import("@sinequa/core/web-services").RFMDisplay;
1055
- status: import("@sinequa/core/web-services").RFMDisplay;
1056
- eventCount: number;
1057
- average: number;
1058
- imageAction: import("@sinequa/core/web-services").RFMDisplay;
1059
- availableActions: import("@sinequa/core/web-services").RFMDisplay;
1060
- } | undefined;
1061
- } | undefined;
1062
- groupcount?: number | undefined;
1063
- nearhash?: string | undefined;
1064
- exacthash?: string | undefined;
1065
- containerid?: string | undefined;
1066
- $page?: number | undefined;
1067
- matchingpassages?: {
1068
- passages: {
1069
- location: number[];
1070
- id: number;
1071
- score: number;
1072
- rlocation: number[];
1073
- highlightedText: string;
1074
- $expanded?: boolean | undefined;
1075
- }[];
1076
- } | undefined;
1077
- $hasPassages?: boolean | undefined;
1078
- }>;
1079
- /** Event emitter triggered when the user clicks to open the preview of a document representing the context attachment */
1080
- openPreview: EventEmitter<ChatContextAttachment>;
1081
- /** Event emitter triggered when the user clicks on a suggested action */
1082
- suggestAction: EventEmitter<SuggestedAction>;
1083
- /** ViewChild decorators to access the template elements */
1084
- messageList?: ElementRef<HTMLUListElement>;
1085
- questionInput?: ElementRef<HTMLTextAreaElement>;
1086
- /** ContentChild decorators allowing the override of the default templates from the parent component */
1087
- loadingTpl?: TemplateRef<any>;
1088
- reportTpl?: TemplateRef<any>;
1089
- tokenConsumptionTpl?: TemplateRef<any>;
1090
- debugMessagesTpl?: TemplateRef<any>;
1091
- chatService: ChatService;
1092
- config: ChatConfig;
1093
- messages$: BehaviorSubject<ChatMessage[] | undefined>;
1094
- isAdminOrDeletedAdmin: boolean;
1095
- question: string;
1096
- _actions: Action[];
1097
- private _resetChatAction;
1098
- private _sub;
1099
- private _dataSubscription;
1100
- /** Variables that depend on the type of model in use */
1101
- modelDescription?: GllmModelDescription;
1102
- messageToEdit?: number;
1103
- remappedMessageToEdit?: number;
1104
- changes$: BehaviorSubject<SimpleChanges | undefined>;
1105
- currentMessageIndex: number | undefined;
1106
- firstChangesHandled: boolean;
1107
- isAtBottom: boolean;
1108
- initializationError: boolean;
1109
- enabledUserInput: boolean;
1110
- isConnected: boolean;
1111
- retrialAttempts: number | undefined;
1112
- private _isReconnectedListenerRegistered;
1113
- issueTypes?: string[];
1114
- defaultIssueTypes: string[];
1115
- issueType: string;
1116
- reportComment?: string;
1117
- messageToReport?: ChatMessage;
1118
- reportRank?: number;
1119
- reportType: 'like' | 'dislike';
1120
- showReport: boolean;
1121
- debugMessages: DebugMessage[] | undefined;
1122
- showDebugMessages: boolean;
1123
- private _previousQuery;
1124
- private _reloadSubscription;
1125
- constructor();
1126
- ngOnInit(): void;
1127
- ngOnChanges(changes: SimpleChanges): void;
1128
- ngOnDestroy(): void;
1129
- get isAdmin(): boolean;
1130
- /**
1131
- * Instantiate the chat service based on the provided @input protocol
1132
- * This chat service instance will then be stored in the instanceManagerService with provided @input instanceId as a key
1133
- */
1134
- instantiateChatService(): void;
1135
- get actions(): Action[];
1136
- /**
1137
- * Handles the changes in the chat component.
1138
- * If the chat service is a WebSocketChatService, it handles the override of the message handlers if they exist.
1139
- * Initializes the chat with the provided chat messages if they exist, otherwise loads the default chat.
1140
- * If the chat is initialized, the initialization event is "Query", the query changes, and the queryChangeShouldTriggerReload function is provided,
1141
- * then the chat should be reloaded if the function returns true. Otherwise, the chat should be reloaded by default.
1142
- * It takes into account the ongoing streaming process and the ongoing stopping process to trigger that conditionally define the logic
1143
- * of the reload :
1144
- * - If the chat is streaming, then stop the generation and wait for the fetch to complete before reloading the chat.
1145
- * - If the chat is stopping the generation, then wait for the fetch to complete before reloading the chat.
1146
- */
1147
- private _handleChanges;
1148
- /**
1149
- * Triggers a reload after the query change.
1150
- * This method performs the necessary operations to reload the chat after a query change.
1151
- * It sets the system and user messages, resets the savedChatId, generates a new chatId,
1152
- * generates a new chat audit event, and handles the query mode.
1153
- */
1154
- private _triggerReloadAfterQueryChange;
1155
- /**
1156
- * Adds a scroll listener to the message list element.
1157
- * The listener is triggered when any of the following events occur:
1158
- * - Loading state changes
1159
- * - Messages change
1160
- * - Streaming state changes
1161
- * - Scroll event occurs on the message list element
1162
- *
1163
- * When the listener is triggered, it updates the `isAtBottom` property.
1164
- */
1165
- private _addScrollListener;
1166
- /**
1167
- * Get the model description based on the defaultValues service_id and model_id
1168
- */
1169
- updateModelDescription(): void;
1170
- /**
1171
- * Submits a question from the user.
1172
- * If the user is editing a previous message, removes all subsequent messages from the chat history.
1173
- * Triggers the fetch of the answer for the submitted question by calling _fetchAnswer().
1174
- * Clears the input value in the UI.
1175
- * ⚠️ If the chat is streaming or stopping the generation, the operation is not allowed.
1176
- */
1177
- submitQuestion(): void;
1178
- /**
1179
- * Triggers the fetch of the answer for the given question and updates the conversation.
1180
- * Generates an audit event for the user input.
1181
- *
1182
- * @param question - The question asked by the user.
1183
- * @param conversation - The current conversation messages.
1184
- */
1185
- private _fetchAnswer;
1186
- /**
1187
- * Depending on the connection's state :
1188
- * - If connected => given a list of messages, the chat endpoint is invoked for a continuation and updates the list of messages accordingly.
1189
- * - If any other state => a connection error message is displayed in the chat.
1190
- * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
1191
- * @param messages The list of messages to invoke the chat endpoint with
1192
- */
1193
- fetch(messages: ChatMessage[]): void;
1194
- /**
1195
- * Retry to fetch the messages if the connection issues.
1196
- * - If reconnecting => keep display the connection error message even when clicking on the "retry" button and increasing the number of retrial attempts, until the connection is re-established
1197
- * - If disconnected => On click on the "retry" button, start the connection process while displaying the connection error message :
1198
- * * If successful => given a list of messages, the chat endpoint is invoked for a continuation and updates the list of messages accordingly.
1199
- * * If failed => increase the number of retrial attempts
1200
- */
1201
- retryFetch(): void;
1202
- /**
1203
- * Check if the signalR connection is connected.
1204
- * For the REST protocol, the connection is always considered connected (for the moment).
1205
- */
1206
- private _updateConnectionStatus;
1207
- /**
1208
- * Update the UI with the new messages
1209
- * @param messages
1210
- */
1211
- updateData(messages: ChatMessage[]): void;
1212
- /**
1213
- * @returns true if the chat discussion is scrolled down to the bottom, false otherwise
1214
- */
1215
- private _toggleScrollButtonVisibility;
1216
- /**
1217
- * Scroll down to the bottom of the chat discussion
1218
- */
1219
- scrollDown(): void;
1220
- /**
1221
- * Start a new chat with the defaultValues settings.
1222
- * The savedChatId in the chat service will be reset, so that the upcoming saved chat operations will be performed on the fresh new chat.
1223
- * If the savedChat feature is enabled, the list of saved chats will be refreshed.
1224
- * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
1225
- */
1226
- newChat(): void;
1227
- /**
1228
- * Attaches the specified document IDs to the assistant.
1229
- * If no document IDs are provided, the operation is not allowed.
1230
- * If the action for attaching a document is not defined at the application customization level, an error is logged.
1231
- * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
1232
- * @param ids - An array of document IDs to attach.
1233
- */
1234
- attachToChat(ids: string[]): void;
1235
- /**
1236
- * Start the default chat with the defaultValues settings
1237
- * If the chat is meant to be initialized with event === "Query", the corresponding user query message will be added to the chat history
1238
- */
1239
- loadDefaultChat(): void;
1240
- /**
1241
- * Handles the prompt mode of the chat component.
1242
- * If `sendUserPrompt` is true, it opens the chat with both system and user messages,
1243
- * and generates audit events for both messages.
1244
- * If `sendUserPrompt` is false, it opens the chat with only the system message,
1245
- * and generates an audit event for the system message.
1246
- *
1247
- * @param systemMsg - The system message to be displayed in the chat.
1248
- * @param userMsg - The user message to be displayed in the chat (optional).
1249
- */
1250
- private _handlePromptMode;
1251
- /**
1252
- * Handles the query mode by displaying the system message, user message, and user query message.
1253
- * If the provided query text is not empty, then add the user query message to the chat history and invoke the assistant
1254
- * Otherwise, just start a new chat with a warning message inviting the user to perform a full text search to retrieve some results
1255
- * @param systemMsg - The system message to be displayed.
1256
- * @param userMsg - The user message to be displayed.
1257
- */
1258
- private _handleQueryMode;
1259
- private _defineMessageAuditDetails;
1260
- /**
1261
- * Start/open a new chat with the provided messages and chatId
1262
- * If the last message is from the user, a request to the assistant is made to get an answer
1263
- * If the last message is from the assistant, the conversation is loaded right away
1264
- * @param messages The list of messages of the chat
1265
- * @param savedChatId The id of the saved chat. If provided (ie. an existing discussion in the saved chat index), update the savedChatId in the chat service for the upcoming saved chat operations
1266
- */
1267
- openChat(messages: RawMessage[], savedChatId?: string): void;
1268
- /**
1269
- * Reset the chat by clearing the chat history and the UI accordingly
1270
- * The user input will be cleared
1271
- * The fetch subscription will be terminated
1272
- */
1273
- resetChat(): void;
1274
- /**
1275
- * Fetch and Load the saved chat from the saved chat index.
1276
- * If the saved chat is found, the chat discussion will be loaded with the provided messages and chatId
1277
- */
1278
- onLoadChat(): void;
1279
- /**
1280
- * Stop the generation of the current assistant's answer.
1281
- * The fetch subscription will be terminated.
1282
- */
1283
- stopGeneration(): void;
1284
- /**
1285
- * Terminate the fetch process by unsubscribing from the data subscription and updating the loading status to false.
1286
- * Additionally, focus on the chat input if the focusAfterResponse flag is set to true.
1287
- */
1288
- terminateFetch(): void;
1289
- /**
1290
- * Copy a previous user message of the chat history to the chat user input.
1291
- * Thus, the user can edit and resubmit the message.
1292
- * Once the edited message is submitted, all subsequent messages starting from @param index will be removed from the history and the UI will be updated accordingly.
1293
- * The assistant will regenerate a new answer based on the updated chat history.
1294
- * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
1295
- * @param index The index of the user's message to edit
1296
- */
1297
- editMessage(index: number): void;
1298
- /**
1299
- * Copy a previous assistant message of the chat history to the clipboard.
1300
- * @param index The index of the assistant's message to edit
1301
- */
1302
- copyMessage(index: number): void;
1303
- /**
1304
- * Starting from the provided index, remove all subsequent messages from the chat history and the UI accordingly.
1305
- * The assistant will regenerate a new answer based on the updated chat history.
1306
- * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
1307
- * @param index The index of the assistant's message to regenerate
1308
- */
1309
- regenerateMessage(index: number): void;
1310
- /**
1311
- * Remaps the index in the chat history.
1312
- * The chat history is a list of messages where some messages can be hidden (display set to false).
1313
- * The index provided as input is the index of the message in the chat history displayed in the UI.
1314
- * This function should be removed once the backend is updated to add the ids of the messages in the chat history
1315
- * @param index - The index to be remapped.
1316
- */
1317
- private _remapIndexInChatHistory;
1318
- /**
1319
- * Handles the key up event for 'Backspace' and 'Enter' keys.
1320
- * @param event - The keyboard event.
1321
- */
1322
- onKeyUp(event: KeyboardEvent): void;
1323
- /**
1324
- * Calculates and adjusts the height of the question input element based on its content.
1325
- * If the Enter key is pressed without the Shift key, it prevents the default behavior.
1326
- * @param event The keyboard event
1327
- */
1328
- calculateHeight(event?: KeyboardEvent): void;
1329
- /**
1330
- * Send a "like" event on clicking on the thumb-up icon of an assistant's message
1331
- * @param message The assistant message to like
1332
- * @param rank The rank of the message to like
1333
- */
1334
- onLike(message: ChatMessage, rank: number): void;
1335
- /**
1336
- * Send a "dislike" event on clicking on the thumb-down icon of an assistant's message.
1337
- * It also opens the issue reporting dialog.
1338
- * @param message The assistant message to dislike
1339
- * @param index The rank of the message to dislike
1340
- */
1341
- onDislike(message: ChatMessage, rank: number): void;
1342
- private _updateChatHistory;
1343
- /**
1344
- * Report an issue related to the assistant's message.
1345
- */
1346
- sendReport(): void;
1347
- /**
1348
- * Close the reporting dialog.
1349
- */
1350
- ignoreReport(): void;
1351
- /**
1352
- * Handle the click on a reference's 'open preview'.
1353
- * @param data
1354
- */
1355
- openAttachmentPreview(data: {
1356
- reference: ChatContextAttachment;
1357
- partId?: number;
1358
- }): void;
1359
- /**
1360
- * Handle the click on a reference's 'open original document'.
1361
- * @param data
1362
- */
1363
- openOriginalAttachment(data: {
1364
- reference: ChatContextAttachment;
1365
- partId?: number;
1366
- }): void;
1367
- /**
1368
- * Handle the click on a suggested action.
1369
- * @param action Suggested action.
1370
- * @param index Rank of the message in the chatHistory related to the suggested action.
1371
- */
1372
- suggestActionClick(action: SuggestedAction, index: number): void;
1373
- /**
1374
- * It looks for the debug messages available in the current group of "assistant" messages.
1375
- * By design, the debug messages are only available in the first visible message among the group "assistant" messages.
1376
- * @param index The rank of the message
1377
- * @returns The debug messages available in the current group of "assistant" messages
1378
- */
1379
- getDebugMessages(index: number): DebugMessage[];
1380
- /**
1381
- * Handle the click on the 'show log info' button of a message.
1382
- * @param index The rank of the message
1383
- */
1384
- showDebug(index: number): void;
1385
- /**
1386
- * Verify whether the current message is an assistant message and that all following messages are assistant ones
1387
- * Used to keep the "View progress" opened even though the assistant is sending additional messages after the current one
1388
- * @param messages the list of current messages
1389
- * @param index the index of the current message
1390
- * @returns if this messages and the following ones (if any) are the last ones
1391
- */
1392
- isAssistantLastMessages(messages: ChatMessage[], index: number): boolean;
1393
- /**
1394
- * Checks if the given message is an empty assistant message.
1395
- * An empty assistant message is defined as a message with the role 'assistant',
1396
- * an empty content, and no additional properties such as attachments, progress,
1397
- * debug information, or suggested actions.
1398
- *
1399
- * @param message - The message to check.
1400
- * @returns `true` if the message is an empty assistant message, `false` otherwise.
1401
- */
1402
- isEmptyAssistantMessage(message: ChatMessage | undefined): boolean;
1403
- static ɵfac: i0.ɵɵFactoryDeclaration<ChatComponent, never>;
1404
- static ɵcmp: i0.ɵɵComponentDeclaration<ChatComponent, "sq-chat-v3", never, { "instanceId": "instanceId"; "query": "query"; "queryChangeShouldTriggerReload": "queryChangeShouldTriggerReload"; "protocol": "protocol"; "messageHandlers": "messageHandlers"; "automaticScrollToLastResponse": "automaticScrollToLastResponse"; "focusAfterResponse": "focusAfterResponse"; "chat": "chat"; "assistantMessageIcon": "assistantMessageIcon"; "userMessageIcon": "userMessageIcon"; "connectionErrorMessageIcon": "connectionErrorMessageIcon"; "searchWarningMessageIcon": "searchWarningMessageIcon"; }, { "connection": "connection"; "loading$": "loading"; "_config": "config"; "data": "data"; "openDocument": "openDocument"; "openPreview": "openPreview"; "suggestAction": "suggestAction"; }, ["loadingTpl", "reportTpl", "tokenConsumptionTpl", "debugMessagesTpl"], never, true>;
1405
- }
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from "@angular/core";
2
+ import { HubConnection } from "@microsoft/signalr";
3
+ import { BehaviorSubject } from "rxjs";
4
+ import { AppGlobalConfig, Article, Query } from "@sinequa/atomic";
5
+ import { ChatService } from "./chat.service";
6
+ import { InstanceManagerService } from "./instance-manager.service";
7
+ import { RestChatService } from "./rest-chat.service";
8
+ import { NotificationsService } from "./services/notification.service";
9
+ import { PrincipalService } from "./services/principal.service";
10
+ import { SearchService } from "./services/search.service";
11
+ import { ChatConfig, ChatContextAttachment, ChatMessage, DebugMessage, GllmModelDescription, InitChat, MessageHandler, RawMessage, SuggestedAction } from "./types";
12
+ import { WebSocketChatService } from "./websocket-chat.service";
13
+ import * as i0 from "@angular/core";
14
+ export declare class ChatComponent implements OnInit, OnChanges, OnDestroy {
15
+ websocketService: WebSocketChatService;
16
+ restService: RestChatService;
17
+ instanceManagerService: InstanceManagerService;
18
+ searchService: SearchService;
19
+ principalService: PrincipalService;
20
+ cdr: ChangeDetectorRef;
21
+ notificationsService: NotificationsService;
22
+ private readonly transloco;
23
+ /** Define the key based on it, the chat service instance will be stored */
24
+ instanceId: string;
25
+ /** Define the query to use to fetch answers */
26
+ query: Query;
27
+ /** Function that determines whether the chat should be reloaded after the query changes
28
+ * If not provided, the chat will be reloaded by default
29
+ * @param prevQuery The previous query
30
+ * @param newQuery The new query
31
+ * @returns true if the chat should be reloaded, false otherwise
32
+ */
33
+ queryChangeShouldTriggerReload: (prevQuery: Query, newQuery: Query) => boolean;
34
+ /** Define the protocol to be used for this chat instance*/
35
+ protocol: 'REST' | 'WEBSOCKET';
36
+ /** Map of listeners overriding default registered ones*/
37
+ messageHandlers: Map<string, MessageHandler<any>>;
38
+ /** When the assistant answer a user question, automatically scroll down to the bottom of the discussion */
39
+ automaticScrollToLastResponse: boolean;
40
+ /** When the assistant answer a user question, automatically focus to the chat input */
41
+ focusAfterResponse: boolean;
42
+ /** A chat discussion that the component should get initialized with it */
43
+ chat?: InitChat;
44
+ /** Icon to use for the assistant messages */
45
+ assistantMessageIcon: string;
46
+ /** Icon to use for the user messages */
47
+ userMessageIcon: string;
48
+ /** Icon to use for the connection error messages */
49
+ connectionErrorMessageIcon: string;
50
+ /** Icon to use for the search warning messages */
51
+ searchWarningMessageIcon: string;
52
+ additionalWorkflowProperties: Record<string, any>;
53
+ /** Event emitter triggered once the signalR connection is established */
54
+ connection: EventEmitter<HubConnection>;
55
+ /** Event emitter triggered each time the assistant updates the current chat */
56
+ /** Event emitter triggered when the chat is loading new content */
57
+ loading$: EventEmitter<boolean>;
58
+ /** Emits the assistant configuration used when instantiating the component */
59
+ _config: EventEmitter<ChatConfig>;
60
+ data: EventEmitter<ChatMessage[]>;
61
+ /** Event emitter triggered when the user clicks to open the original document representing the context attachment*/
62
+ openDocument: EventEmitter<Article>;
63
+ /** Event emitter triggered when the user clicks to open the preview of a document representing the context attachment */
64
+ openPreview: EventEmitter<ChatContextAttachment>;
65
+ /** Event emitter triggered when the user clicks on a suggested action */
66
+ suggestAction: EventEmitter<SuggestedAction>;
67
+ /** ViewChild decorators to access the template elements */
68
+ messageList?: ElementRef<HTMLUListElement>;
69
+ questionInput?: ElementRef<HTMLTextAreaElement>;
70
+ /** ContentChild decorators allowing the override of the default templates from the parent component */
71
+ loadingTpl?: TemplateRef<any>;
72
+ reportTpl?: TemplateRef<any>;
73
+ tokenConsumptionTpl?: TemplateRef<any>;
74
+ debugMessagesTpl?: TemplateRef<any>;
75
+ appConfig: AppGlobalConfig;
76
+ chatService: ChatService;
77
+ config: ChatConfig;
78
+ messages$: BehaviorSubject<ChatMessage[] | undefined>;
79
+ isAdminOrDeletedAdmin: boolean;
80
+ question: string;
81
+ private _sub;
82
+ private _dataSubscription;
83
+ /** Variables that depend on the type of model in use */
84
+ modelDescription?: GllmModelDescription;
85
+ messageToEdit?: number;
86
+ remappedMessageToEdit?: number;
87
+ changes$: BehaviorSubject<SimpleChanges | undefined>;
88
+ currentMessageIndex: number | undefined;
89
+ firstChangesHandled: boolean;
90
+ isAtBottom: boolean;
91
+ initializationError: boolean;
92
+ enabledUserInput: boolean;
93
+ isConnected: boolean;
94
+ retrialAttempts: number | undefined;
95
+ private _isReconnectedListenerRegistered;
96
+ issueTypes?: string[];
97
+ defaultIssueTypes: string[];
98
+ issueType: string;
99
+ reportComment?: string;
100
+ messageToReport?: ChatMessage;
101
+ reportRank?: number;
102
+ reportType: 'like' | 'dislike';
103
+ showReport: boolean;
104
+ debugMessages: DebugMessage[] | undefined;
105
+ showDebugMessages: boolean;
106
+ lastFetchDuration?: number;
107
+ private _previousQuery;
108
+ private _reloadSubscription;
109
+ ngOnInit(): void;
110
+ ngOnChanges(changes: SimpleChanges): void;
111
+ ngOnDestroy(): void;
112
+ get isAdmin(): boolean;
113
+ /**
114
+ * Instantiate the chat service based on the provided @input protocol
115
+ * This chat service instance will then be stored in the instanceManagerService with provided @input instanceId as a key
116
+ */
117
+ instantiateChatService(): void;
118
+ /**
119
+ * Handles the changes in the chat component.
120
+ * If the chat service is a WebSocketChatService, it handles the override of the message handlers if they exist.
121
+ * Initializes the chat with the provided chat messages if they exist, otherwise loads the default chat.
122
+ * If the chat is initialized, the initialization event is "Query", the query changes, and the queryChangeShouldTriggerReload function is provided,
123
+ * then the chat should be reloaded if the function returns true. Otherwise, the chat should be reloaded by default.
124
+ * It takes into account the ongoing streaming process and the ongoing stopping process to trigger that conditionally define the logic
125
+ * of the reload :
126
+ * - If the chat is streaming, then stop the generation and wait for the fetch to complete before reloading the chat.
127
+ * - If the chat is stopping the generation, then wait for the fetch to complete before reloading the chat.
128
+ */
129
+ private _handleChanges;
130
+ /**
131
+ * Triggers a reload after the query change.
132
+ * This method performs the necessary operations to reload the chat after a query change.
133
+ * It sets the system and user messages, resets the savedChatId, generates a new chatId,
134
+ * generates a new chat audit event, and handles the query mode.
135
+ */
136
+ private _triggerReloadAfterQueryChange;
137
+ /**
138
+ * Adds a scroll listener to the message list element.
139
+ * The listener is triggered when any of the following events occur:
140
+ * - Loading state changes
141
+ * - Messages change
142
+ * - Streaming state changes
143
+ * - Scroll event occurs on the message list element
144
+ *
145
+ * When the listener is triggered, it updates the `isAtBottom` property.
146
+ */
147
+ private _addScrollListener;
148
+ /**
149
+ * Get the model description based on the defaultValues service_id and model_id
150
+ */
151
+ updateModelDescription(): void;
152
+ /**
153
+ * Submits a question from the user.
154
+ * If the user is editing a previous message, removes all subsequent messages from the chat history.
155
+ * Triggers the fetch of the answer for the submitted question by calling _fetchAnswer().
156
+ * Clears the input value in the UI.
157
+ * ⚠️ If the chat is streaming or stopping the generation, the operation is not allowed.
158
+ */
159
+ submitQuestion(): void;
160
+ /**
161
+ * Triggers the fetch of the answer for the given question and updates the conversation.
162
+ * Generates an audit event for the user input.
163
+ *
164
+ * @param question - The question asked by the user.
165
+ * @param conversation - The current conversation messages.
166
+ */
167
+ private _fetchAnswer;
168
+ /**
169
+ * Depending on the connection's state :
170
+ * - If connected => given a list of messages, the chat endpoint is invoked for a continuation and updates the list of messages accordingly.
171
+ * - If any other state => a connection error message is displayed in the chat.
172
+ * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
173
+ * @param messages The list of messages to invoke the chat endpoint with
174
+ */
175
+ fetch(messages: ChatMessage[]): void;
176
+ /**
177
+ * Retry to fetch the messages if the connection issues.
178
+ * - If reconnecting => keep display the connection error message even when clicking on the "retry" button and increasing the number of retrial attempts, until the connection is re-established
179
+ * - If disconnected => On click on the "retry" button, start the connection process while displaying the connection error message :
180
+ * * If successful => given a list of messages, the chat endpoint is invoked for a continuation and updates the list of messages accordingly.
181
+ * * If failed => increase the number of retrial attempts
182
+ */
183
+ retryFetch(): void;
184
+ /**
185
+ * Check if the signalR connection is connected.
186
+ * For the REST protocol, the connection is always considered connected (for the moment).
187
+ */
188
+ private _updateConnectionStatus;
189
+ /**
190
+ * Update the UI with the new messages
191
+ * @param messages
192
+ */
193
+ updateData(messages: ChatMessage[]): void;
194
+ /**
195
+ * @returns true if the chat discussion is scrolled down to the bottom, false otherwise
196
+ */
197
+ private _toggleScrollButtonVisibility;
198
+ /**
199
+ * Scroll down to the bottom of the chat discussion
200
+ */
201
+ scrollDown(): void;
202
+ /**
203
+ * Start a new chat with the defaultValues settings.
204
+ * The savedChatId in the chat service will be reset, so that the upcoming saved chat operations will be performed on the fresh new chat.
205
+ * If the savedChat feature is enabled, the list of saved chats will be refreshed.
206
+ * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
207
+ */
208
+ newChat(): void;
209
+ /**
210
+ * Attaches the specified document IDs to the assistant.
211
+ * If no document IDs are provided, the operation is not allowed.
212
+ * If the action for attaching a document is not defined at the application customization level, an error is logged.
213
+ * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
214
+ * @param ids - An array of document IDs to attach.
215
+ */
216
+ attachToChat(ids: string[]): void;
217
+ /**
218
+ * Start the default chat with the defaultValues settings
219
+ * If the chat is meant to be initialized with event === "Query", the corresponding user query message will be added to the chat history
220
+ */
221
+ loadDefaultChat(): void;
222
+ /**
223
+ * Handles the prompt mode of the chat component.
224
+ * If `sendUserPrompt` is true, it opens the chat with both system and user messages,
225
+ * and generates audit events for both messages.
226
+ * If `sendUserPrompt` is false, it opens the chat with only the system message,
227
+ * and generates an audit event for the system message.
228
+ *
229
+ * @param systemMsg - The system message to be displayed in the chat.
230
+ * @param userMsg - The user message to be displayed in the chat (optional).
231
+ */
232
+ private _handlePromptMode;
233
+ /**
234
+ * Handles the query mode by displaying the system message, user message, and user query message.
235
+ * If the provided query text is not empty, then add the user query message to the chat history and invoke the assistant
236
+ * Otherwise, just start a new chat with a warning message inviting the user to perform a full text search to retrieve some results
237
+ * @param systemMsg - The system message to be displayed.
238
+ * @param userMsg - The user message to be displayed.
239
+ */
240
+ private _handleQueryMode;
241
+ private _defineMessageAuditDetails;
242
+ /**
243
+ * Start/open a new chat with the provided messages and chatId
244
+ * If the last message is from the user, a request to the assistant is made to get an answer
245
+ * If the last message is from the assistant, the conversation is loaded right away
246
+ * @param messages The list of messages of the chat
247
+ * @param savedChatId The id of the saved chat. If provided (ie. an existing discussion in the saved chat index), update the savedChatId in the chat service for the upcoming saved chat operations
248
+ */
249
+ openChat(messages: RawMessage[], savedChatId?: string): void;
250
+ /**
251
+ * Reset the chat by clearing the chat history and the UI accordingly
252
+ * The user input will be cleared
253
+ * The fetch subscription will be terminated
254
+ */
255
+ resetChat(): void;
256
+ /**
257
+ * Fetch and Load the saved chat from the saved chat index.
258
+ * If the saved chat is found, the chat discussion will be loaded with the provided messages and chatId
259
+ */
260
+ onLoadChat(): void;
261
+ /**
262
+ * Stop the generation of the current assistant's answer.
263
+ * The fetch subscription will be terminated.
264
+ */
265
+ stopGeneration(): void;
266
+ /**
267
+ * Terminate the fetch process by unsubscribing from the data subscription and updating the loading status to false.
268
+ * Additionally, focus on the chat input if the focusAfterResponse flag is set to true.
269
+ */
270
+ terminateFetch(): void;
271
+ /**
272
+ * Copy a previous user message of the chat history to the chat user input.
273
+ * Thus, the user can edit and resubmit the message.
274
+ * Once the edited message is submitted, all subsequent messages starting from @param index will be removed from the history and the UI will be updated accordingly.
275
+ * The assistant will regenerate a new answer based on the updated chat history.
276
+ * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
277
+ * @param index The index of the user's message to edit
278
+ */
279
+ editMessage(index: number): void;
280
+ /**
281
+ * Copy a previous assistant message of the chat history to the clipboard.
282
+ * @param index The index of the assistant's message to edit
283
+ */
284
+ copyMessage(index: number): void;
285
+ /**
286
+ * Starting from the provided index, remove all subsequent messages from the chat history and the UI accordingly.
287
+ * The assistant will regenerate a new answer based on the updated chat history.
288
+ * ⚠️ If the assistant is streaming or stopping the generation, the operation is not allowed.
289
+ * @param index The index of the assistant's message to regenerate
290
+ */
291
+ regenerateMessage(index: number): void;
292
+ /**
293
+ * Remaps the index in the chat history.
294
+ * The chat history is a list of messages where some messages can be hidden (display set to false).
295
+ * The index provided as input is the index of the message in the chat history displayed in the UI.
296
+ * This function should be removed once the backend is updated to add the ids of the messages in the chat history
297
+ * @param index - The index to be remapped.
298
+ */
299
+ private _remapIndexInChatHistory;
300
+ /**
301
+ * Handles the key up event for 'Backspace' and 'Enter' keys.
302
+ * @param event - The keyboard event.
303
+ */
304
+ onKeyUp(event: KeyboardEvent): void;
305
+ /**
306
+ * Calculates and adjusts the height of the question input element based on its content.
307
+ * If the Enter key is pressed without the Shift key, it prevents the default behavior.
308
+ * @param event The keyboard event
309
+ */
310
+ calculateHeight(event?: KeyboardEvent): void;
311
+ /**
312
+ * Send a "like" event on clicking on the thumb-up icon of an assistant's message
313
+ * @param message The assistant message to like
314
+ * @param rank The rank of the message to like
315
+ */
316
+ onLike(message: ChatMessage, rank: number): void;
317
+ /**
318
+ * Send a "dislike" event on clicking on the thumb-down icon of an assistant's message.
319
+ * It also opens the issue reporting dialog.
320
+ * @param message The assistant message to dislike
321
+ * @param index The rank of the message to dislike
322
+ */
323
+ onDislike(message: ChatMessage, rank: number): void;
324
+ private _updateChatHistory;
325
+ /**
326
+ * Report an issue related to the assistant's message.
327
+ */
328
+ sendReport(): void;
329
+ /**
330
+ * Close the reporting dialog.
331
+ */
332
+ ignoreReport(): void;
333
+ /**
334
+ * Handle the click on a reference's 'open preview'.
335
+ * @param data
336
+ * @param index rank of the message
337
+ */
338
+ openAttachmentPreview(data: {
339
+ reference: ChatContextAttachment;
340
+ partId?: number;
341
+ }, rank: number): void;
342
+ /**
343
+ * Handle the click on a reference's 'open original document'.
344
+ * @param data
345
+ */
346
+ openOriginalAttachment(data: {
347
+ reference: ChatContextAttachment;
348
+ partId?: number;
349
+ }, rank: number): void;
350
+ /**
351
+ * Handle the click on a suggested action.
352
+ * @param action Suggested action.
353
+ * @param index Rank of the message in the chatHistory related to the suggested action.
354
+ */
355
+ suggestActionClick(action: SuggestedAction, index: number): void;
356
+ /**
357
+ * It looks for the debug messages available in the current group of "assistant" messages.
358
+ * By design, the debug messages are only available in the first visible message among the group "assistant" messages.
359
+ * @param index The rank of the message
360
+ * @returns The debug messages available in the current group of "assistant" messages
361
+ */
362
+ getDebugMessages(index: number): DebugMessage[];
363
+ /**
364
+ * Handle the click on the 'show log info' button of a message.
365
+ * @param index The rank of the message
366
+ */
367
+ showDebug(index: number): void;
368
+ /**
369
+ * Verify whether the current message is an assistant message and that all following messages are assistant ones
370
+ * Used to keep the "View progress" opened even though the assistant is sending additional messages after the current one
371
+ * @param messages the list of current messages
372
+ * @param index the index of the current message
373
+ * @returns if this messages and the following ones (if any) are the last ones
374
+ */
375
+ isAssistantLastMessages(messages: ChatMessage[], index: number): boolean;
376
+ /**
377
+ * Checks if the given message is an empty assistant message.
378
+ * An empty assistant message is defined as a message with the role 'assistant',
379
+ * an empty content, and no additional properties such as attachments, progress,
380
+ * debug information, or suggested actions.
381
+ *
382
+ * @param message - The message to check.
383
+ * @returns `true` if the message is an empty assistant message, `false` otherwise.
384
+ */
385
+ isEmptyAssistantMessage(message: ChatMessage | undefined): boolean;
386
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChatComponent, never>;
387
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChatComponent, "sq-chat-v3", never, { "instanceId": { "alias": "instanceId"; "required": false; }; "query": { "alias": "query"; "required": false; }; "queryChangeShouldTriggerReload": { "alias": "queryChangeShouldTriggerReload"; "required": false; }; "protocol": { "alias": "protocol"; "required": false; }; "messageHandlers": { "alias": "messageHandlers"; "required": false; }; "automaticScrollToLastResponse": { "alias": "automaticScrollToLastResponse"; "required": false; }; "focusAfterResponse": { "alias": "focusAfterResponse"; "required": false; }; "chat": { "alias": "chat"; "required": false; }; "assistantMessageIcon": { "alias": "assistantMessageIcon"; "required": false; }; "userMessageIcon": { "alias": "userMessageIcon"; "required": false; }; "connectionErrorMessageIcon": { "alias": "connectionErrorMessageIcon"; "required": false; }; "searchWarningMessageIcon": { "alias": "searchWarningMessageIcon"; "required": false; }; "additionalWorkflowProperties": { "alias": "additionalWorkflowProperties"; "required": false; }; "appConfig": { "alias": "appConfig"; "required": false; }; }, { "connection": "connection"; "loading$": "loading"; "_config": "config"; "data": "data"; "openDocument": "openDocument"; "openPreview": "openPreview"; "suggestAction": "suggestAction"; }, ["loadingTpl", "reportTpl", "tokenConsumptionTpl", "debugMessagesTpl"], never, true, never>;
388
+ }