@epam/ai-dial-overlay 0.18.0-rc.8 → 0.18.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/index.esm.js +61 -7
- package/package.json +2 -2
- package/src/index.d.ts +1 -1
- package/src/lib/ChatOverlay.d.ts +21 -4
- package/src/lib/ChatOverlayManager.d.ts +4 -1
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { overlayAppName, OverlayEvents, Task, setStyles, overlayLibName, DeferredRequest, OverlayRequests } from '@epam/ai-dial-shared';
|
|
2
|
-
export { Feature, OverlayEvents
|
|
2
|
+
export { Feature, OverlayEvents } from '@epam/ai-dial-shared';
|
|
3
3
|
|
|
4
4
|
/******************************************************************************
|
|
5
5
|
Copyright (c) Microsoft Corporation.
|
|
@@ -249,8 +249,42 @@ class ChatOverlay {
|
|
|
249
249
|
*/
|
|
250
250
|
getMessages() {
|
|
251
251
|
return __awaiter(this, void 0, void 0, function* () {
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
return this.send(OverlayRequests.getMessages);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Get all listing conversations
|
|
257
|
+
* @returns {OverlayConversation[]} all conversations visible in chat
|
|
258
|
+
*/
|
|
259
|
+
getConversations() {
|
|
260
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
261
|
+
return this.send(OverlayRequests.getConversations);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Select conversation
|
|
266
|
+
* @param {string} id - id of conversation to select
|
|
267
|
+
* @returns Returns selected conversation info
|
|
268
|
+
*/
|
|
269
|
+
selectConversation(id) {
|
|
270
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
271
|
+
const request = {
|
|
272
|
+
id,
|
|
273
|
+
};
|
|
274
|
+
return this.send(OverlayRequests.selectConversation, request);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Create conversation
|
|
279
|
+
* @param {string} parentPath - path to create conversation in. If not defined or null conversation will be created in user Root
|
|
280
|
+
* @returns Returns created conversation info
|
|
281
|
+
*/
|
|
282
|
+
createConversation(parentPath) {
|
|
283
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
284
|
+
const request = {
|
|
285
|
+
parentPath,
|
|
286
|
+
};
|
|
287
|
+
return this.send(OverlayRequests.createConversation, request);
|
|
254
288
|
});
|
|
255
289
|
}
|
|
256
290
|
/**
|
|
@@ -259,9 +293,10 @@ class ChatOverlay {
|
|
|
259
293
|
*/
|
|
260
294
|
sendMessage(content) {
|
|
261
295
|
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
-
|
|
296
|
+
const request = {
|
|
263
297
|
content,
|
|
264
|
-
}
|
|
298
|
+
};
|
|
299
|
+
return this.send(OverlayRequests.sendMessage, request);
|
|
265
300
|
});
|
|
266
301
|
}
|
|
267
302
|
/**
|
|
@@ -270,9 +305,10 @@ class ChatOverlay {
|
|
|
270
305
|
*/
|
|
271
306
|
setSystemPrompt(systemPrompt) {
|
|
272
307
|
return __awaiter(this, void 0, void 0, function* () {
|
|
273
|
-
|
|
308
|
+
const request = {
|
|
274
309
|
systemPrompt,
|
|
275
|
-
}
|
|
310
|
+
};
|
|
311
|
+
return this.send(OverlayRequests.setSystemPrompt, request);
|
|
276
312
|
});
|
|
277
313
|
}
|
|
278
314
|
/**
|
|
@@ -593,6 +629,24 @@ class ChatOverlayManager {
|
|
|
593
629
|
return overlay.sendMessage(content);
|
|
594
630
|
});
|
|
595
631
|
}
|
|
632
|
+
getConversations(id) {
|
|
633
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
634
|
+
const { overlay } = this.getOverlay(id);
|
|
635
|
+
return overlay.getConversations();
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
createConversation(id, parentPath) {
|
|
639
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
640
|
+
const { overlay } = this.getOverlay(id);
|
|
641
|
+
return overlay.createConversation(parentPath);
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
selectConversation(id, conversationId) {
|
|
645
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
646
|
+
const { overlay } = this.getOverlay(id);
|
|
647
|
+
return overlay.createConversation(conversationId);
|
|
648
|
+
});
|
|
649
|
+
}
|
|
596
650
|
setOverlayOptions(id, options) {
|
|
597
651
|
return __awaiter(this, void 0, void 0, function* () {
|
|
598
652
|
const { overlay } = this.getOverlay(id);
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@epam/ai-dial-overlay",
|
|
3
3
|
"description": "Package for opening dial in overlay",
|
|
4
4
|
"homepage": "https://epam-rail.com",
|
|
5
|
-
"version": "0.18.0
|
|
5
|
+
"version": "0.18.0",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@epam/ai-dial-shared": "0.18.0
|
|
7
|
+
"@epam/ai-dial-shared": "0.18.0"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"bugs": {
|
package/src/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './lib/ChatOverlay';
|
|
2
2
|
export * from './lib/ChatOverlayManager';
|
|
3
|
-
export { Feature, type ChatOverlayOptions, overlayAppName, OverlayEvents, } from '@epam/ai-dial-shared';
|
|
3
|
+
export { Feature, type ChatOverlayOptions, type OverlayConversation, type SendMessageResponse, type SetSystemPromptResponse, type GetMessagesResponse, type GetConversationsResponse, type CreateConversationResponse, type SelectConversationResponse, type SelectedConversationLoadedResponse, type overlayAppName, OverlayEvents, type Role, type ImageMIMEType, type MIMEType, type Attachment, type StageStatus, type Stage, type LikeState, type MessageSettings, type ConversationEntityModel, type Message, type UploadStatus, type Entity, type PublishActions, type EntityPublicationInfo, type ShareInterface, type ShareEntity, type ConversationInfo, type TemplateMapping, } from '@epam/ai-dial-shared';
|
package/src/lib/ChatOverlay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChatOverlayOptions, DeferredRequest, OverlayRequest, OverlayRequests, Styles, Task } from '@epam/ai-dial-shared';
|
|
1
|
+
import { ChatOverlayOptions, CreateConversationResponse, DeferredRequest, GetConversationsResponse, GetMessagesResponse, OverlayRequest, OverlayRequests, SelectConversationResponse, SendMessageResponse, SetSystemPromptResponse, Styles, Task } from '@epam/ai-dial-shared';
|
|
2
2
|
interface Subscription {
|
|
3
3
|
eventType: string;
|
|
4
4
|
callback: (payload: unknown) => void;
|
|
@@ -88,17 +88,34 @@ export declare class ChatOverlay {
|
|
|
88
88
|
/**
|
|
89
89
|
* Get messages from first selected conversation
|
|
90
90
|
*/
|
|
91
|
-
getMessages(): Promise<
|
|
91
|
+
getMessages(): Promise<GetMessagesResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* Get all listing conversations
|
|
94
|
+
* @returns {OverlayConversation[]} all conversations visible in chat
|
|
95
|
+
*/
|
|
96
|
+
getConversations(): Promise<GetConversationsResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Select conversation
|
|
99
|
+
* @param {string} id - id of conversation to select
|
|
100
|
+
* @returns Returns selected conversation info
|
|
101
|
+
*/
|
|
102
|
+
selectConversation(id: string): Promise<SelectConversationResponse>;
|
|
103
|
+
/**
|
|
104
|
+
* Create conversation
|
|
105
|
+
* @param {string} parentPath - path to create conversation in. If not defined or null conversation will be created in user Root
|
|
106
|
+
* @returns Returns created conversation info
|
|
107
|
+
*/
|
|
108
|
+
createConversation(parentPath?: string | null): Promise<CreateConversationResponse>;
|
|
92
109
|
/**
|
|
93
110
|
* Send message into the first selected conversation
|
|
94
111
|
* @param content {string} text of message that should be sent to the chat
|
|
95
112
|
*/
|
|
96
|
-
sendMessage(content: string): Promise<
|
|
113
|
+
sendMessage(content: string): Promise<SendMessageResponse>;
|
|
97
114
|
/**
|
|
98
115
|
* Set systemPrompt into the first selected conversation
|
|
99
116
|
* @param systemPrompt {string} text content of system prompt
|
|
100
117
|
*/
|
|
101
|
-
setSystemPrompt(systemPrompt: string): Promise<
|
|
118
|
+
setSystemPrompt(systemPrompt: string): Promise<SetSystemPromptResponse>;
|
|
102
119
|
/**
|
|
103
120
|
* Send to DIAL overlay options (modelId, hostDomain, etc.)
|
|
104
121
|
* @param options {ChatOverlayOptions} Options that should be set into the DIAL
|
|
@@ -84,8 +84,11 @@ export declare class ChatOverlayManager {
|
|
|
84
84
|
*/
|
|
85
85
|
updateOverlay(id: string): void;
|
|
86
86
|
setSystemPrompt(id: string, systemPrompt: string): Promise<void>;
|
|
87
|
-
getMessages(id: string): Promise<
|
|
87
|
+
getMessages(id: string): Promise<import("@epam/ai-dial-shared").GetMessagesResponse>;
|
|
88
88
|
sendMessage(id: string, content: string): Promise<void>;
|
|
89
|
+
getConversations(id: string): Promise<import("@epam/ai-dial-shared").GetConversationsResponse>;
|
|
90
|
+
createConversation(id: string, parentPath?: string | null): Promise<import("@epam/ai-dial-shared").CreateConversationResponse>;
|
|
91
|
+
selectConversation(id: string, conversationId: string): Promise<import("@epam/ai-dial-shared").CreateConversationResponse>;
|
|
89
92
|
setOverlayOptions(id: string, options: ChatOverlayOptions): Promise<void>;
|
|
90
93
|
subscribe(id: string, eventType: string, callback: (payload?: unknown) => void): () => void;
|
|
91
94
|
/**
|