@sinequa/assistant 3.1.1
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/chat-message/chat-message.component.d.ts +157 -0
- package/chat/chat-reference/chat-reference.component.d.ts +118 -0
- package/chat/chat-settings-v3/chat-settings-v3.component.d.ts +41 -0
- package/chat/chat.component.d.ts +1112 -0
- package/chat/chat.service.d.ts +1046 -0
- package/chat/format-icon/format-icon.component.d.ts +10 -0
- package/chat/format-icon/icons.d.ts +5 -0
- package/chat/index.d.ts +5 -0
- package/chat/initials-avatar/initials-avatar.component.d.ts +35 -0
- package/chat/instance-manager.service.d.ts +28 -0
- package/chat/messages/de.d.ts +4 -0
- package/chat/messages/en.d.ts +4 -0
- package/chat/messages/fr.d.ts +4 -0
- package/chat/messages/index.d.ts +4 -0
- package/chat/public-api.d.ts +11 -0
- package/chat/rest-chat.service.d.ts +28 -0
- package/chat/saved-chats/saved-chats.component.d.ts +37 -0
- package/chat/styles/assistant.scss +61 -0
- package/chat/styles/references.scss +23 -0
- package/chat/types.d.ts +1241 -0
- package/chat/websocket-chat.service.d.ts +97 -0
- package/esm2020/chat/chat-message/chat-message.component.mjs +181 -0
- package/esm2020/chat/chat-reference/chat-reference.component.mjs +40 -0
- package/esm2020/chat/chat-settings-v3/chat-settings-v3.component.mjs +103 -0
- package/esm2020/chat/chat.component.mjs +369 -0
- package/esm2020/chat/chat.service.mjs +185 -0
- package/esm2020/chat/format-icon/format-icon.component.mjs +23 -0
- package/esm2020/chat/format-icon/icons.mjs +138 -0
- package/esm2020/chat/initials-avatar/initials-avatar.component.mjs +60 -0
- package/esm2020/chat/instance-manager.service.mjs +46 -0
- package/esm2020/chat/messages/de.mjs +4 -0
- package/esm2020/chat/messages/en.mjs +4 -0
- package/esm2020/chat/messages/fr.mjs +4 -0
- package/esm2020/chat/messages/index.mjs +9 -0
- package/esm2020/chat/public-api.mjs +12 -0
- package/esm2020/chat/rest-chat.service.mjs +164 -0
- package/esm2020/chat/saved-chats/saved-chats.component.mjs +132 -0
- package/esm2020/chat/sinequa-assistant-chat.mjs +5 -0
- package/esm2020/chat/types.mjs +85 -0
- package/esm2020/chat/websocket-chat.service.mjs +430 -0
- package/esm2020/public-api.mjs +3 -0
- package/esm2020/sinequa-assistant.mjs +5 -0
- package/fesm2015/sinequa-assistant-chat.mjs +1925 -0
- package/fesm2015/sinequa-assistant-chat.mjs.map +1 -0
- package/fesm2015/sinequa-assistant.mjs +9 -0
- package/fesm2015/sinequa-assistant.mjs.map +1 -0
- package/fesm2020/sinequa-assistant-chat.mjs +1911 -0
- package/fesm2020/sinequa-assistant-chat.mjs.map +1 -0
- package/fesm2020/sinequa-assistant.mjs +9 -0
- package/fesm2020/sinequa-assistant.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/package.json +46 -0
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OnChanges } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FormatIconComponent implements OnChanges {
|
|
4
|
+
extension: string;
|
|
5
|
+
private _formatIcons;
|
|
6
|
+
icon: string;
|
|
7
|
+
ngOnChanges(): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormatIconComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FormatIconComponent, "sq-format-icon", never, { "extension": "extension"; }, {}, never, never, true>;
|
|
10
|
+
}
|
package/chat/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class InitialsAvatarComponent {
|
|
3
|
+
fullName: string;
|
|
4
|
+
size: number;
|
|
5
|
+
/**
|
|
6
|
+
* Gives initials of a name and a safe color background to use,
|
|
7
|
+
* assuming text color will be white
|
|
8
|
+
* @param fullName full name to evaluate intials for
|
|
9
|
+
* @param split string to use has splitter for `fullName`
|
|
10
|
+
* @returns an `object` containing initials and color
|
|
11
|
+
*/
|
|
12
|
+
getInitialsAndColorFromFullName(fullName: string, split?: string): {
|
|
13
|
+
initials: string;
|
|
14
|
+
color: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Gives initials of a name, ie:
|
|
18
|
+
* ```
|
|
19
|
+
* getInitialForFullName('John Snow') => 'JS'
|
|
20
|
+
* getInitialForFullName('Geralt of Rivia', ' of ') => 'GR'
|
|
21
|
+
* ```
|
|
22
|
+
* @param fullName full name to evaluate intial for
|
|
23
|
+
* @param split string to use has splitter
|
|
24
|
+
* @returns string containg the first letter of splitted name
|
|
25
|
+
*/
|
|
26
|
+
getInitialsFromFullName(fullName: string, split?: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Gets a random color using text as seed
|
|
29
|
+
* @param text string to use for color generation
|
|
30
|
+
* @returns string formatted like `rgb(xxx, xxx, xxx)`
|
|
31
|
+
*/
|
|
32
|
+
getColorFromName(text: string): string;
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InitialsAvatarComponent, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InitialsAvatarComponent, "sq-initials-avatar", never, { "fullName": "fullName"; "size": "size"; }, {}, never, never, true>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChatService } from './chat.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* A service to create and manage instances of ChatService dynamically based on the provided component references and the implementation type (http or websocket)
|
|
5
|
+
* All chat-related components should share the same instance of this InstanceManagerService, which in turn provides the appropriate instance of ChatService
|
|
6
|
+
*/
|
|
7
|
+
export declare class InstanceManagerService {
|
|
8
|
+
private _serviceInstances;
|
|
9
|
+
/**
|
|
10
|
+
* Store the instance of ChatService in the map
|
|
11
|
+
* @param key key differentiator between components used to store their corresponding ChatService instance
|
|
12
|
+
* @param service The ChatService instance
|
|
13
|
+
*/
|
|
14
|
+
storeInstance(key: string, service: ChatService): void;
|
|
15
|
+
/**
|
|
16
|
+
* @param key key differentiator between components based on which the corresponding ChatService instance is fetched
|
|
17
|
+
* @returns The instance of the service corresponding to the instance of the component
|
|
18
|
+
*/
|
|
19
|
+
getInstance(key: string): ChatService;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @param key key differentiator between components based on which the check for an existent ChatService instance is performed
|
|
23
|
+
* @returns True if a ChatService instance has been already instantiated for the given key. Otherwise, false.
|
|
24
|
+
*/
|
|
25
|
+
checkInstance(key: string): boolean;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InstanceManagerService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<InstanceManagerService>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './chat-settings-v3/chat-settings-v3.component';
|
|
2
|
+
export * from './chat.component';
|
|
3
|
+
export * from './chat.service';
|
|
4
|
+
export * from './saved-chats/saved-chats.component';
|
|
5
|
+
export * from './initials-avatar/initials-avatar.component';
|
|
6
|
+
export * from './format-icon/format-icon.component';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './messages/index';
|
|
9
|
+
export * from './websocket-chat.service';
|
|
10
|
+
export * from './rest-chat.service';
|
|
11
|
+
export * from './instance-manager.service';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ChatService } from './chat.service';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ChatMessage, ChatResponse, GllmFunction, GllmModelDescription, SavedChatHistory } from './types';
|
|
4
|
+
import { JsonMethodPluginService } from '@sinequa/core/web-services';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class RestChatService extends ChatService {
|
|
7
|
+
jsonMethodWebService: JsonMethodPluginService;
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* Initialize the chat process after the login is complete.
|
|
11
|
+
* It listens for the 'login-complete' event, initializes necessary URL, and performs parallel requests for models, functions and quota data.
|
|
12
|
+
* @returns An Observable<boolean> indicating the success of the initialization process.
|
|
13
|
+
*/
|
|
14
|
+
init(): Observable<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Define the GLLM plugin to use for the http requests
|
|
17
|
+
* It can be overridden by the app config
|
|
18
|
+
*/
|
|
19
|
+
getRequestsUrl(): void;
|
|
20
|
+
listModels(): Observable<GllmModelDescription[] | undefined>;
|
|
21
|
+
listFunctions(): Observable<GllmFunction[] | undefined>;
|
|
22
|
+
fetch(messages: ChatMessage[], query?: import("@sinequa/core/app-utils").Query): Observable<ChatResponse>;
|
|
23
|
+
listSavedChat(): void;
|
|
24
|
+
getSavedChat(id: string): Observable<SavedChatHistory | undefined>;
|
|
25
|
+
deleteSavedChat(ids: string[]): Observable<number>;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RestChatService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<RestChatService>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { AuditWebService } from "@sinequa/core/web-services";
|
|
3
|
+
import { ChatService } from "../chat.service";
|
|
4
|
+
import { SavedChat } from "../types";
|
|
5
|
+
import { InstanceManagerService } from "../instance-manager.service";
|
|
6
|
+
import { Subscription, BehaviorSubject } from "rxjs";
|
|
7
|
+
import { LoginService } from "@sinequa/core/login";
|
|
8
|
+
import { ModalService } from "@sinequa/core/modal";
|
|
9
|
+
import { NotificationsService } from "@sinequa/core/notification";
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
export declare class SavedChatsComponent implements OnInit, OnDestroy {
|
|
12
|
+
/** Define the key based on it, the appropriate chatService instance will be returned from instanceManagerService */
|
|
13
|
+
instanceId: string;
|
|
14
|
+
load: EventEmitter<SavedChat>;
|
|
15
|
+
delete: EventEmitter<SavedChat>;
|
|
16
|
+
chatService: ChatService;
|
|
17
|
+
subscription: Subscription;
|
|
18
|
+
groupedSavedChats$: BehaviorSubject<{
|
|
19
|
+
key: string;
|
|
20
|
+
value: SavedChat[];
|
|
21
|
+
}[]>;
|
|
22
|
+
loginService: LoginService;
|
|
23
|
+
instanceManagerService: InstanceManagerService;
|
|
24
|
+
auditService: AuditWebService;
|
|
25
|
+
modalService: ModalService;
|
|
26
|
+
notificationsService: NotificationsService;
|
|
27
|
+
ngOnInit(): void;
|
|
28
|
+
ngOnDestroy(): void;
|
|
29
|
+
instantiateChatService(): void;
|
|
30
|
+
onListSavedChat(): void;
|
|
31
|
+
onLoad(savedChat: SavedChat): void;
|
|
32
|
+
onDelete(savedChat: SavedChat): void;
|
|
33
|
+
private _groupSavedChatsByDate;
|
|
34
|
+
private _getTimeKey;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SavedChatsComponent, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SavedChatsComponent, "sq-saved-chats-v3", never, { "instanceId": "instanceId"; }, { "load": "load"; "delete": "delete"; }, never, never, true>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/****************************************************
|
|
2
|
+
variables
|
|
3
|
+
****************************************************/
|
|
4
|
+
$sm: 576px;
|
|
5
|
+
$md: 768px;
|
|
6
|
+
$lg: 992px;
|
|
7
|
+
$xl: 1200px;
|
|
8
|
+
$xxl: 1400px;
|
|
9
|
+
|
|
10
|
+
$size-0: var(--ast-size-0, 0rem);
|
|
11
|
+
$size-1: var(--ast-size-1, 0.25rem);
|
|
12
|
+
$size-2: var(--ast-size-2, 0.5rem);
|
|
13
|
+
$size-3: var(--ast-size-3, 0.75rem);
|
|
14
|
+
$size-4: var(--ast-size-4, 1rem);
|
|
15
|
+
$size-5: var(--ast-size-5, 1.25rem);
|
|
16
|
+
$size-6: var(--ast-size-6, 1.5rem);
|
|
17
|
+
|
|
18
|
+
$fw-bold: var(--font-weight-bold, 500);
|
|
19
|
+
$container-width: var(--container-width, 800px);
|
|
20
|
+
|
|
21
|
+
/****************************************************
|
|
22
|
+
colors
|
|
23
|
+
****************************************************/
|
|
24
|
+
$ast-primary-bg: var(--ast-primary-bg, #f2f8fe);
|
|
25
|
+
$ast-primary-color: var(--ast-primary-color, #005DA7);
|
|
26
|
+
$ast-secondary-bg: var(--ast-secondary-bg, #FFF8F1);
|
|
27
|
+
$ast-secondary-color: var(--ast-secondary-color, #FF732E);
|
|
28
|
+
$ast-input-bg: var(--ast-input-bg, #F8F8F8);
|
|
29
|
+
$ast-input-color: var(--ast-input-color, #B0B0B0);
|
|
30
|
+
$ast-muted-color: rgba(33, 37, 41, 0.75);
|
|
31
|
+
|
|
32
|
+
/****************************************************
|
|
33
|
+
classes
|
|
34
|
+
****************************************************/
|
|
35
|
+
|
|
36
|
+
.ast-primary {
|
|
37
|
+
color: $ast-primary-color;
|
|
38
|
+
background-color: $ast-primary-bg;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ast-primary-hover {
|
|
42
|
+
background-color: $ast-primary-bg;
|
|
43
|
+
|
|
44
|
+
&:hover {
|
|
45
|
+
color: $ast-primary-color;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ast-secondary {
|
|
50
|
+
color: $ast-secondary-color;
|
|
51
|
+
background-color: $ast-secondary-bg;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ast-btn {
|
|
55
|
+
border: 0;
|
|
56
|
+
text-align: left;
|
|
57
|
+
padding-top: 0.5rem;
|
|
58
|
+
padding-bottom: 0.5rem;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
:host ::ng-deep { // required so it is applied for the tooltip
|
|
2
|
+
.reference,
|
|
3
|
+
.message-content .reference,
|
|
4
|
+
.attachment .reference {
|
|
5
|
+
position: relative;
|
|
6
|
+
bottom: var(--ast-reference-bottom, 0.3em);
|
|
7
|
+
font-weight: var(--ast-reference-font-weight, bold);
|
|
8
|
+
padding: var(--ast-reference-padding, 0 0.2em);
|
|
9
|
+
margin: var(--ast-reference-margin, 0 0.1em);
|
|
10
|
+
border-radius: var(--ast-reference-border-radius, 0.2em);
|
|
11
|
+
background-color: var(--ast-reference-background-color, lightblue);
|
|
12
|
+
color: var(--ast-reference-color, black);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.reference,
|
|
16
|
+
.message-content .reference {
|
|
17
|
+
font-size: var(--ast-reference-message-font-size, 0.7em);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.attachment .reference {
|
|
21
|
+
font-size: var(--ast-reference-attachment-font-size, 13px);
|
|
22
|
+
}
|
|
23
|
+
}
|