@epam/ai-dial-shared 0.18.0-rc.9 → 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 CHANGED
@@ -22,6 +22,9 @@ var Feature;
22
22
  Feature["CustomLogo"] = "custom-logo";
23
23
  Feature["HideNewConversation"] = "hide-new-conversation";
24
24
  Feature["CustomApplications"] = "custom-applications";
25
+ Feature["MessageTemplates"] = "message-templates";
26
+ Feature["Marketplace"] = "marketplace";
27
+ Feature["QuickApps"] = "quick-apps";
25
28
  })(Feature || (Feature = {}));
26
29
  const availableFeatures = {
27
30
  [Feature.ConversationsSection]: true,
@@ -46,8 +49,37 @@ const availableFeatures = {
46
49
  [Feature.CustomLogo]: true,
47
50
  [Feature.HideNewConversation]: true,
48
51
  [Feature.CustomApplications]: true,
52
+ [Feature.MessageTemplates]: true,
53
+ [Feature.Marketplace]: true,
54
+ [Feature.QuickApps]: true,
49
55
  };
50
56
 
57
+ var Role;
58
+ (function (Role) {
59
+ Role["Assistant"] = "assistant";
60
+ Role["User"] = "user";
61
+ Role["System"] = "system";
62
+ })(Role || (Role = {}));
63
+ var LikeState;
64
+ (function (LikeState) {
65
+ LikeState[LikeState["Disliked"] = -1] = "Disliked";
66
+ LikeState[LikeState["Liked"] = 1] = "Liked";
67
+ LikeState[LikeState["NoState"] = 0] = "NoState";
68
+ })(LikeState || (LikeState = {}));
69
+ var UploadStatus;
70
+ (function (UploadStatus) {
71
+ UploadStatus["UNINITIALIZED"] = "UNINITIALIZED";
72
+ UploadStatus["LOADING"] = "UPLOADING";
73
+ UploadStatus["LOADED"] = "LOADED";
74
+ UploadStatus["FAILED"] = "FAILED";
75
+ UploadStatus["ALL_LOADED"] = "ALL_LOADED";
76
+ })(UploadStatus || (UploadStatus = {}));
77
+ var PublishActions;
78
+ (function (PublishActions) {
79
+ PublishActions["ADD"] = "ADD";
80
+ PublishActions["DELETE"] = "DELETE";
81
+ })(PublishActions || (PublishActions = {}));
82
+
51
83
  const validateFeature = (feature) => {
52
84
  return feature in availableFeatures;
53
85
  };
@@ -144,6 +176,9 @@ const overlayAppName = '@DIAL_OVERLAY';
144
176
  var OverlayRequests;
145
177
  (function (OverlayRequests) {
146
178
  OverlayRequests["getMessages"] = "GET_MESSAGES";
179
+ OverlayRequests["getConversations"] = "GET_CONVERSATIONS";
180
+ OverlayRequests["selectConversation"] = "SELECT_CONVERSATION";
181
+ OverlayRequests["createConversation"] = "CREATE_CONVERSATION";
147
182
  OverlayRequests["setOverlayOptions"] = "SET_OVERLAY_OPTIONS";
148
183
  OverlayRequests["setSystemPrompt"] = "SET_SYSTEM_PROMPT";
149
184
  OverlayRequests["sendMessage"] = "SEND_MESSAGE";
@@ -199,4 +234,4 @@ var VisualizerConnectorRequests;
199
234
  VisualizerConnectorRequests["setVisualizerOptions"] = "SET_VISUALIZER_OPTIONS";
200
235
  })(VisualizerConnectorRequests || (VisualizerConnectorRequests = {}));
201
236
 
202
- export { DeferredRequest, Feature, OverlayEvents, OverlayRequests, Task, VisualizerConnectorEvents, VisualizerConnectorRequests, availableFeatures, overlayAppName, overlayLibName, setStyles, validateFeature, visualizerConnectorLibName };
237
+ export { DeferredRequest, Feature, LikeState, OverlayEvents, OverlayRequests, PublishActions, Role, Task, UploadStatus, VisualizerConnectorEvents, VisualizerConnectorRequests, availableFeatures, overlayAppName, overlayLibName, setStyles, validateFeature, visualizerConnectorLibName };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@epam/ai-dial-shared",
3
3
  "description": "Shared elements that support developing DIAL",
4
4
  "homepage": "https://epam-rail.com",
5
- "version": "0.18.0-rc.9",
5
+ "version": "0.18.0",
6
6
  "dependencies": {},
7
7
  "type": "module",
8
8
  "bugs": {
@@ -1,6 +1,9 @@
1
1
  export declare const overlayAppName = "@DIAL_OVERLAY";
2
2
  export declare enum OverlayRequests {
3
3
  getMessages = "GET_MESSAGES",
4
+ getConversations = "GET_CONVERSATIONS",
5
+ selectConversation = "SELECT_CONVERSATION",
6
+ createConversation = "CREATE_CONVERSATION",
4
7
  setOverlayOptions = "SET_OVERLAY_OPTIONS",
5
8
  setSystemPrompt = "SET_SYSTEM_PROMPT",
6
9
  sendMessage = "SEND_MESSAGE"
@@ -0,0 +1,92 @@
1
+ export declare enum Role {
2
+ Assistant = "assistant",
3
+ User = "user",
4
+ System = "system"
5
+ }
6
+ export type ImageMIMEType = 'image/jpeg' | 'image/png' | string;
7
+ export type MIMEType = 'text/markdown' | 'text/plain' | 'text/html' | ImageMIMEType | string;
8
+ export interface Attachment {
9
+ index?: number;
10
+ type: MIMEType;
11
+ title: string;
12
+ data?: string;
13
+ url?: string;
14
+ reference_type?: MIMEType;
15
+ reference_url?: string;
16
+ }
17
+ export type StageStatus = 'completed' | 'failed' | null;
18
+ export interface Stage {
19
+ index: number;
20
+ name: string;
21
+ content?: string;
22
+ attachments?: Attachment[];
23
+ status: StageStatus;
24
+ }
25
+ export declare enum LikeState {
26
+ Disliked = -1,
27
+ Liked = 1,
28
+ NoState = 0
29
+ }
30
+ export interface MessageSettings {
31
+ prompt: string;
32
+ temperature: number;
33
+ selectedAddons: string[];
34
+ assistantModelId?: string;
35
+ }
36
+ export interface ConversationEntityModel {
37
+ id: string;
38
+ }
39
+ export interface Message {
40
+ role: Role;
41
+ content: string;
42
+ custom_content?: {
43
+ attachments?: Attachment[];
44
+ stages?: Stage[];
45
+ state?: object;
46
+ };
47
+ like?: LikeState;
48
+ errorMessage?: string;
49
+ model?: ConversationEntityModel;
50
+ settings?: MessageSettings;
51
+ responseId?: string;
52
+ templateMapping?: TemplateMapping[] | Record<string, string>;
53
+ }
54
+ export declare enum UploadStatus {
55
+ UNINITIALIZED = "UNINITIALIZED",
56
+ LOADING = "UPLOADING",
57
+ LOADED = "LOADED",
58
+ FAILED = "FAILED",
59
+ ALL_LOADED = "ALL_LOADED"
60
+ }
61
+ export interface Entity {
62
+ id: string;
63
+ name: string;
64
+ folderId: string;
65
+ status?: UploadStatus;
66
+ }
67
+ export declare enum PublishActions {
68
+ ADD = "ADD",
69
+ DELETE = "DELETE"
70
+ }
71
+ export interface EntityPublicationInfo {
72
+ action?: PublishActions;
73
+ isNotExist?: boolean;
74
+ version?: string;
75
+ versionGroup?: string;
76
+ }
77
+ export interface ShareInterface {
78
+ isShared?: boolean;
79
+ sharedWithMe?: boolean;
80
+ isPublished?: boolean;
81
+ publishedWithMe?: boolean;
82
+ publicationInfo?: EntityPublicationInfo;
83
+ }
84
+ export interface ShareEntity extends Entity, ShareInterface {
85
+ }
86
+ export interface ConversationInfo extends ShareEntity {
87
+ model: ConversationEntityModel;
88
+ lastActivityDate?: number;
89
+ isPlayback?: boolean;
90
+ isReplay?: boolean;
91
+ }
92
+ export type TemplateMapping = [string, string];
@@ -20,6 +20,9 @@ export declare enum Feature {
20
20
  PromptsPublishing = "prompts-publishing",
21
21
  CustomLogo = "custom-logo",
22
22
  HideNewConversation = "hide-new-conversation",
23
- CustomApplications = "custom-applications"
23
+ CustomApplications = "custom-applications",
24
+ MessageTemplates = "message-templates",
25
+ Marketplace = "marketplace",
26
+ QuickApps = "quick-apps"
24
27
  }
25
28
  export declare const availableFeatures: Record<Feature, boolean>;
@@ -1,4 +1,5 @@
1
1
  export * from './features';
2
- export * from './overlay';
3
2
  export * from './visualizer-connector';
4
3
  export * from './common';
4
+ export * from './chat';
5
+ export * from './overlay';
@@ -0,0 +1,5 @@
1
+ import { ConversationInfo } from '../chat';
2
+ export type OverlayConversation = ConversationInfo & {
3
+ bucket: string;
4
+ parentPath?: string | null;
5
+ };
@@ -0,0 +1,3 @@
1
+ export interface SelectedConversationLoadedResponse {
2
+ selectedConversationIds: string[];
3
+ }
@@ -0,0 +1,5 @@
1
+ export * from './conversation';
2
+ export * from './overlay';
3
+ export * from './response';
4
+ export * from './request';
5
+ export * from './events';
@@ -1,5 +1,5 @@
1
- import { DialLibRequest, Styles } from './common';
2
- import { Feature } from './features';
1
+ import { DialLibRequest, Styles } from '../common';
2
+ import { Feature } from '../features';
3
3
  export type OverlayRequest = DialLibRequest;
4
4
  export interface ChatOverlayOptions {
5
5
  domain: string;
@@ -0,0 +1,12 @@
1
+ export interface SendMessageRequest {
2
+ content: string;
3
+ }
4
+ export interface SetSystemPromptRequest {
5
+ systemPrompt: string;
6
+ }
7
+ export interface CreateConversationRequest {
8
+ parentPath?: string | null;
9
+ }
10
+ export interface SelectConversationRequest {
11
+ id: string;
12
+ }
@@ -0,0 +1,16 @@
1
+ import { Message } from '../chat';
2
+ import { OverlayConversation } from './conversation';
3
+ export type SendMessageResponse = void;
4
+ export type SetSystemPromptResponse = void;
5
+ export interface GetMessagesResponse {
6
+ messages: Message[];
7
+ }
8
+ export interface GetConversationsResponse {
9
+ conversations: OverlayConversation[];
10
+ }
11
+ export interface CreateConversationResponse {
12
+ conversation: OverlayConversation;
13
+ }
14
+ export interface SelectConversationResponse {
15
+ conversation: OverlayConversation;
16
+ }