@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.
- package/chat/charts/chart/chart.component.d.ts +13 -13
- package/chat/chat-message/chat-message.component.d.ts +85 -81
- package/chat/chat-message/i18n/en.json +11 -0
- package/chat/chat-message/i18n/fr.json +11 -0
- package/chat/chat-reference/chat-reference.component.d.ts +14 -14
- package/chat/chat-reference/i18n/en.json +4 -0
- package/chat/chat-reference/i18n/fr.json +4 -0
- package/chat/chat-settings-v3/chat-settings-v3.component.d.ts +48 -50
- package/chat/chat-settings-v3/i18n/en.json +14 -0
- package/chat/chat-settings-v3/i18n/fr.json +14 -0
- package/chat/chat.component.d.ts +388 -1405
- package/chat/chat.service.d.ts +247 -228
- package/chat/debug-message/debug-message.component.d.ts +17 -17
- package/chat/debug-message/i18n/en.json +3 -0
- package/chat/debug-message/i18n/fr.json +3 -0
- package/chat/dialogs/delete-saved-chat.component.d.ts +22 -0
- package/chat/dialogs/i18n/en.json +19 -0
- package/chat/dialogs/i18n/fr.json +19 -0
- package/chat/dialogs/rename-saved-chat.component.d.ts +21 -0
- package/chat/dialogs/updates.component.d.ts +15 -0
- package/chat/documents-upload/document-list/document-list.component.d.ts +68 -77
- package/chat/documents-upload/document-overview/document-overview.component.d.ts +31 -41
- package/chat/documents-upload/document-upload/document-upload.component.d.ts +96 -98
- package/chat/documents-upload/documents-upload.model.d.ts +66 -66
- package/chat/documents-upload/documents-upload.service.d.ts +170 -174
- package/chat/documents-upload/i18n/en.json +24 -0
- package/chat/documents-upload/i18n/fr.json +24 -0
- package/chat/format-icon/format-icon.component.d.ts +10 -10
- package/chat/format-icon/icons.d.ts +5 -5
- package/chat/i18n/en.json +42 -0
- package/chat/i18n/fr.json +42 -0
- package/chat/index.d.ts +5 -5
- package/chat/initials-avatar/initials-avatar.component.d.ts +35 -35
- package/chat/instance-manager.service.d.ts +28 -28
- package/chat/pipes/message-content.pipe.d.ts +16 -0
- package/chat/prompt.component.d.ts +25 -21
- package/chat/public-api.d.ts +17 -17
- package/chat/references/i18n/en.json +6 -0
- package/chat/references/i18n/fr.json +6 -0
- package/chat/references/inline-image-reference.d.ts +21 -0
- package/chat/references/inline-page-reference.d.ts +21 -0
- package/chat/rest-chat.service.d.ts +31 -33
- package/chat/saved-chats/i18n/en.json +4 -0
- package/chat/saved-chats/i18n/fr.json +4 -0
- package/chat/saved-chats/saved-chats.component.d.ts +30 -36
- package/chat/services/app.service.d.ts +8 -0
- package/chat/services/dialog.service.d.ts +12 -0
- package/chat/services/notification.service.d.ts +10 -0
- package/chat/services/principal.service.d.ts +7 -0
- package/chat/services/search.service.d.ts +7 -0
- package/chat/services/signalR.web.service.d.ts +45 -0
- package/chat/services/ui.service.d.ts +13 -0
- package/chat/services/user-settings.service.d.ts +7 -0
- package/chat/token-progress-bar/i18n/en.json +4 -0
- package/chat/token-progress-bar/i18n/fr.json +4 -0
- package/chat/token-progress-bar/token-progress-bar.component.d.ts +24 -27
- package/chat/tooltip/tooltip.component.d.ts +12 -0
- package/chat/tooltip/tooltip.directive.d.ts +81 -0
- package/chat/types/message-content.types.d.ts +54 -0
- package/chat/types/message-reference.types.d.ts +11 -0
- package/chat/types.d.ts +913 -873
- package/chat/unified-plugins/embedded-image-reference.plugin.d.ts +3 -0
- package/chat/unified-plugins/embedded-page-reference.plugin.d.ts +3 -0
- package/chat/utils/assistant-json.d.ts +2 -0
- package/chat/websocket-chat.service.d.ts +102 -103
- package/esm2022/chat/charts/chart/chart.component.mjs +40 -0
- package/esm2022/chat/chat-message/chat-message.component.mjs +351 -0
- package/esm2022/chat/chat-reference/chat-reference.component.mjs +40 -0
- package/esm2022/chat/chat-settings-v3/chat-settings-v3.component.mjs +118 -0
- package/esm2022/chat/chat.component.mjs +1090 -0
- package/esm2022/chat/chat.service.mjs +417 -0
- package/esm2022/chat/debug-message/debug-message.component.mjs +43 -0
- package/esm2022/chat/dialogs/delete-saved-chat.component.mjs +81 -0
- package/esm2022/chat/dialogs/rename-saved-chat.component.mjs +84 -0
- package/esm2022/chat/dialogs/updates.component.mjs +61 -0
- package/esm2022/chat/documents-upload/document-list/document-list.component.mjs +140 -0
- package/esm2022/chat/documents-upload/document-overview/document-overview.component.mjs +65 -0
- package/esm2022/chat/documents-upload/document-upload/document-upload.component.mjs +256 -0
- package/{esm2020 → esm2022}/chat/documents-upload/documents-upload.model.mjs +1 -1
- package/esm2022/chat/documents-upload/documents-upload.service.mjs +291 -0
- package/{esm2020 → esm2022}/chat/format-icon/format-icon.component.mjs +23 -23
- package/{esm2020 → esm2022}/chat/format-icon/icons.mjs +137 -137
- package/{esm2020 → esm2022}/chat/initials-avatar/initials-avatar.component.mjs +60 -60
- package/esm2022/chat/instance-manager.service.mjs +46 -0
- package/esm2022/chat/pipes/message-content.pipe.mjs +34 -0
- package/esm2022/chat/prompt.component.mjs +88 -0
- package/{esm2020 → esm2022}/chat/public-api.mjs +18 -18
- package/esm2022/chat/references/inline-image-reference.mjs +110 -0
- package/esm2022/chat/references/inline-page-reference.mjs +110 -0
- package/esm2022/chat/rest-chat.service.mjs +296 -0
- package/esm2022/chat/saved-chats/saved-chats.component.mjs +82 -0
- package/esm2022/chat/services/app.service.mjs +19 -0
- package/esm2022/chat/services/dialog.service.mjs +40 -0
- package/esm2022/chat/services/notification.service.mjs +25 -0
- package/esm2022/chat/services/principal.service.mjs +16 -0
- package/esm2022/chat/services/search.service.mjs +13 -0
- package/esm2022/chat/services/signalR.web.service.mjs +79 -0
- package/esm2022/chat/services/ui.service.mjs +61 -0
- package/esm2022/chat/services/user-settings.service.mjs +22 -0
- package/{esm2020 → esm2022}/chat/sinequa-assistant-chat.mjs +4 -4
- package/esm2022/chat/token-progress-bar/token-progress-bar.component.mjs +52 -0
- package/esm2022/chat/tooltip/tooltip.component.mjs +44 -0
- package/esm2022/chat/tooltip/tooltip.directive.mjs +203 -0
- package/esm2022/chat/types/message-content.types.mjs +2 -0
- package/esm2022/chat/types/message-reference.types.mjs +2 -0
- package/esm2022/chat/types.mjs +130 -0
- package/esm2022/chat/unified-plugins/embedded-image-reference.plugin.mjs +57 -0
- package/esm2022/chat/unified-plugins/embedded-page-reference.plugin.mjs +57 -0
- package/esm2022/chat/utils/assistant-json.mjs +12 -0
- package/esm2022/chat/websocket-chat.service.mjs +654 -0
- package/{esm2020 → esm2022}/public-api.mjs +2 -2
- package/{esm2020 → esm2022}/sinequa-assistant.mjs +4 -4
- package/fesm2022/sinequa-assistant-chat.mjs +5340 -0
- package/fesm2022/sinequa-assistant-chat.mjs.map +1 -0
- package/{fesm2015 → fesm2022}/sinequa-assistant.mjs +3 -3
- package/index.d.ts +5 -5
- package/package.json +52 -25
- package/public-api.d.ts +1 -1
- package/chat/messages/de.d.ts +0 -4
- package/chat/messages/en.d.ts +0 -4
- package/chat/messages/fr.d.ts +0 -4
- package/chat/messages/index.d.ts +0 -4
- package/esm2020/chat/charts/chart/chart.component.mjs +0 -40
- package/esm2020/chat/chat-message/chat-message.component.mjs +0 -263
- package/esm2020/chat/chat-reference/chat-reference.component.mjs +0 -40
- package/esm2020/chat/chat-settings-v3/chat-settings-v3.component.mjs +0 -117
- package/esm2020/chat/chat.component.mjs +0 -1069
- package/esm2020/chat/chat.service.mjs +0 -333
- package/esm2020/chat/debug-message/debug-message.component.mjs +0 -43
- package/esm2020/chat/documents-upload/document-list/document-list.component.mjs +0 -191
- package/esm2020/chat/documents-upload/document-overview/document-overview.component.mjs +0 -80
- package/esm2020/chat/documents-upload/document-upload/document-upload.component.mjs +0 -258
- package/esm2020/chat/documents-upload/documents-upload.service.mjs +0 -289
- package/esm2020/chat/instance-manager.service.mjs +0 -46
- package/esm2020/chat/messages/de.mjs +0 -4
- package/esm2020/chat/messages/en.mjs +0 -4
- package/esm2020/chat/messages/fr.mjs +0 -4
- package/esm2020/chat/messages/index.mjs +0 -9
- package/esm2020/chat/prompt.component.mjs +0 -88
- package/esm2020/chat/rest-chat.service.mjs +0 -241
- package/esm2020/chat/saved-chats/saved-chats.component.mjs +0 -175
- package/esm2020/chat/token-progress-bar/token-progress-bar.component.mjs +0 -54
- package/esm2020/chat/types.mjs +0 -112
- package/esm2020/chat/websocket-chat.service.mjs +0 -641
- package/fesm2015/sinequa-assistant-chat.mjs +0 -4200
- package/fesm2015/sinequa-assistant-chat.mjs.map +0 -1
- package/fesm2020/sinequa-assistant-chat.mjs +0 -4171
- package/fesm2020/sinequa-assistant-chat.mjs.map +0 -1
- package/fesm2020/sinequa-assistant.mjs +0 -9
- package/fesm2020/sinequa-assistant.mjs.map +0 -1
- /package/{fesm2015 → fesm2022}/sinequa-assistant.mjs.map +0 -0
package/chat/chat.service.d.ts
CHANGED
|
@@ -1,228 +1,247 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { ChatConfig, ChatMessage, ChatResponse, ChatUsageMetrics, GllmFunction, GllmModelDescription, Quota, SavedChat, SavedChatHistory, TokenConsumption, UserTokenConsumption } from "./types";
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
export declare abstract class ChatService {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
models
|
|
32
|
-
|
|
33
|
-
functions
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
quota
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
*
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @param
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
*
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* @
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
*
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
*
|
|
183
|
-
* @param
|
|
184
|
-
* @
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
*
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
*
|
|
197
|
-
* @param
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
*
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
*
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
*
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
1
|
+
import { TranslocoService } from "@jsverse/transloco";
|
|
2
|
+
import { BehaviorSubject, Observable } from "rxjs";
|
|
3
|
+
import { Query } from "@sinequa/atomic";
|
|
4
|
+
import { AppService } from "./services/app.service";
|
|
5
|
+
import { DialogService } from "./services/dialog.service";
|
|
6
|
+
import { NotificationsService } from "./services/notification.service";
|
|
7
|
+
import { PrincipalService } from "./services/principal.service";
|
|
8
|
+
import { UserSettingsWebService } from "./services/user-settings.service";
|
|
9
|
+
import { ChatConfig, ChatMessage, ChatResponse, ChatUsageMetrics, DeleteSavedChatResponse, GllmFunction, GllmModelDescription, Quota, SavedChat, SavedChatHistory, SavedChatResponse, TokenConsumption, UserTokenConsumption } from "./types";
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export declare abstract class ChatService {
|
|
12
|
+
readonly localID: string | null;
|
|
13
|
+
/** Name of the assistant plugin OR websocket endpoint. */
|
|
14
|
+
REQUEST_URL: string;
|
|
15
|
+
/** Emit true once the initialization of the assistant process is done. */
|
|
16
|
+
initProcess$: BehaviorSubject<boolean>;
|
|
17
|
+
/** Emit true once the initialization of the assistant config is done. */
|
|
18
|
+
initConfig$: BehaviorSubject<boolean>;
|
|
19
|
+
/** Emit the global configuration of the assistant. */
|
|
20
|
+
assistantConfig$: BehaviorSubject<ChatConfig | undefined>;
|
|
21
|
+
/** Emit true if the user has been overridden, false otherwise. */
|
|
22
|
+
userOverride$: BehaviorSubject<boolean | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Emit true if the fetch of an assistant's response is ongoing (it includes Streaming status of the assistant endpoint AND saving the discussion if save Chat is enabled).
|
|
25
|
+
* This is used to prevent multiple fetches at the same time.
|
|
26
|
+
* Typically, there is no problem chaining fetches, but when forcing a reload after query changes cases, it can't be allowed because it breaks the whole business logic.
|
|
27
|
+
*/
|
|
28
|
+
streaming$: BehaviorSubject<boolean>;
|
|
29
|
+
/** Store the messages history of the current chat. */
|
|
30
|
+
chatHistory: ChatMessage[] | undefined;
|
|
31
|
+
/** List of models available on the server. */
|
|
32
|
+
models: GllmModelDescription[] | undefined;
|
|
33
|
+
/** List of functions available on the server. */
|
|
34
|
+
functions: GllmFunction[] | undefined;
|
|
35
|
+
/** List of saved chats. */
|
|
36
|
+
savedChats$: BehaviorSubject<SavedChat[]>;
|
|
37
|
+
/** Emit the saved chat to load. */
|
|
38
|
+
loadSavedChat$: BehaviorSubject<SavedChat | undefined>;
|
|
39
|
+
/** Emit the quota each time the chat is invoked. */
|
|
40
|
+
quota$: BehaviorSubject<Quota | undefined>;
|
|
41
|
+
/** Emit the calculated user's token consumption based on the quota. */
|
|
42
|
+
userTokenConsumption$: BehaviorSubject<UserTokenConsumption | undefined>;
|
|
43
|
+
/** Emit the chat usage metrics each time the generation of the assistant response is completed. */
|
|
44
|
+
chatUsageMetrics$: BehaviorSubject<ChatUsageMetrics | undefined>;
|
|
45
|
+
/** Emit the calculated chat's token consumption based on the chat usage metrics. */
|
|
46
|
+
chatTokenConsumption$: BehaviorSubject<TokenConsumption | undefined>;
|
|
47
|
+
/** Emit true if "CancelTasks" is ongoing. */
|
|
48
|
+
stoppingGeneration$: BehaviorSubject<boolean>;
|
|
49
|
+
/** Instance ID of the chat service defining the assistant instance. */
|
|
50
|
+
private _chatInstanceId;
|
|
51
|
+
/** ID of the current **saved chat** discussion which is used to update/get/delete it. */
|
|
52
|
+
private _savedChatId;
|
|
53
|
+
/** Generated GUID for the current non-saved chat discussion used to identify audit events.
|
|
54
|
+
* If the chat is saved, the savedChatId is initialized with the value of this chatId.
|
|
55
|
+
*/
|
|
56
|
+
private _chatId;
|
|
57
|
+
userSettingsService: UserSettingsWebService;
|
|
58
|
+
notificationsService: NotificationsService;
|
|
59
|
+
appService: AppService;
|
|
60
|
+
modalService: DialogService;
|
|
61
|
+
principalService: PrincipalService;
|
|
62
|
+
protected readonly transloco: TranslocoService;
|
|
63
|
+
/**
|
|
64
|
+
* Initialize the chat process
|
|
65
|
+
*/
|
|
66
|
+
abstract init(): Observable<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* Initialize the REQUEST_URL
|
|
69
|
+
*/
|
|
70
|
+
abstract getRequestsUrl(): void;
|
|
71
|
+
get assistants(): any;
|
|
72
|
+
/**
|
|
73
|
+
* Get the instance ID of the chat service
|
|
74
|
+
* @returns The instance ID of the chat service
|
|
75
|
+
*/
|
|
76
|
+
get chatInstanceId(): string;
|
|
77
|
+
/**
|
|
78
|
+
* Persist the instance ID of the chat service
|
|
79
|
+
* @param instanceId The instance ID of the chat service
|
|
80
|
+
*/
|
|
81
|
+
setChatInstanceId(instanceId: string): void;
|
|
82
|
+
/**
|
|
83
|
+
* Get the ID of the current chat discussion which is used to save/get/delete it
|
|
84
|
+
* @returns The ID of the current chat discussion
|
|
85
|
+
*/
|
|
86
|
+
get savedChatId(): string | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Persist the ID of the current chat discussion which is used to save/get/delete it
|
|
89
|
+
* @param savedChatId The ID of the current chat discussion which is used to save/get/delete it
|
|
90
|
+
*/
|
|
91
|
+
setSavedChatId(savedChatId: string | undefined): void;
|
|
92
|
+
/**
|
|
93
|
+
* Get the ID of the current chat discussion which is used to identify audit events
|
|
94
|
+
* @returns The ID of the current chat discussion
|
|
95
|
+
*/
|
|
96
|
+
get chatId(): string;
|
|
97
|
+
/**
|
|
98
|
+
* Generate an GUID for the current chat discussion which is used to identify audit events
|
|
99
|
+
* If the discussion is saved, the savedChatId is initialized with the value of this chatId
|
|
100
|
+
* @param chatId if provided, it will be considered as the ID of the current chat discussion which is used to identify audit events
|
|
101
|
+
*/
|
|
102
|
+
generateChatId(chatId?: string): void;
|
|
103
|
+
/**
|
|
104
|
+
* Initialize the chat config by managing ONLY sub-object **defaultValues** configs of the standard app config (defined in the customization json tab ) and the user preferences.
|
|
105
|
+
* To do so, a tracking mechanism is implemented to notify the user about the available updates in the defaultValues object of the standard app config.
|
|
106
|
+
* The rest of the config object coming from "standard app config" is used as it is without any override.
|
|
107
|
+
* Thus, the user preferences are used only for the defaultValues object.
|
|
108
|
+
* This provide a centralized way to manage the rest of the config object by admins and ensure a unique common behavior for all users.
|
|
109
|
+
*/
|
|
110
|
+
initChatConfig(): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Update the chat config and store its defaultValues in the user preferences
|
|
113
|
+
* @param config The updated chat config
|
|
114
|
+
* @param hashes The updated hashes to store in the user preferences
|
|
115
|
+
* @param notify Whether to notify the user about the update
|
|
116
|
+
* @param successCallback The callback to execute if the update is successful
|
|
117
|
+
* @param errorCallback The callback to execute if the update fails
|
|
118
|
+
*/
|
|
119
|
+
updateChatConfig(config: ChatConfig, hashes?: {
|
|
120
|
+
"applied-defaultValues-hash"?: string;
|
|
121
|
+
"skipped-defaultValues-hash"?: string;
|
|
122
|
+
}, notify?: boolean, successCallback?: () => any, errorCallback?: () => any): void;
|
|
123
|
+
/**
|
|
124
|
+
* Overrides the logged in user
|
|
125
|
+
*/
|
|
126
|
+
abstract overrideUser(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Calls the Fetch API to retrieve a new message given all previous messages
|
|
129
|
+
*/
|
|
130
|
+
abstract fetch(messages: ChatMessage[], query: Query): Observable<ChatResponse>;
|
|
131
|
+
/**
|
|
132
|
+
* Return the list of models available on the server
|
|
133
|
+
*/
|
|
134
|
+
abstract listModels(): Observable<GllmModelDescription[] | undefined>;
|
|
135
|
+
/**
|
|
136
|
+
* Return the list of functions available on the server AND matching enabled functions in the chat config
|
|
137
|
+
*/
|
|
138
|
+
abstract listFunctions(): Observable<GllmFunction[] | undefined>;
|
|
139
|
+
/**
|
|
140
|
+
* Stops the assistant answer generation and cancels all the ongoing and pending related tasks
|
|
141
|
+
*/
|
|
142
|
+
abstract stopGeneration(): Observable<any>;
|
|
143
|
+
/**
|
|
144
|
+
* A handler for quota updates each time the chat is invoked.
|
|
145
|
+
* It emits the updated quota to the quota$ subject, emits accordingly the updated user's tokens consumption and notifies the user if the max quota is reached.
|
|
146
|
+
* @param quota The updated quota
|
|
147
|
+
* @param propagateError Whether to propagate the error to the caller
|
|
148
|
+
*/
|
|
149
|
+
updateQuota(quota: Quota, propagateError?: boolean): void;
|
|
150
|
+
/**
|
|
151
|
+
* A handler for chat usage metrics each time the generation of the assistant response is completed.
|
|
152
|
+
* It emits the chat usage metrics to the chatUsageMetrics$ subject, emits accordingly the updated chat's tokens consumption
|
|
153
|
+
* @param chatUsageMetrics The chat usage metrics
|
|
154
|
+
*/
|
|
155
|
+
updateChatUsageMetrics(chatUsageMetrics: ChatUsageMetrics): void;
|
|
156
|
+
/**
|
|
157
|
+
* Get the model description for the given (serviceId + modelId)
|
|
158
|
+
* If a model is not found, an error message is returned
|
|
159
|
+
* @param serviceId The serviceId of the model
|
|
160
|
+
* @param modelId The modelId of the model
|
|
161
|
+
* @returns The model description
|
|
162
|
+
*/
|
|
163
|
+
getModel(serviceId: string, modelId: string): GllmModelDescription | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Fetch the list saved chats belonging to a specific instance of the assistant
|
|
166
|
+
*/
|
|
167
|
+
abstract listSavedChat(): void;
|
|
168
|
+
/**
|
|
169
|
+
* Return the saved chat with the given id, if exists. Otherwise, return undefined
|
|
170
|
+
* @param id The id of the saved chat
|
|
171
|
+
*/
|
|
172
|
+
abstract getSavedChat(id: string): Observable<SavedChatHistory | undefined>;
|
|
173
|
+
/**
|
|
174
|
+
* Save a chat with the given messages
|
|
175
|
+
* @param messages The messages to add to the saved chat index
|
|
176
|
+
* @returns The saved chat
|
|
177
|
+
*/
|
|
178
|
+
abstract addSavedChat(messages: ChatMessage[]): Observable<SavedChatResponse>;
|
|
179
|
+
/**
|
|
180
|
+
* Update a saved chat with the given id.
|
|
181
|
+
* @param id The id of the saved chat
|
|
182
|
+
* @param name The new name of the saved chat, if provided
|
|
183
|
+
* @param messages The messages to update the saved chat history, if provided
|
|
184
|
+
* @returns True if the saved chat has been successfully updated
|
|
185
|
+
*/
|
|
186
|
+
abstract updateSavedChat(id: string, name?: string, messages?: ChatMessage[]): Observable<SavedChatResponse>;
|
|
187
|
+
/**
|
|
188
|
+
* Bulk delete of saved chats matching the given ids
|
|
189
|
+
* @param ids List of ids of the saved chats to delete
|
|
190
|
+
* @returns The number of deleted chats
|
|
191
|
+
*/
|
|
192
|
+
abstract deleteSavedChat(ids: string[]): Observable<DeleteSavedChatResponse>;
|
|
193
|
+
/**
|
|
194
|
+
* Generate an audit event with the given type and details. The generated audit event is sent afterwards via the AuditWebService
|
|
195
|
+
* @param type Audit event type
|
|
196
|
+
* @param details Audit event details
|
|
197
|
+
* @param id Actions (savedChat delete/rename/...) may occur on a specific chat different than the current one stored in this service, so the chat id can be provided
|
|
198
|
+
*/
|
|
199
|
+
generateAuditEvent(type: string, details: Record<string, any>, id?: string): Promise<void>;
|
|
200
|
+
/**
|
|
201
|
+
* Traverse the array from the end and track the first 'assistant' message among the last group of "assistant" messages where display is true
|
|
202
|
+
* @param array The array of ChatMessage to traverse
|
|
203
|
+
* @returns The index of the first visible assistant message among the last group of "assistant" messages in the array
|
|
204
|
+
*/
|
|
205
|
+
firstVisibleAssistantMessageIndex(array: ChatMessage[] | undefined): number;
|
|
206
|
+
/**
|
|
207
|
+
* Traverse the array from the end and pick the last 'assistant' message among the last group of "assistant" messages where display is true
|
|
208
|
+
* @param array The array of ChatMessage to traverse
|
|
209
|
+
* @returns The index of the last visible assistant message among the last group of "assistant" messages in the array
|
|
210
|
+
*/
|
|
211
|
+
lastVisibleAssistantMessageIndex(array: ChatMessage[] | undefined): number;
|
|
212
|
+
/**
|
|
213
|
+
* Format a date string in UTC to a local date string
|
|
214
|
+
* @param value Date string in UTC to format
|
|
215
|
+
* @returns A formatted local date string
|
|
216
|
+
*/
|
|
217
|
+
protected formatDateTime(value: string): string;
|
|
218
|
+
/**
|
|
219
|
+
* Takes a text prompt that may contain placeholders for variables
|
|
220
|
+
* and replaces these placeholders if it finds a match in the given
|
|
221
|
+
* context object.
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* const p = "Hello, [[user.name]]! You have [[user.notifications.length]] new notifications.";
|
|
225
|
+
* const context = {
|
|
226
|
+
* user: {
|
|
227
|
+
* name: "Alice",
|
|
228
|
+
* notifications: ["Message from Bob", "Reminder for meeting"]
|
|
229
|
+
* }
|
|
230
|
+
* };
|
|
231
|
+
* const formattedPrompt = formatPrompt(p, context);
|
|
232
|
+
* console.log(formattedPrompt); // Output: "Hello, Alice! You have 2 new notifications."
|
|
233
|
+
*/
|
|
234
|
+
static formatPrompt(prompt: string, context: any): string;
|
|
235
|
+
/**
|
|
236
|
+
* Determines a time-based key for a given date to be used for translations or formatting.
|
|
237
|
+
* The key represents a relative time period such as "today", "yesterday", "this week", etc.
|
|
238
|
+
* If the date does not fall into any predefined relative time period, it returns the year as a string.
|
|
239
|
+
*
|
|
240
|
+
* @param date - The date for which the time key is to be determined.
|
|
241
|
+
* @returns A string representing the time key, which can be used for translation or display purposes.
|
|
242
|
+
*/
|
|
243
|
+
getTimeKey(date: Date): string;
|
|
244
|
+
getCurrentLocaleName(): string;
|
|
245
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatService, never>;
|
|
246
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ChatService>;
|
|
247
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { AfterViewInit } from "@angular/core";
|
|
2
|
-
import { DebugMessage } from "../types";
|
|
3
|
-
import { UIService } from "
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class DebugMessageComponent implements AfterViewInit {
|
|
6
|
-
ui: UIService;
|
|
7
|
-
data: DebugMessage[] | undefined;
|
|
8
|
-
level: number;
|
|
9
|
-
parentColor: string;
|
|
10
|
-
constructor(ui: UIService);
|
|
11
|
-
ngAfterViewInit(): void;
|
|
12
|
-
isObject(value: any): boolean;
|
|
13
|
-
getRowClass(item: DebugMessage, index: number): string;
|
|
14
|
-
copyToClipboard(code: any): void;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DebugMessageComponent, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DebugMessageComponent, "sq-debug-message", never, { "data": "data"; "level": "level"; "parentColor": "parentColor"; }, {}, never, never, true>;
|
|
17
|
-
}
|
|
1
|
+
import { AfterViewInit } from "@angular/core";
|
|
2
|
+
import { DebugMessage } from "../types";
|
|
3
|
+
import { UIService } from "../services/ui.service";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DebugMessageComponent implements AfterViewInit {
|
|
6
|
+
ui: UIService;
|
|
7
|
+
data: DebugMessage[] | undefined;
|
|
8
|
+
level: number;
|
|
9
|
+
parentColor: string;
|
|
10
|
+
constructor(ui: UIService);
|
|
11
|
+
ngAfterViewInit(): void;
|
|
12
|
+
isObject(value: any): boolean;
|
|
13
|
+
getRowClass(item: DebugMessage, index: number): string;
|
|
14
|
+
copyToClipboard(code: any): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DebugMessageComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DebugMessageComponent, "sq-debug-message", never, { "data": { "alias": "data"; "required": false; }; "level": { "alias": "level"; "required": false; }; "parentColor": { "alias": "parentColor"; "required": false; }; }, {}, never, never, true, never>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ElementRef } from "@angular/core";
|
|
2
|
+
import { Subscription } from "rxjs";
|
|
3
|
+
import { ChatService } from "../chat.service";
|
|
4
|
+
import { NotificationsService } from "../services/notification.service";
|
|
5
|
+
import { SavedChat } from "../types";
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export type SavedChatEdit = SavedChat & {
|
|
8
|
+
currentTitle: string;
|
|
9
|
+
};
|
|
10
|
+
export declare class DialogDeleteSavedChatComponent {
|
|
11
|
+
deleteDialog: import("@angular/core").Signal<ElementRef<HTMLDialogElement> | undefined>;
|
|
12
|
+
notificationsService: NotificationsService;
|
|
13
|
+
private readonly transloco;
|
|
14
|
+
chatService: import("@angular/core").InputSignal<ChatService>;
|
|
15
|
+
delete: import("@angular/core").OutputEmitterRef<SavedChat>;
|
|
16
|
+
savedChat: import("@angular/core").WritableSignal<SavedChatEdit>;
|
|
17
|
+
subscription: Subscription;
|
|
18
|
+
showModal(event: Event, savedChat: SavedChat): void;
|
|
19
|
+
protected onDelete(event: Event, savedChat: SavedChat): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogDeleteSavedChatComponent, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DialogDeleteSavedChatComponent, "sq-dialog-delete-saved-chat", never, { "chatService": { "alias": "chatService"; "required": true; "isSignal": true; }; }, { "delete": "delete"; }, never, never, true, never>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deleteSavedDiscussion": "Delete discussion",
|
|
3
|
+
"deleteSavedDiscussionText": "You are about to delete the discussion",
|
|
4
|
+
"deleteSavedDiscussionConfirm": "Do you want to continue?",
|
|
5
|
+
"cancel": "Cancel",
|
|
6
|
+
"confirm": "Confirm",
|
|
7
|
+
"deleteSavedDiscussionSuccess": "The discussion '{{title}}' has been successfully deleted.",
|
|
8
|
+
"deleteSavedDiscussionError": "An error occurred while deleting the discussion '{{title}}'.",
|
|
9
|
+
"renameSavedDiscussion": "Rename discussion",
|
|
10
|
+
"renameSavedDiscussionText": "Please enter a new name for the discussion",
|
|
11
|
+
"rename": "Rename",
|
|
12
|
+
"renameSavedDiscussionSuccess": "The discussion '{{currentTitle}}' has been successfully renamed to '{{title}}'.",
|
|
13
|
+
"renameSavedDiscussionError": "An error occurred while renaming the discussion '{{currentTitle}}'.",
|
|
14
|
+
"availableUpdates": "Available updates!",
|
|
15
|
+
"availableUpdatesText": "Changes have been made to the default configuration. Do you want to update your own version?",
|
|
16
|
+
"seeNoMore": "See no more",
|
|
17
|
+
"remindMeLater": "Remind me later",
|
|
18
|
+
"update": "Update"
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deleteSavedDiscussion": "Supprimer la discussion",
|
|
3
|
+
"deleteSavedDiscussionText": "Vous êtes sur le point de supprimer la discussion",
|
|
4
|
+
"deleteSavedDiscussionConfirm": "Voulez-vous continuer ?",
|
|
5
|
+
"cancel": "Annuler",
|
|
6
|
+
"confirm": "Confirmer",
|
|
7
|
+
"deleteSavedDiscussionSuccess": "La discussion '{{title}}' a été supprimée avec succès.",
|
|
8
|
+
"deleteSavedDiscussionError": "Une erreur s'est produite lors de la suppression de la discussion '{{title}}'.",
|
|
9
|
+
"renameSavedDiscussion": "Renommer la discussion",
|
|
10
|
+
"renameSavedDiscussionText": "Veuillez entrer un nouveau nom pour la discussion",
|
|
11
|
+
"rename": "Renommer",
|
|
12
|
+
"renameSavedDiscussionSuccess": "La discussion '{{currentTitle}}' a été renommée avec succès en '{{title}}'.",
|
|
13
|
+
"renameSavedDiscussionError": "Une erreur s'est produite lors du renommage de la discussion '{{currentTitle}}'.",
|
|
14
|
+
"availableUpdates": "Mises à jour disponibles!",
|
|
15
|
+
"availableUpdatesText": "Des modifications ont été apportées à la configuration par défaut. Voulez-vous mettre à jour votre propre version?",
|
|
16
|
+
"seeNoMore": "Ne plus voir",
|
|
17
|
+
"remindMeLater": "Me le rappeler plus tard",
|
|
18
|
+
"update": "Mettre à jour"
|
|
19
|
+
}
|