doers-comms-types 1.0.10 → 1.0.12
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.
|
@@ -11,6 +11,7 @@ export declare class Conversation {
|
|
|
11
11
|
}
|
|
12
12
|
export declare class ConversationAux extends Conversation {
|
|
13
13
|
readonly messages: Message[];
|
|
14
|
+
readonly max_action_time: string;
|
|
14
15
|
constructor(conversation: any);
|
|
15
16
|
static is(conversation: any): conversation is ConversationAux;
|
|
16
17
|
}
|
|
@@ -27,16 +27,19 @@ export class Conversation {
|
|
|
27
27
|
}
|
|
28
28
|
export class ConversationAux extends Conversation {
|
|
29
29
|
messages;
|
|
30
|
+
max_action_time;
|
|
30
31
|
constructor(conversation) {
|
|
31
32
|
if (!ConversationAux.is(conversation)) {
|
|
32
33
|
throw Error("Invalid input.");
|
|
33
34
|
}
|
|
34
35
|
super(conversation);
|
|
35
36
|
this.messages = conversation.messages;
|
|
37
|
+
this.max_action_time = conversation.max_action_time;
|
|
36
38
|
}
|
|
37
39
|
static is(conversation) {
|
|
38
40
|
return (Conversation.is(conversation) &&
|
|
39
41
|
Array.isArray(conversation.messages) &&
|
|
40
|
-
conversation.messages.every(Message.is)
|
|
42
|
+
conversation.messages.every(Message.is) &&
|
|
43
|
+
typeof conversation.max_action_time === "string");
|
|
41
44
|
}
|
|
42
45
|
}
|
|
@@ -15,7 +15,9 @@ export declare class Post {
|
|
|
15
15
|
export declare class Message {
|
|
16
16
|
readonly user_id: string;
|
|
17
17
|
readonly message_id: string;
|
|
18
|
+
readonly bot_id: string;
|
|
18
19
|
readonly conversation_id: string;
|
|
20
|
+
readonly time: string;
|
|
19
21
|
readonly mode: "email" | "general";
|
|
20
22
|
readonly role: "user" | "bot";
|
|
21
23
|
readonly system_prompt?: string;
|
|
@@ -37,7 +37,9 @@ export class Post {
|
|
|
37
37
|
export class Message {
|
|
38
38
|
user_id;
|
|
39
39
|
message_id;
|
|
40
|
+
bot_id;
|
|
40
41
|
conversation_id;
|
|
42
|
+
time;
|
|
41
43
|
mode;
|
|
42
44
|
role;
|
|
43
45
|
system_prompt;
|
|
@@ -52,7 +54,9 @@ export class Message {
|
|
|
52
54
|
}
|
|
53
55
|
this.user_id = message.user_id;
|
|
54
56
|
this.message_id = message.message_id;
|
|
57
|
+
this.bot_id = message.bot_id;
|
|
55
58
|
this.conversation_id = message.conversation_id;
|
|
59
|
+
this.time = message.time;
|
|
56
60
|
this.mode = message.mode;
|
|
57
61
|
this.role = message.role;
|
|
58
62
|
this.system_prompt = message.system_prompt;
|
|
@@ -66,7 +70,9 @@ export class Message {
|
|
|
66
70
|
return (message !== undefined &&
|
|
67
71
|
typeof message.user_id === "string" &&
|
|
68
72
|
typeof message.message_id === "string" &&
|
|
73
|
+
typeof message.bot_id === "string" &&
|
|
69
74
|
typeof message.conversation_id === "string" &&
|
|
75
|
+
typeof message.time === "string" &&
|
|
70
76
|
["email", "general"].includes(message.mode) &&
|
|
71
77
|
["user", "bot"].includes(message.role) &&
|
|
72
78
|
(message.system_prompt === undefined || typeof message.system_prompt === "string") &&
|
package/package.json
CHANGED
|
@@ -34,6 +34,7 @@ export class Conversation {
|
|
|
34
34
|
|
|
35
35
|
export class ConversationAux extends Conversation {
|
|
36
36
|
readonly messages : Message[]
|
|
37
|
+
readonly max_action_time : string
|
|
37
38
|
|
|
38
39
|
constructor(conversation : any) {
|
|
39
40
|
if (!ConversationAux.is(conversation)) {
|
|
@@ -41,13 +42,15 @@ export class ConversationAux extends Conversation {
|
|
|
41
42
|
}
|
|
42
43
|
super(conversation)
|
|
43
44
|
this.messages = conversation.messages
|
|
45
|
+
this.max_action_time = conversation.max_action_time
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
static is(conversation : any) : conversation is ConversationAux {
|
|
47
49
|
return (
|
|
48
50
|
Conversation.is(conversation) &&
|
|
49
51
|
Array.isArray(conversation.messages) &&
|
|
50
|
-
conversation.messages.every(Message.is)
|
|
52
|
+
conversation.messages.every(Message.is) &&
|
|
53
|
+
typeof conversation.max_action_time === "string"
|
|
51
54
|
)
|
|
52
55
|
}
|
|
53
56
|
}
|
package/src/types/Message.ts
CHANGED
|
@@ -48,7 +48,9 @@ export class Post {
|
|
|
48
48
|
export class Message {
|
|
49
49
|
readonly user_id : string
|
|
50
50
|
readonly message_id : string
|
|
51
|
+
readonly bot_id : string
|
|
51
52
|
readonly conversation_id : string
|
|
53
|
+
readonly time : string
|
|
52
54
|
readonly mode : "email" | "general"
|
|
53
55
|
readonly role : "user" | "bot"
|
|
54
56
|
readonly system_prompt? : string
|
|
@@ -64,7 +66,9 @@ export class Message {
|
|
|
64
66
|
}
|
|
65
67
|
this.user_id = message.user_id
|
|
66
68
|
this.message_id = message.message_id
|
|
69
|
+
this.bot_id = message.bot_id
|
|
67
70
|
this.conversation_id = message.conversation_id
|
|
71
|
+
this.time = message.time
|
|
68
72
|
this.mode = message.mode
|
|
69
73
|
this.role = message.role
|
|
70
74
|
this.system_prompt = message.system_prompt
|
|
@@ -80,7 +84,9 @@ export class Message {
|
|
|
80
84
|
message !== undefined &&
|
|
81
85
|
typeof message.user_id === "string" &&
|
|
82
86
|
typeof message.message_id === "string" &&
|
|
87
|
+
typeof message.bot_id === "string" &&
|
|
83
88
|
typeof message.conversation_id === "string" &&
|
|
89
|
+
typeof message.time === "string" &&
|
|
84
90
|
["email", "general"].includes(message.mode) &&
|
|
85
91
|
["user", "bot"].includes(message.role) &&
|
|
86
92
|
(message.system_prompt === undefined || typeof message.system_prompt === "string") &&
|