@epam/ai-dial-overlay 0.33.0-rc.9 → 0.34.0-rc.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/README.md +1 -1
- package/index.esm.js +52 -0
- package/package.json +2 -2
- package/src/index.d.ts +1 -1
- package/src/lib/ChatOverlay.d.ts +17 -1
- package/src/lib/ChatOverlayManager.d.ts +3 -0
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ const run = async () => {
|
|
|
52
52
|
// optional, theme, 'light' | 'dark'
|
|
53
53
|
theme: 'light',
|
|
54
54
|
// optional, specifies the 'reference' or 'id' of the agent to be used as the default.
|
|
55
|
-
modelId: 'gpt-
|
|
55
|
+
modelId: 'gpt-4o',
|
|
56
56
|
// optional, if DIAL doesn't respond in requestTimeout ms, overlay will throw an exception
|
|
57
57
|
requestTimeout: 20000,
|
|
58
58
|
// optional, features that should be enabled. Use to override the default chat settings. Skip to apply all default chat settings.
|
package/index.esm.js
CHANGED
|
@@ -338,6 +338,15 @@ class ChatOverlay {
|
|
|
338
338
|
return this.send(OverlayRequests.createPlaybackConversation, request);
|
|
339
339
|
});
|
|
340
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* Stop selected playback conversation
|
|
343
|
+
* @returns Returns normal conversation after stopping playback
|
|
344
|
+
*/
|
|
345
|
+
stopSelectedPlaybackConversation() {
|
|
346
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
347
|
+
return this.send(OverlayRequests.stopSelectedPlaybackConversation);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
341
350
|
/**
|
|
342
351
|
* Export conversation
|
|
343
352
|
* @param {string} id - id of conversation to export
|
|
@@ -401,6 +410,31 @@ class ChatOverlay {
|
|
|
401
410
|
return this.send(OverlayRequests.sendMessage, request);
|
|
402
411
|
});
|
|
403
412
|
}
|
|
413
|
+
/**
|
|
414
|
+
* Delete message in current selected conversation by index
|
|
415
|
+
* @param index {number} index of message in conversation
|
|
416
|
+
* NOTE: if message on index is user message it will also remove answer from assistant
|
|
417
|
+
*/
|
|
418
|
+
deleteMessage(index) {
|
|
419
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
420
|
+
const request = {
|
|
421
|
+
index,
|
|
422
|
+
};
|
|
423
|
+
return this.send(OverlayRequests.deleteMessage, request);
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Set input content
|
|
428
|
+
* @param content {string} content to set in chat input
|
|
429
|
+
*/
|
|
430
|
+
setInputContent(content) {
|
|
431
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
432
|
+
const request = {
|
|
433
|
+
content,
|
|
434
|
+
};
|
|
435
|
+
return this.send(OverlayRequests.setInputContent, request);
|
|
436
|
+
});
|
|
437
|
+
}
|
|
404
438
|
/**
|
|
405
439
|
* Set systemPrompt into the first selected conversation
|
|
406
440
|
* @param systemPrompt {string} text content of system prompt
|
|
@@ -737,6 +771,18 @@ class ChatOverlayManager {
|
|
|
737
771
|
return overlay.sendMessage(content);
|
|
738
772
|
});
|
|
739
773
|
}
|
|
774
|
+
deleteMessage(overlayId, index) {
|
|
775
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
776
|
+
const { overlay } = this.getOverlay(overlayId);
|
|
777
|
+
return overlay.deleteMessage(index);
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
setInputContent(overlayId, content) {
|
|
781
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
782
|
+
const { overlay } = this.getOverlay(overlayId);
|
|
783
|
+
return overlay.setInputContent(content);
|
|
784
|
+
});
|
|
785
|
+
}
|
|
740
786
|
getConversations(overlayId) {
|
|
741
787
|
return __awaiter(this, void 0, void 0, function* () {
|
|
742
788
|
const { overlay } = this.getOverlay(overlayId);
|
|
@@ -791,6 +837,12 @@ class ChatOverlayManager {
|
|
|
791
837
|
return overlay.createPlaybackConversation(conversationId);
|
|
792
838
|
});
|
|
793
839
|
}
|
|
840
|
+
stopSelectedPlaybackConversation(overlayId) {
|
|
841
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
842
|
+
const { overlay } = this.getOverlay(overlayId);
|
|
843
|
+
return overlay.stopSelectedPlaybackConversation();
|
|
844
|
+
});
|
|
845
|
+
}
|
|
794
846
|
exportConversation(overlayId, conversationId) {
|
|
795
847
|
return __awaiter(this, void 0, void 0, function* () {
|
|
796
848
|
const { overlay } = this.getOverlay(overlayId);
|
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.
|
|
5
|
+
"version": "0.34.0-rc.0",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@epam/ai-dial-shared": "0.
|
|
7
|
+
"@epam/ai-dial-shared": "0.34.0-rc.0"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"bugs": {
|
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from './lib/ChatOverlay';
|
|
2
2
|
export * from './lib/ChatOverlayManager';
|
|
3
3
|
export { Feature, overlayAppName, OverlayEvents, Role, LikeState, UploadStatus, PublishActions, } from '@epam/ai-dial-shared';
|
|
4
|
-
export type { ChatOverlayOptions, OverlayConversation, SendMessageResponse, SetSystemPromptResponse, GetMessagesResponse, GetConversationsResponse, CreateConversationResponse, SelectConversationResponse, SelectedConversationLoadedResponse, ImageMIMEType, MIMEType, Attachment, StageStatus, Stage, MessageSettings, ConversationEntityModel, Entity, EntityPublicationInfo, ShareInterface, ShareEntity, ConversationInfo, TemplateMapping, Message, } from '@epam/ai-dial-shared';
|
|
4
|
+
export type { ChatOverlayOptions, MessageButton, MessageButtons, OverlayConversation, SendMessageResponse, SetSystemPromptResponse, GetMessagesResponse, GetConversationsResponse, CreateConversationResponse, SelectConversationResponse, CreatePlaybackConversationResponse, RenameConversationResponse, StopSelectedPlaybackConversationResponse, ExportConversationResponse, ImportConversationResponse, SelectedConversationLoadedResponse, MessageCustomButtonResponse, ImageMIMEType, MIMEType, Attachment, StageStatus, Stage, MessageSettings, ConversationEntityModel, Entity, EntityPublicationInfo, ShareInterface, ShareEntity, ConversationInfo, TemplateMapping, Message, } from '@epam/ai-dial-shared';
|
package/src/lib/ChatOverlay.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChatOverlayOptions, CreateConversationResponse, CreateLocalConversationResponse, CreatePlaybackConversationResponse, DeferredRequest, ExportConversationResponse, GetConversationsResponse, GetMessagesResponse, GetSelectedConversationsResponse, ImportConversationResponse, LatestExportConversationsFormat, OverlayRequest, OverlayRequests, RenameConversationResponse, SelectConversationResponse, SendMessageResponse, SetSystemPromptResponse, Styles, Task } from '@epam/ai-dial-shared';
|
|
1
|
+
import { ChatOverlayOptions, CreateConversationResponse, CreateLocalConversationResponse, CreatePlaybackConversationResponse, DeferredRequest, DeleteMessageResponse, ExportConversationResponse, GetConversationsResponse, GetMessagesResponse, GetSelectedConversationsResponse, ImportConversationResponse, LatestExportConversationsFormat, OverlayRequest, OverlayRequests, RenameConversationResponse, SelectConversationResponse, SendMessageResponse, SetSystemPromptResponse, StopSelectedPlaybackConversationResponse, Styles, Task } from '@epam/ai-dial-shared';
|
|
2
2
|
interface Subscription {
|
|
3
3
|
eventType: string;
|
|
4
4
|
callback: (payload: unknown) => void;
|
|
@@ -123,6 +123,11 @@ export declare class ChatOverlay {
|
|
|
123
123
|
* @returns Returns newly created playback conversation info
|
|
124
124
|
*/
|
|
125
125
|
createPlaybackConversation(id: string): Promise<CreatePlaybackConversationResponse>;
|
|
126
|
+
/**
|
|
127
|
+
* Stop selected playback conversation
|
|
128
|
+
* @returns Returns normal conversation after stopping playback
|
|
129
|
+
*/
|
|
130
|
+
stopSelectedPlaybackConversation(): Promise<StopSelectedPlaybackConversationResponse>;
|
|
126
131
|
/**
|
|
127
132
|
* Export conversation
|
|
128
133
|
* @param {string} id - id of conversation to export
|
|
@@ -153,6 +158,17 @@ export declare class ChatOverlay {
|
|
|
153
158
|
* @param content {string} text of message that should be sent to the chat
|
|
154
159
|
*/
|
|
155
160
|
sendMessage(content: string): Promise<SendMessageResponse>;
|
|
161
|
+
/**
|
|
162
|
+
* Delete message in current selected conversation by index
|
|
163
|
+
* @param index {number} index of message in conversation
|
|
164
|
+
* NOTE: if message on index is user message it will also remove answer from assistant
|
|
165
|
+
*/
|
|
166
|
+
deleteMessage(index: number): Promise<DeleteMessageResponse>;
|
|
167
|
+
/**
|
|
168
|
+
* Set input content
|
|
169
|
+
* @param content {string} content to set in chat input
|
|
170
|
+
*/
|
|
171
|
+
setInputContent(content: string): Promise<void>;
|
|
156
172
|
/**
|
|
157
173
|
* Set systemPrompt into the first selected conversation
|
|
158
174
|
* @param systemPrompt {string} text content of system prompt
|
|
@@ -86,6 +86,8 @@ export declare class ChatOverlayManager {
|
|
|
86
86
|
setSystemPrompt(overlayId: string, systemPrompt: string): Promise<void>;
|
|
87
87
|
getMessages(overlayId: string): Promise<import("@epam/ai-dial-shared").GetMessagesResponse>;
|
|
88
88
|
sendMessage(overlayId: string, content: string): Promise<void>;
|
|
89
|
+
deleteMessage(overlayId: string, index: number): Promise<import("@epam/ai-dial-shared").DeleteMessageResponse>;
|
|
90
|
+
setInputContent(overlayId: string, content: string): Promise<void>;
|
|
89
91
|
getConversations(overlayId: string): Promise<import("@epam/ai-dial-shared").GetConversationsResponse>;
|
|
90
92
|
getSelectedConversations(overlayId: string): Promise<import("@epam/ai-dial-shared").GetSelectedConversationsResponse>;
|
|
91
93
|
createConversation(overlayId: string, parentPath?: string | null): Promise<import("@epam/ai-dial-shared").CreateConversationResponse>;
|
|
@@ -95,6 +97,7 @@ export declare class ChatOverlayManager {
|
|
|
95
97
|
setOverlayOptions(overlayId: string, options: ChatOverlayOptions): Promise<void>;
|
|
96
98
|
deleteConversation(overlayId: string, conversationId: string): Promise<void>;
|
|
97
99
|
createPlaybackConversation(overlayId: string, conversationId: string): Promise<import("@epam/ai-dial-shared").CreatePlaybackConversationResponse>;
|
|
100
|
+
stopSelectedPlaybackConversation(overlayId: string): Promise<import("@epam/ai-dial-shared").StopSelectedPlaybackConversationResponse>;
|
|
98
101
|
exportConversation(overlayId: string, conversationId: string): Promise<import("@epam/ai-dial-shared").ExportConversationResponse>;
|
|
99
102
|
importConversation(overlayId: string, importedConversation: LatestExportConversationsFormat): Promise<import("@epam/ai-dial-shared").ImportConversationResponse>;
|
|
100
103
|
subscribe(overlayId: string, eventType: string, callback: (payload?: unknown) => void): () => void;
|