@sinequa/assistant 3.7.4 → 3.8.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 (32) hide show
  1. package/chat/chat-settings-v3/chat-settings-v3.component.d.ts +6 -5
  2. package/chat/chat.component.d.ts +11 -7
  3. package/chat/chat.service.d.ts +5 -5
  4. package/chat/documents-upload/document-list/document-list.component.d.ts +77 -0
  5. package/chat/documents-upload/document-overview/document-overview.component.d.ts +41 -0
  6. package/chat/documents-upload/document-upload/document-upload.component.d.ts +98 -0
  7. package/chat/documents-upload/documents-upload.model.d.ts +66 -0
  8. package/chat/documents-upload/documents-upload.service.d.ts +174 -0
  9. package/chat/public-api.d.ts +5 -0
  10. package/chat/styles/assistant.scss +2 -0
  11. package/chat/types.d.ts +77 -21
  12. package/chat/websocket-chat.service.d.ts +4 -4
  13. package/esm2020/chat/chat-message/chat-message.component.mjs +3 -3
  14. package/esm2020/chat/chat-reference/chat-reference.component.mjs +3 -3
  15. package/esm2020/chat/chat-settings-v3/chat-settings-v3.component.mjs +13 -10
  16. package/esm2020/chat/chat.component.mjs +25 -17
  17. package/esm2020/chat/chat.service.mjs +9 -9
  18. package/esm2020/chat/documents-upload/document-list/document-list.component.mjs +191 -0
  19. package/esm2020/chat/documents-upload/document-overview/document-overview.component.mjs +80 -0
  20. package/esm2020/chat/documents-upload/document-upload/document-upload.component.mjs +258 -0
  21. package/esm2020/chat/documents-upload/documents-upload.model.mjs +2 -0
  22. package/esm2020/chat/documents-upload/documents-upload.service.mjs +289 -0
  23. package/esm2020/chat/public-api.mjs +6 -1
  24. package/esm2020/chat/saved-chats/saved-chats.component.mjs +4 -4
  25. package/esm2020/chat/token-progress-bar/token-progress-bar.component.mjs +3 -3
  26. package/esm2020/chat/types.mjs +17 -6
  27. package/esm2020/chat/websocket-chat.service.mjs +3 -3
  28. package/fesm2015/sinequa-assistant-chat.mjs +3654 -2859
  29. package/fesm2015/sinequa-assistant-chat.mjs.map +1 -1
  30. package/fesm2020/sinequa-assistant-chat.mjs +3639 -2845
  31. package/fesm2020/sinequa-assistant-chat.mjs.map +1 -1
  32. package/package.json +4 -2
package/chat/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { Record } from "@sinequa/core/web-services";
3
2
  import { Query } from '@sinequa/core/app-utils';
3
+ import { Record } from "@sinequa/core/web-services";
4
4
  /**
5
5
  * Individual message sent & returned by the ChatGPT API.
6
6
  * If this message is an attachment, we attach the minimal
@@ -87,7 +87,7 @@ export interface ChatResponse extends RawResponse {
87
87
  */
