@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,157 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges, ChangeDetectorRef, AfterViewInit, ElementRef } from "@angular/core";
|
|
2
|
+
import { PrincipalWebService, Record } from "@sinequa/core/web-services";
|
|
3
|
+
import { SearchService } from "@sinequa/components/search";
|
|
4
|
+
import { ChatContextAttachment, ChatMessage } from "../types";
|
|
5
|
+
import { Processor } from "unified";
|
|
6
|
+
import { Node } from "unist";
|
|
7
|
+
import { UIService } from "@sinequa/components/utils";
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class ChatMessageComponent implements OnChanges, AfterViewInit {
|
|
10
|
+
searchService: SearchService;
|
|
11
|
+
ui: UIService;
|
|
12
|
+
principalService: PrincipalWebService;
|
|
13
|
+
cdr: ChangeDetectorRef;
|
|
14
|
+
el: ElementRef;
|
|
15
|
+
message: ChatMessage;
|
|
16
|
+
conversation: ChatMessage[];
|
|
17
|
+
assistantIcon: string;
|
|
18
|
+
streaming: boolean;
|
|
19
|
+
canEdit: boolean;
|
|
20
|
+
canRegenerate: boolean;
|
|
21
|
+
canCopy: boolean;
|
|
22
|
+
referenceClicked: EventEmitter<{
|
|
23
|
+
filename: string;
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
text: string;
|
|
27
|
+
size: number;
|
|
28
|
+
$selected: boolean;
|
|
29
|
+
matchlocations: string[];
|
|
30
|
+
rank: number;
|
|
31
|
+
databasealias: string;
|
|
32
|
+
matchingpartnames: string[];
|
|
33
|
+
matchlocationsperpartname: {
|
|
34
|
+
matchlocations: {
|
|
35
|
+
data: string;
|
|
36
|
+
partname: string;
|
|
37
|
+
}[];
|
|
38
|
+
}[];
|
|
39
|
+
documentlanguages: string[];
|
|
40
|
+
documentweight: string;
|
|
41
|
+
modified: string;
|
|
42
|
+
indexationtime: string;
|
|
43
|
+
version: string;
|
|
44
|
+
treepath: string[];
|
|
45
|
+
fileext: string;
|
|
46
|
+
flags: string[];
|
|
47
|
+
collection: string[];
|
|
48
|
+
docformat: string;
|
|
49
|
+
url1: string;
|
|
50
|
+
authors: string[];
|
|
51
|
+
rfmEnabled: boolean;
|
|
52
|
+
termspresence: {
|
|
53
|
+
term: string;
|
|
54
|
+
presence: "found" | "missing";
|
|
55
|
+
}[];
|
|
56
|
+
$isDuplicate: boolean;
|
|
57
|
+
$duplicateCount: number;
|
|
58
|
+
globalrelevance?: number | undefined;
|
|
59
|
+
displayTitle?: string | undefined;
|
|
60
|
+
doctype?: string | undefined;
|
|
61
|
+
url2?: string | undefined;
|
|
62
|
+
relevantExtracts?: string | undefined;
|
|
63
|
+
extracts?: {
|
|
64
|
+
score: number;
|
|
65
|
+
highlighted: string;
|
|
66
|
+
locations: string;
|
|
67
|
+
originalLocations: string;
|
|
68
|
+
partname?: string | undefined;
|
|
69
|
+
}[] | undefined;
|
|
70
|
+
accesslists?: {
|
|
71
|
+
accessListIndices: number[];
|
|
72
|
+
authorizedLists: {
|
|
73
|
+
id: string;
|
|
74
|
+
domain: string;
|
|
75
|
+
}[];
|
|
76
|
+
deniedLists: {
|
|
77
|
+
id: string;
|
|
78
|
+
domain: string;
|
|
79
|
+
}[];
|
|
80
|
+
} | undefined;
|
|
81
|
+
thumbnailUrl?: string | undefined;
|
|
82
|
+
originalUrl?: string | undefined;
|
|
83
|
+
pdfUrl?: string | undefined;
|
|
84
|
+
rfm?: {
|
|
85
|
+
click?: {
|
|
86
|
+
image: import("@sinequa/core/web-services").RFMDisplay;
|
|
87
|
+
status: import("@sinequa/core/web-services").RFMDisplay;
|
|
88
|
+
eventCount: number;
|
|
89
|
+
average: number;
|
|
90
|
+
imageAction: import("@sinequa/core/web-services").RFMDisplay;
|
|
91
|
+
availableActions: import("@sinequa/core/web-services").RFMDisplay;
|
|
92
|
+
} | undefined;
|
|
93
|
+
like?: {
|
|
94
|
+
image: import("@sinequa/core/web-services").RFMDisplay;
|
|
95
|
+
status: import("@sinequa/core/web-services").RFMDisplay;
|
|
96
|
+
eventCount: number;
|
|
97
|
+
average: number;
|
|
98
|
+
imageAction: import("@sinequa/core/web-services").RFMDisplay;
|
|
99
|
+
availableActions: import("@sinequa/core/web-services").RFMDisplay;
|
|
100
|
+
} | undefined;
|
|
101
|
+
important?: {
|
|
102
|
+
image: import("@sinequa/core/web-services").RFMDisplay;
|
|
103
|
+
status: import("@sinequa/core/web-services").RFMDisplay;
|
|
104
|
+
eventCount: number;
|
|
105
|
+
average: number;
|
|
106
|
+
imageAction: import("@sinequa/core/web-services").RFMDisplay;
|
|
107
|
+
availableActions: import("@sinequa/core/web-services").RFMDisplay;
|
|
108
|
+
} | undefined;
|
|
109
|
+
} | undefined;
|
|
110
|
+
groupcount?: number | undefined;
|
|
111
|
+
nearhash?: string | undefined;
|
|
112
|
+
exacthash?: string | undefined;
|
|
113
|
+
containerid?: string | undefined;
|
|
114
|
+
$page?: number | undefined;
|
|
115
|
+
matchingpassages?: {
|
|
116
|
+
passages: {
|
|
117
|
+
location: number[];
|
|
118
|
+
id: number;
|
|
119
|
+
score: number;
|
|
120
|
+
rlocation: number[];
|
|
121
|
+
highlightedText: string;
|
|
122
|
+
$expanded?: boolean | undefined;
|
|
123
|
+
}[];
|
|
124
|
+
} | undefined;
|
|
125
|
+
$hasPassages?: boolean | undefined;
|
|
126
|
+
}>;
|
|
127
|
+
edit: EventEmitter<ChatMessage>;
|
|
128
|
+
regenerate: EventEmitter<ChatMessage>;
|
|
129
|
+
openPreview: EventEmitter<ChatContextAttachment>;
|
|
130
|
+
processor: Processor;
|
|
131
|
+
references: string[];
|
|
132
|
+
referenceMap: Map<string, ChatContextAttachment>;
|
|
133
|
+
showReferences: boolean;
|
|
134
|
+
collapseProgress: boolean;
|
|
135
|
+
get name(): string;
|
|
136
|
+
constructor(searchService: SearchService, ui: UIService, principalService: PrincipalWebService, cdr: ChangeDetectorRef, el: ElementRef);
|
|
137
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
138
|
+
ngAfterViewInit(): void;
|
|
139
|
+
openDocument(record: Record): void;
|
|
140
|
+
/**
|
|
141
|
+
* This Unified plugin looks a text nodes and replaces any reference in the
|
|
142
|
+
* form [1], [2.3], etc. with custom nodes of type "chat-reference".
|
|
143
|
+
*/
|
|
144
|
+
referencePlugin: (tree: Node) => Node<import("unist").Data>;
|
|
145
|
+
placeholderPlugin: (tree: Node) => Node<import("unist").Data>;
|
|
146
|
+
/**
|
|
147
|
+
* Reformat [ids: 12.2, 42.5] to [12.2][42.5]
|
|
148
|
+
*/
|
|
149
|
+
reformatReferences(content: string): string;
|
|
150
|
+
/**
|
|
151
|
+
* Match all references in a given message
|
|
152
|
+
*/
|
|
153
|
+
getReferenceMatches(content: string): RegExpMatchArray[];
|
|
154
|
+
copyToClipboard(text: string): void;
|
|
155
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatMessageComponent, never>;
|
|
156
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatMessageComponent, "sq-chat-message", never, { "message": "message"; "conversation": "conversation"; "assistantIcon": "assistantIcon"; "streaming": "streaming"; "canEdit": "canEdit"; "canRegenerate": "canRegenerate"; "canCopy": "canCopy"; }, { "referenceClicked": "referenceClicked"; "edit": "edit"; "regenerate": "regenerate"; "openPreview": "openPreview"; }, never, never, true>;
|
|
157
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ChatContextAttachment, DocumentPart } from '../types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ChatReferenceComponent {
|
|
5
|
+
reference: string;
|
|
6
|
+
attachment: ChatContextAttachment;
|
|
7
|
+
partId?: number;
|
|
8
|
+
openDocument: EventEmitter<{
|
|
9
|
+
filename: string;
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
text: string;
|
|
13
|
+
size: number;
|
|
14
|
+
$selected: boolean;
|
|
15
|
+
matchlocations: string[];
|
|
16
|
+
rank: number;
|
|
17
|
+
databasealias: string;
|
|
18
|
+
matchingpartnames: string[];
|
|
19
|
+
matchlocationsperpartname: {
|
|
20
|
+
matchlocations: {
|
|
21
|
+
data: string;
|
|
22
|
+
partname: string;
|
|
23
|
+
}[];
|
|
24
|
+
}[];
|
|
25
|
+
documentlanguages: string[];
|
|
26
|
+
documentweight: string;
|
|
27
|
+
modified: string;
|
|
28
|
+
indexationtime: string;
|
|
29
|
+
version: string;
|
|
30
|
+
treepath: string[];
|
|
31
|
+
fileext: string;
|
|
32
|
+
flags: string[];
|
|
33
|
+
collection: string[];
|
|
34
|
+
docformat: string;
|
|
35
|
+
url1: string;
|
|
36
|
+
authors: string[];
|
|
37
|
+
rfmEnabled: boolean;
|
|
38
|
+
termspresence: {
|
|
39
|
+
term: string;
|
|
40
|
+
presence: "found" | "missing";
|
|
41
|
+
}[];
|
|
42
|
+
$isDuplicate: boolean;
|
|
43
|
+
$duplicateCount: number;
|
|
44
|
+
globalrelevance?: number | undefined;
|
|
45
|
+
displayTitle?: string | undefined;
|
|
46
|
+
doctype?: string | undefined;
|
|
47
|
+
url2?: string | undefined;
|
|
48
|
+
relevantExtracts?: string | undefined;
|
|
49
|
+
extracts?: {
|
|
50
|
+
score: number;
|
|
51
|
+
highlighted: string;
|
|
52
|
+
locations: string;
|
|
53
|
+
originalLocations: string;
|
|
54
|
+
partname?: string | undefined;
|
|
55
|
+
}[] | undefined;
|
|
56
|
+
accesslists?: {
|
|
57
|
+
accessListIndices: number[];
|
|
58
|
+
authorizedLists: {
|
|
59
|
+
id: string;
|
|
60
|
+
domain: string;
|
|
61
|
+
}[];
|
|
62
|
+
deniedLists: {
|
|
63
|
+
id: string;
|
|
64
|
+
domain: string;
|
|
65
|
+
}[];
|
|
66
|
+
} | undefined;
|
|
67
|
+
thumbnailUrl?: string | undefined;
|
|
68
|
+
originalUrl?: string | undefined;
|
|
69
|
+
pdfUrl?: string | undefined;
|
|
70
|
+
rfm?: {
|
|
71
|
+
click?: {
|
|
72
|
+
image: import("@sinequa/core/web-services").RFMDisplay;
|
|
73
|
+
status: import("@sinequa/core/web-services").RFMDisplay;
|
|
74
|
+
eventCount: number;
|
|
75
|
+
average: number;
|
|
76
|
+
imageAction: import("@sinequa/core/web-services").RFMDisplay;
|
|
77
|
+
availableActions: import("@sinequa/core/web-services").RFMDisplay;
|
|
78
|
+
} | undefined;
|
|
79
|
+
like?: {
|
|
80
|
+
image: import("@sinequa/core/web-services").RFMDisplay;
|
|
81
|
+
status: import("@sinequa/core/web-services").RFMDisplay;
|
|
82
|
+
eventCount: number;
|
|
83
|
+
average: number;
|
|
84
|
+
imageAction: import("@sinequa/core/web-services").RFMDisplay;
|
|
85
|
+
availableActions: import("@sinequa/core/web-services").RFMDisplay;
|
|
86
|
+
} | undefined;
|
|
87
|
+
important?: {
|
|
88
|
+
image: import("@sinequa/core/web-services").RFMDisplay;
|
|
89
|
+
status: import("@sinequa/core/web-services").RFMDisplay;
|
|
90
|
+
eventCount: number;
|
|
91
|
+
average: number;
|
|
92
|
+
imageAction: import("@sinequa/core/web-services").RFMDisplay;
|
|
93
|
+
availableActions: import("@sinequa/core/web-services").RFMDisplay;
|
|
94
|
+
} | undefined;
|
|
95
|
+
} | undefined;
|
|
96
|
+
groupcount?: number | undefined;
|
|
97
|
+
nearhash?: string | undefined;
|
|
98
|
+
exacthash?: string | undefined;
|
|
99
|
+
containerid?: string | undefined;
|
|
100
|
+
$page?: number | undefined;
|
|
101
|
+
matchingpassages?: {
|
|
102
|
+
passages: {
|
|
103
|
+
location: number[];
|
|
104
|
+
id: number;
|
|
105
|
+
score: number;
|
|
106
|
+
rlocation: number[];
|
|
107
|
+
highlightedText: string;
|
|
108
|
+
$expanded?: boolean | undefined;
|
|
109
|
+
}[];
|
|
110
|
+
} | undefined;
|
|
111
|
+
$hasPassages?: boolean | undefined;
|
|
112
|
+
}>;
|
|
113
|
+
openPreview: EventEmitter<ChatContextAttachment>;
|
|
114
|
+
get parts(): DocumentPart[];
|
|
115
|
+
expandAttachment(): void;
|
|
116
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatReferenceComponent, never>;
|
|
117
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatReferenceComponent, "sq-chat-reference", never, { "reference": "reference"; "attachment": "attachment"; "partId": "partId"; }, { "openDocument": "openDocument"; "openPreview": "openPreview"; }, never, never, true>;
|
|
118
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from "@angular/core";
|
|
2
|
+
import { ChatService } from "../chat.service";
|
|
3
|
+
import { ChatConfig, GllmModelDescription } from "../types";
|
|
4
|
+
import { Subscription } from "rxjs";
|
|
5
|
+
import { InstanceManagerService } from "../instance-manager.service";
|
|
6
|
+
import { PrincipalWebService } from "@sinequa/core/web-services";
|
|
7
|
+
import { LoginService } from "@sinequa/core/login";
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class ChatSettingsV3Component implements OnInit, OnDestroy {
|
|
10
|
+
/** Define the key based on it, the appropriate chatService instance will be returned from instanceManagerService */
|
|
11
|
+
instanceId: string;
|
|
12
|
+
_update: EventEmitter<any>;
|
|
13
|
+
_cancel: EventEmitter<any>;
|
|
14
|
+
chatService: ChatService;
|
|
15
|
+
config: ChatConfig;
|
|
16
|
+
subscription: Subscription;
|
|
17
|
+
selectedModel: GllmModelDescription | undefined;
|
|
18
|
+
isAdmin: boolean;
|
|
19
|
+
loginService: LoginService;
|
|
20
|
+
instanceManagerService: InstanceManagerService;
|
|
21
|
+
principalService: PrincipalWebService;
|
|
22
|
+
ngOnInit(): void;
|
|
23
|
+
ngOnDestroy(): void;
|
|
24
|
+
get hasPrompts(): boolean;
|
|
25
|
+
get hasAdvancedParameters(): boolean;
|
|
26
|
+
get hasModel(): boolean;
|
|
27
|
+
instantiateChatService(): void;
|
|
28
|
+
onChatModelChange(selectedModel: GllmModelDescription): void;
|
|
29
|
+
toggleFunctionsSelection(name: string): void;
|
|
30
|
+
private updateFunctionsCheckboxes;
|
|
31
|
+
/**
|
|
32
|
+
* Save the new chat config in the chat service and the user preferences
|
|
33
|
+
*/
|
|
34
|
+
save(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Cancel the current changes
|
|
37
|
+
*/
|
|
38
|
+
cancel(): void;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChatSettingsV3Component, never>;
|
|
40
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChatSettingsV3Component, "sq-chat-settings-v3", never, { "instanceId": "instanceId"; }, { "_update": "update"; "_cancel": "cancel"; }, never, never, true>;
|
|
41
|
+
}
|