@aichatwar/shared 1.0.132 → 1.0.134
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/build/events/feedbackEvents.d.ts +1 -28
- package/build/events/messageEvents.d.ts +1 -0
- package/build/events/recommendationEvents.d.ts +76 -0
- package/build/events/recommendationEvents.js +2 -0
- package/build/events/subjects.d.ts +3 -2
- package/build/events/subjects.js +3 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,32 +1,5 @@
|
|
|
1
1
|
import { BaseEvent } from "./baseEvent";
|
|
2
2
|
import { Subjects } from "./subjects";
|
|
3
|
-
interface FeedbackCreatedEvent extends BaseEvent {
|
|
4
|
-
subject: Subjects.FeedbackCreated;
|
|
5
|
-
data: {
|
|
6
|
-
id: string;
|
|
7
|
-
feedbackType: 'explicit' | 'implicit' | 'reaction';
|
|
8
|
-
source: 'chat' | 'post' | 'comment' | 'profile';
|
|
9
|
-
sourceId: string;
|
|
10
|
-
agentId: string;
|
|
11
|
-
userId: string;
|
|
12
|
-
roomId?: string;
|
|
13
|
-
value: number;
|
|
14
|
-
metadata?: {
|
|
15
|
-
reactionType?: 'like' | 'love' | 'laugh' | 'wow' | 'sad' | 'dislike';
|
|
16
|
-
rating?: number;
|
|
17
|
-
text?: string;
|
|
18
|
-
context?: {
|
|
19
|
-
messageContent?: string;
|
|
20
|
-
agentResponse?: string;
|
|
21
|
-
conversationLength?: number;
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
};
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
};
|
|
26
|
-
createdAt: string;
|
|
27
|
-
updatedAt: string;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
3
|
interface AgentLearningUpdatedEvent extends BaseEvent {
|
|
31
4
|
subject: Subjects.AgentLearningUpdated;
|
|
32
5
|
data: {
|
|
@@ -130,4 +103,4 @@ interface FeedbackReactionReceivedEvent extends BaseEvent {
|
|
|
130
103
|
createdAt: string;
|
|
131
104
|
};
|
|
132
105
|
}
|
|
133
|
-
export {
|
|
106
|
+
export { FeedbackReplyReceivedEvent, FeedbackReactionReceivedEvent, AgentLearningUpdatedEvent, TrainingDatasetReadyEvent, ModelUpdatedEvent };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Subjects } from './subjects';
|
|
2
|
+
/**
|
|
3
|
+
* ChatRecommendationRequestedEvent
|
|
4
|
+
* Published by: ai-chat-host service
|
|
5
|
+
* Consumed by: recommendation service
|
|
6
|
+
*
|
|
7
|
+
* Request for recommendations based on chat context
|
|
8
|
+
*/
|
|
9
|
+
export interface ChatRecommendationRequestedEvent {
|
|
10
|
+
subject: Subjects.ChatRecommendationRequested;
|
|
11
|
+
data: {
|
|
12
|
+
requestId: string;
|
|
13
|
+
userId: string;
|
|
14
|
+
contextType: 'chat';
|
|
15
|
+
roomId: string;
|
|
16
|
+
topics: string[];
|
|
17
|
+
sentiment: 'positive' | 'neutral' | 'negative';
|
|
18
|
+
intent: string;
|
|
19
|
+
domain: string;
|
|
20
|
+
agentsInRoom: string[];
|
|
21
|
+
participants: Array<{
|
|
22
|
+
userId: string;
|
|
23
|
+
type: 'human' | 'agent';
|
|
24
|
+
}>;
|
|
25
|
+
lastMessages?: Array<{
|
|
26
|
+
senderId: string;
|
|
27
|
+
type: 'human' | 'agent';
|
|
28
|
+
content: string;
|
|
29
|
+
}>;
|
|
30
|
+
language?: string;
|
|
31
|
+
messageCount: number;
|
|
32
|
+
lastActivityAt: string;
|
|
33
|
+
timestamp: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* ChatRecommendationsReadyEvent
|
|
38
|
+
* Published by: recommendation service
|
|
39
|
+
* Consumed by: ai-chat-host service
|
|
40
|
+
*
|
|
41
|
+
* Response with recommendations for chat context
|
|
42
|
+
* Separated by type for cleaner UI handling
|
|
43
|
+
*/
|
|
44
|
+
export interface ChatRecommendationsReadyEvent {
|
|
45
|
+
subject: Subjects.ChatRecommendationsReady;
|
|
46
|
+
data: {
|
|
47
|
+
requestId: string;
|
|
48
|
+
agentRecommendations: Recommendation[];
|
|
49
|
+
utilityRecommendations: Recommendation[];
|
|
50
|
+
metadata?: {
|
|
51
|
+
roomId?: string;
|
|
52
|
+
generatedAt: string;
|
|
53
|
+
totalCount: number;
|
|
54
|
+
};
|
|
55
|
+
timestamp: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Recommendation
|
|
60
|
+
* Generic recommendation item that can be agent, utility action, ad, content, etc.
|
|
61
|
+
*/
|
|
62
|
+
export interface Recommendation {
|
|
63
|
+
type: 'agent' | 'utility' | 'ad' | 'content';
|
|
64
|
+
agentId?: string;
|
|
65
|
+
action?: string;
|
|
66
|
+
label?: string;
|
|
67
|
+
score: number;
|
|
68
|
+
reason?: string;
|
|
69
|
+
metadata?: {
|
|
70
|
+
matchReasons?: string[];
|
|
71
|
+
confidence?: number;
|
|
72
|
+
name?: string;
|
|
73
|
+
displayName?: string;
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -50,7 +50,6 @@ export declare enum Subjects {
|
|
|
50
50
|
MediaDeleted = "media.deleted",
|
|
51
51
|
ReactionCreated = "reaction.created",
|
|
52
52
|
ReactionDeleted = "reaction.deleted",
|
|
53
|
-
FeedbackCreated = "feedback.created",
|
|
54
53
|
FeedbackReplyReceived = "feedback.reply.received",
|
|
55
54
|
FeedbackReactionReceived = "feedback.reaction.received",
|
|
56
55
|
AgentLearningUpdated = "agent.learning.updated",
|
|
@@ -91,5 +90,7 @@ export declare enum Subjects {
|
|
|
91
90
|
AgentDraftPostCreated = "agent.draft.post.created",
|
|
92
91
|
AgentDraftCommentCreated = "agent.draft.comment.created",
|
|
93
92
|
AgentDraftReactionCreated = "agent.draft.reaction.created",
|
|
94
|
-
AgentDraftConnectionRequestCreated = "agent.draft.connection.request.created"
|
|
93
|
+
AgentDraftConnectionRequestCreated = "agent.draft.connection.request.created",
|
|
94
|
+
ChatRecommendationRequested = "chat.recommendation.requested",
|
|
95
|
+
ChatRecommendationsReady = "chat.recommendations.ready"
|
|
95
96
|
}
|
package/build/events/subjects.js
CHANGED
|
@@ -54,7 +54,6 @@ var Subjects;
|
|
|
54
54
|
Subjects["MediaDeleted"] = "media.deleted";
|
|
55
55
|
Subjects["ReactionCreated"] = "reaction.created";
|
|
56
56
|
Subjects["ReactionDeleted"] = "reaction.deleted";
|
|
57
|
-
Subjects["FeedbackCreated"] = "feedback.created";
|
|
58
57
|
Subjects["FeedbackReplyReceived"] = "feedback.reply.received";
|
|
59
58
|
Subjects["FeedbackReactionReceived"] = "feedback.reaction.received";
|
|
60
59
|
Subjects["AgentLearningUpdated"] = "agent.learning.updated";
|
|
@@ -99,4 +98,7 @@ var Subjects;
|
|
|
99
98
|
Subjects["AgentDraftCommentCreated"] = "agent.draft.comment.created";
|
|
100
99
|
Subjects["AgentDraftReactionCreated"] = "agent.draft.reaction.created";
|
|
101
100
|
Subjects["AgentDraftConnectionRequestCreated"] = "agent.draft.connection.request.created";
|
|
101
|
+
// Recommendation Events
|
|
102
|
+
Subjects["ChatRecommendationRequested"] = "chat.recommendation.requested";
|
|
103
|
+
Subjects["ChatRecommendationsReady"] = "chat.recommendations.ready";
|
|
102
104
|
})(Subjects || (exports.Subjects = Subjects = {}));
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -50,3 +50,4 @@ __exportStar(require("./events/types/postStatus"), exports);
|
|
|
50
50
|
__exportStar(require("./events/userEvents"), exports);
|
|
51
51
|
__exportStar(require("./events/mediaEvents"), exports);
|
|
52
52
|
__exportStar(require("./events/agentManagerEvents"), exports);
|
|
53
|
+
__exportStar(require("./events/recommendationEvents"), exports);
|