88
88
  export interface GllmModelDescription {
89
89
  provider: string;
90
- displayName: string;
90
+ name: string;
91
91
  serviceId: string;
92
92
  modelId: string;
93
93
  enable: boolean;
@@ -194,12 +194,11 @@ declare const uiSettingsSchema: z.ZodObject<{
194
194
  temperature: z.ZodBoolean;
195
195
  top_p: z.ZodBoolean;
196
196
  max_tokens: z.ZodBoolean;
197
- debug: z.ZodBoolean;
197
+ debug: z.ZodOptional<z.ZodBoolean>;
198
198
  displaySystemPrompt: z.ZodBoolean;
199
199
  displayUserPrompt: z.ZodBoolean;
200
200
  }, "strip", z.ZodTypeAny, {
201
201
  display: boolean;
202
- debug: boolean;
203
202
  temperature: boolean;
204
203
  top_p: boolean;
205
204
  max_tokens: boolean;
@@ -207,9 +206,9 @@ declare const uiSettingsSchema: z.ZodObject<{
207
206
  functions: boolean;
208
207
  displaySystemPrompt: boolean;
209
208
  displayUserPrompt: boolean;
209
+ debug?: boolean | undefined;
210
210
  }, {
211
211
  display: boolean;
212
- debug: boolean;
213
212
  temperature: boolean;
214
213
  top_p: boolean;
215
214
  max_tokens: boolean;
@@ -217,6 +216,7 @@ declare const uiSettingsSchema: z.ZodObject<{
217
216
  functions: boolean;
218
217
  displaySystemPrompt: boolean;
219
218
  displayUserPrompt: boolean;
219
+ debug?: boolean | undefined;
220
220
  }>;
221
221
  export interface UiSettings extends z.infer<typeof uiSettingsSchema> {
222
222
  }
@@ -236,11 +236,10 @@ declare const defaultValuesSchema: z.ZodObject<{
236
236
  temperature: z.ZodNumber;
237
237
  top_p: z.ZodNumber;
238
238
  max_tokens: z.ZodNumber;
239
- debug: z.ZodBoolean;
239
+ debug: z.ZodOptional<z.ZodBoolean>;
240
240
  systemPrompt: z.ZodString;
241
241
  userPrompt: z.ZodString;
242
242
  }, "strip", z.ZodTypeAny, {
243
- debug: boolean;
244
243
  service_id: string;
245
244
  model_id: string;
246
245
  temperature: number;
@@ -252,8 +251,8 @@ declare const defaultValuesSchema: z.ZodObject<{
252
251
  }[];
253
252
  systemPrompt: string;
254
253
  userPrompt: string;
254
+ debug?: boolean | undefined;
255
255
  }, {
256
- debug: boolean;
257
256
  service_id: string;
258
257
  model_id: string;
259
258
  temperature: number;
@@ -265,6 +264,7 @@ declare const defaultValuesSchema: z.ZodObject<{
265
264
  }[];
266
265
  systemPrompt: string;
267
266
  userPrompt: string;
267
+ debug?: boolean | undefined;
268
268
  }>;
269
269
  export interface DefaultValues extends z.infer<typeof defaultValuesSchema> {
270
270
  }
@@ -272,25 +272,50 @@ declare const modeSettingsSchema: z.ZodObject<{
272
272
  enabledUserInput: z.ZodBoolean;
273
273
  displayUserPrompt: z.ZodBoolean;
274
274
  sendUserPrompt: z.ZodBoolean;
275
- initialization: z.ZodEffects<z.ZodObject<{
275
+ initialization: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
276
276
  event: z.ZodEnum<["Query", "Prompt"]>;
277
277
  forcedWorkflow: z.ZodOptional<z.ZodString>;
278
+ forcedFunction: z.ZodOptional<z.ZodString>;
278
279
  displayUserQuery: z.ZodOptional<z.ZodBoolean>;
279
280
  }, "strip", z.ZodTypeAny, {
280
281
  event: "Query" | "Prompt";
281
282
  forcedWorkflow?: string | undefined;
283
+ forcedFunction?: string | undefined;
284
+ displayUserQuery?: boolean | undefined;
285
+ }, {
286
+ event: "Query" | "Prompt";
287
+ forcedWorkflow?: string | undefined;
288
+ forcedFunction?: string | undefined;
289
+ displayUserQuery?: boolean | undefined;
290
+ }>, {
291
+ event: "Query" | "Prompt";
292
+ forcedWorkflow?: string | undefined;
293
+ forcedFunction?: string | undefined;
294
+ displayUserQuery?: boolean | undefined;
295
+ }, {
296
+ event: "Query" | "Prompt";
297
+ forcedWorkflow?: string | undefined;
298
+ forcedFunction?: string | undefined;
299
+ displayUserQuery?: boolean | undefined;
300
+ }>, {
301
+ event: "Query" | "Prompt";
302
+ forcedWorkflow?: string | undefined;
303
+ forcedFunction?: string | undefined;
282
304
  displayUserQuery?: boolean | undefined;
283
305
  }, {
284
306
  event: "Query" | "Prompt";
285
307
  forcedWorkflow?: string | undefined;
308
+ forcedFunction?: string | undefined;
286
309
  displayUserQuery?: boolean | undefined;
287
310
  }>, {
288
311
  event: "Query" | "Prompt";
289
312
  forcedWorkflow?: string | undefined;
313
+ forcedFunction?: string | undefined;
290
314
  displayUserQuery?: boolean | undefined;
291
315
  }, {
292
316
  event: "Query" | "Prompt";
293
317
  forcedWorkflow?: string | undefined;
318
+ forcedFunction?: string | undefined;
294
319
  displayUserQuery?: boolean | undefined;
295
320
  }>;
296
321
  actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -310,6 +335,7 @@ declare const modeSettingsSchema: z.ZodObject<{
310
335
  initialization: {
311
336
  event: "Query" | "Prompt";
312
337
  forcedWorkflow?: string | undefined;
338
+ forcedFunction?: string | undefined;
313
339
  displayUserQuery?: boolean | undefined;
314
340
  };
315
341
  actions?: globalThis.Record<string, {
@@ -323,6 +349,7 @@ declare const modeSettingsSchema: z.ZodObject<{
323
349
  initialization: {
324
350
  event: "Query" | "Prompt";
325
351
  forcedWorkflow?: string | undefined;
352
+ forcedFunction?: string | undefined;
326
353
  displayUserQuery?: boolean | undefined;
327
354
  };
328
355
  actions?: globalThis.Record<string, {
@@ -399,11 +426,10 @@ export declare const chatConfigSchema: z.ZodObject<{
399
426
  temperature: z.ZodNumber;
400
427
  top_p: z.ZodNumber;
401
428
  max_tokens: z.ZodNumber;
402
- debug: z.ZodBoolean;
429
+ debug: z.ZodOptional<z.ZodBoolean>;
403
430
  systemPrompt: z.ZodString;
404
431
  userPrompt: z.ZodString;
405
432
  }, "strip", z.ZodTypeAny, {
406
- debug: boolean;
407
433
  service_id: string;
408
434
  model_id: string;
409
435
  temperature: number;
@@ -415,8 +441,8 @@ export declare const chatConfigSchema: z.ZodObject<{
415
441
  }[];
416
442
  systemPrompt: string;
417
443
  userPrompt: string;
444
+ debug?: boolean | undefined;
418
445
  }, {
419
- debug: boolean;
420
446
  service_id: string;
421
447
  model_id: string;
422
448
  temperature: number;
@@ -428,30 +454,56 @@ export declare const chatConfigSchema: z.ZodObject<{
428
454
  }[];
429
455
  systemPrompt: string;
430
456
  userPrompt: string;
457
+ debug?: boolean | undefined;
431
458
  }>;
432
459
  modeSettings: z.ZodObject<{
433
460
  enabledUserInput: z.ZodBoolean;
434
461
  displayUserPrompt: z.ZodBoolean;
435
462
  sendUserPrompt: z.ZodBoolean;
436
- initialization: z.ZodEffects<z.ZodObject<{
463
+ initialization: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
437
464
  event: z.ZodEnum<["Query", "Prompt"]>;
438
465
  forcedWorkflow: z.ZodOptional<z.ZodString>;
466
+ forcedFunction: z.ZodOptional<z.ZodString>;
439
467
  displayUserQuery: z.ZodOptional<z.ZodBoolean>;
440
468
  }, "strip", z.ZodTypeAny, {
441
469
  event: "Query" | "Prompt";
442
470
  forcedWorkflow?: string | undefined;
471
+ forcedFunction?: string | undefined;
472
+ displayUserQuery?: boolean | undefined;
473
+ }, {
474
+ event: "Query" | "Prompt";
475
+ forcedWorkflow?: string | undefined;
476
+ forcedFunction?: string | undefined;
477
+ displayUserQuery?: boolean | undefined;
478
+ }>, {
479
+ event: "Query" | "Prompt";
480
+ forcedWorkflow?: string | undefined;
481
+ forcedFunction?: string | undefined;
482
+ displayUserQuery?: boolean | undefined;
483
+ }, {
484
+ event: "Query" | "Prompt";
485
+ forcedWorkflow?: string | undefined;
486
+ forcedFunction?: string | undefined;
487
+ displayUserQuery?: boolean | undefined;
488
+ }>, {
489
+ event: "Query" | "Prompt";
490
+ forcedWorkflow?: string | undefined;
491
+ forcedFunction?: string | undefined;
443
492
  displayUserQuery?: boolean | undefined;
444
493
  }, {
445
494
  event: "Query" | "Prompt";
446
495
  forcedWorkflow?: string | undefined;
496
+ forcedFunction?: string | undefined;
447
497
  displayUserQuery?: boolean | undefined;
448
498
  }>, {
449
499
  event: "Query" | "Prompt";
450
500
  forcedWorkflow?: string | undefined;
501
+ forcedFunction?: string | undefined;
451
502
  displayUserQuery?: boolean | undefined;
452
503
  }, {
453
504
  event: "Query" | "Prompt";
454
505
  forcedWorkflow?: string | undefined;
506
+ forcedFunction?: string | undefined;
455
507
  displayUserQuery?: boolean | undefined;
456
508
  }>;
457
509
  actions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -471,6 +523,7 @@ export declare const chatConfigSchema: z.ZodObject<{
471
523
  initialization: {
472
524
  event: "Query" | "Prompt";
473
525
  forcedWorkflow?: string | undefined;
526
+ forcedFunction?: string | undefined;
474
527
  displayUserQuery?: boolean | undefined;
475
528
  };
476
529
  actions?: globalThis.Record<string, {
@@ -484,6 +537,7 @@ export declare const chatConfigSchema: z.ZodObject<{
484
537
  initialization: {
485
538
  event: "Query" | "Prompt";
486
539
  forcedWorkflow?: string | undefined;
540
+ forcedFunction?: string | undefined;
487
541
  displayUserQuery?: boolean | undefined;
488
542
  };
489
543
  actions?: globalThis.Record<string, {
@@ -498,12 +552,11 @@ export declare const chatConfigSchema: z.ZodObject<{
498
552
  temperature: z.ZodBoolean;
499
553
  top_p: z.ZodBoolean;
500
554
  max_tokens: z.ZodBoolean;
501
- debug: z.ZodBoolean;
555
+ debug: z.ZodOptional<z.ZodBoolean>;
502
556
  displaySystemPrompt: z.ZodBoolean;
503
557
  displayUserPrompt: z.ZodBoolean;
504
558
  }, "strip", z.ZodTypeAny, {
505
559
  display: boolean;
506
- debug: boolean;
507
560
  temperature: boolean;
508
561
  top_p: boolean;
509
562
  max_tokens: boolean;
@@ -511,9 +564,9 @@ export declare const chatConfigSchema: z.ZodObject<{
511
564
  functions: boolean;
512
565
  displaySystemPrompt: boolean;
513
566
  displayUserPrompt: boolean;
567
+ debug?: boolean | undefined;
514
568
  }, {
515
569
  display: boolean;
516
- debug: boolean;
517
570
  temperature: boolean;
518
571
  top_p: boolean;
519
572
  max_tokens: boolean;
@@ -521,6 +574,7 @@ export declare const chatConfigSchema: z.ZodObject<{
521
574
  functions: boolean;
522
575
  displaySystemPrompt: boolean;
523
576
  displayUserPrompt: boolean;
577
+ debug?: boolean | undefined;
524
578
  }>;
525
579
  savedChatSettings: z.ZodObject<{
526
580
  enabled: z.ZodBoolean;
@@ -571,7 +625,6 @@ export declare const chatConfigSchema: z.ZodObject<{
571
625
  signalRServerTimeoutInMilliseconds?: number | undefined;
572
626
  };
573
627
  defaultValues: {
574
- debug: boolean;
575
628
  service_id: string;
576
629
  model_id: string;
577
630
  temperature: number;
@@ -583,6 +636,7 @@ export declare const chatConfigSchema: z.ZodObject<{
583
636
  }[];
584
637
  systemPrompt: string;
585
638
  userPrompt: string;
639
+ debug?: boolean | undefined;
586
640
  };
587
641
  modeSettings: {
588
642
  displayUserPrompt: boolean;
@@ -591,6 +645,7 @@ export declare const chatConfigSchema: z.ZodObject<{
591
645
  initialization: {
592
646
  event: "Query" | "Prompt";
593
647
  forcedWorkflow?: string | undefined;
648
+ forcedFunction?: string | undefined;
594
649
  displayUserQuery?: boolean | undefined;
595
650
  };
596
651
  actions?: globalThis.Record<string, {
@@ -600,7 +655,6 @@ export declare const chatConfigSchema: z.ZodObject<{
600
655
  };
601
656
  uiSettings: {
602
657
  display: boolean;
603
- debug: boolean;
604
658
  temperature: boolean;
605
659
  top_p: boolean;
606
660
  max_tokens: boolean;
@@ -608,6 +662,7 @@ export declare const chatConfigSchema: z.ZodObject<{
608
662
  functions: boolean;
609
663
  displaySystemPrompt: boolean;
610
664
  displayUserPrompt: boolean;
665
+ debug?: boolean | undefined;
611
666
  };
612
667
  savedChatSettings: {
613
668
  display: boolean;
@@ -635,7 +690,6 @@ export declare const chatConfigSchema: z.ZodObject<{
635
690
  signalRServerTimeoutInMilliseconds?: number | undefined;
636
691
  };
637
692
  defaultValues: {
638
- debug: boolean;
639
693
  service_id: string;
640
694
  model_id: string;
641
695
  temperature: number;
@@ -647,6 +701,7 @@ export declare const chatConfigSchema: z.ZodObject<{
647
701
  }[];
648
702
  systemPrompt: string;
649
703
  userPrompt: string;
704
+ debug?: boolean | undefined;
650
705
  };
651
706
  modeSettings: {
652
707
  displayUserPrompt: boolean;
@@ -655,6 +710,7 @@ export declare const chatConfigSchema: z.ZodObject<{
655
710
  initialization: {
656
711
  event: "Query" | "Prompt";
657
712
  forcedWorkflow?: string | undefined;
713
+ forcedFunction?: string | undefined;
658
714
  displayUserQuery?: boolean | undefined;
659
715
  };
660
716
  actions?: globalThis.Record<string, {
@@ -664,7 +720,6 @@ export declare const chatConfigSchema: z.ZodObject<{
664
720
  };
665
721
  uiSettings: {
666
722
  display: boolean;
667
- debug: boolean;
668
723
  temperature: boolean;
669
724
  top_p: boolean;
670
725
  max_tokens: boolean;
@@ -672,6 +727,7 @@ export declare const chatConfigSchema: z.ZodObject<{
672
727
  functions: boolean;
673
728
  displaySystemPrompt: boolean;
674
729
  displayUserPrompt: boolean;
730
+ debug?: boolean | undefined;
675
731
  };
676
732
  savedChatSettings: {
677
733
  display: boolean;
@@ -692,7 +748,7 @@ export declare const chatConfigSchema: z.ZodObject<{
692
748
  export interface ChatConfig extends z.infer<typeof chatConfigSchema> {
693
749
  }
694
750
  export interface ChatPayload {
695
- debug: boolean;
751
+ debug?: boolean;
696
752
  functions: string[];
697
753
  history: ChatMessage[];
698
754
  serviceSettings: ServiceSettings;
@@ -1,10 +1,10 @@
1
+ import { HubConnection } from "@microsoft/signalr";
2
+ import { Observable } from "rxjs";
3
+ import { Query } from "@sinequa/core/app-utils";
1
4
  import { AuthenticationService } from "@sinequa/core/login";
2
5
  import { ConnectionOptions, SignalRWebService } from "@sinequa/core/web-services";
3
- import { Query } from "@sinequa/core/app-utils";
4
- import { HubConnection } from "@microsoft/signalr";
5
- import { ChatMessage, ChatResponse, GllmFunction, GllmModelDescription, MessageHandler, SavedChatHistory, SavedChat } from "./types";
6
6
  import { ChatService } from "./chat.service";
7
- import { Observable } from "rxjs";
7
+ import { ChatMessage, ChatResponse, GllmFunction, GllmModelDescription, MessageHandler, SavedChat, SavedChatHistory } from "./types";
8
8
  import * as i0 from "@angular/core";
9
9
  export declare class WebSocketChatService extends ChatService {
10
10
  connection: HubConnection | undefined;