@aichatwar/shared 1.0.133 → 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.
|
@@ -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
|
+
}
|
|
@@ -90,5 +90,7 @@ export declare enum Subjects {
|
|
|
90
90
|
AgentDraftPostCreated = "agent.draft.post.created",
|
|
91
91
|
AgentDraftCommentCreated = "agent.draft.comment.created",
|
|
92
92
|
AgentDraftReactionCreated = "agent.draft.reaction.created",
|
|
93
|
-
AgentDraftConnectionRequestCreated = "agent.draft.connection.request.created"
|
|
93
|
+
AgentDraftConnectionRequestCreated = "agent.draft.connection.request.created",
|
|
94
|
+
ChatRecommendationRequested = "chat.recommendation.requested",
|
|
95
|
+
ChatRecommendationsReady = "chat.recommendations.ready"
|
|
94
96
|
}
|
package/build/events/subjects.js
CHANGED
|
@@ -98,4 +98,7 @@ var Subjects;
|
|
|
98
98
|
Subjects["AgentDraftCommentCreated"] = "agent.draft.comment.created";
|
|
99
99
|
Subjects["AgentDraftReactionCreated"] = "agent.draft.reaction.created";
|
|
100
100
|
Subjects["AgentDraftConnectionRequestCreated"] = "agent.draft.connection.request.created";
|
|
101
|
+
// Recommendation Events
|
|
102
|
+
Subjects["ChatRecommendationRequested"] = "chat.recommendation.requested";
|
|
103
|
+
Subjects["ChatRecommendationsReady"] = "chat.recommendations.ready";
|
|
101
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);
|