@eloquentai/chat-sdk 0.28.0-dev → 0.28.1-dev
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/dist/components/chat/chat.hook.d.ts +1 -0
- package/dist/components/chat/message-events.hook.d.ts +1 -0
- package/dist/components/chat/realtime-socket.hook.d.ts +2 -1
- package/dist/components/chat/validations.d.ts +12 -0
- package/dist/components/chat-interface/index.d.ts +1 -0
- package/dist/components/chat-rating-bubble.d.ts +5 -0
- package/dist/components/ui/star-rating.d.ts +7 -0
- package/dist/{index-Cz04-eYM.js → index-B_F5Vl5q.js} +5332 -5223
- package/dist/index-B_F5Vl5q.js.map +1 -0
- package/dist/{index-B4pyd17c.js → index-hAlYCc4S.js} +2 -2
- package/dist/{index-B4pyd17c.js.map → index-hAlYCc4S.js.map} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/eloquent-ai-api-client.d.ts +4 -0
- package/dist/lib/http.d.ts +1 -0
- package/dist/type.d.ts +1 -0
- package/package.json +1 -1
- package/dist/index-Cz04-eYM.js.map +0 -1
|
@@ -33,6 +33,7 @@ export interface UseChatReturn {
|
|
|
33
33
|
hideProactiveMessage: () => void;
|
|
34
34
|
isChatClosed: boolean;
|
|
35
35
|
onStartNewChat: () => void;
|
|
36
|
+
onRateChat: (rating: number) => Promise<void>;
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* The primary chat hook, responsible for managing the chat state and operations.
|
|
@@ -24,6 +24,7 @@ export interface UseMessageEventsProps {
|
|
|
24
24
|
export interface UseMessageEventsReturn {
|
|
25
25
|
onCleanMessages: () => void;
|
|
26
26
|
onSendMessage: (data: MessageData) => Promise<void>;
|
|
27
|
+
onRateChat: (rating: number) => Promise<void>;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* Hook to handle message events like sending and cleaning
|
|
@@ -13,6 +13,7 @@ export type UseRealtimeSocketOptions = {
|
|
|
13
13
|
onAgentCapturedUrl?: (content: string) => void;
|
|
14
14
|
onAgentTopic?: (content: string) => void;
|
|
15
15
|
onAgentSummary?: (content: string) => void;
|
|
16
|
+
onRatingRequest?: () => void;
|
|
16
17
|
fetchHistory: (chatId: string) => Promise<MessageResponse[]>;
|
|
17
18
|
backupPollingInterval?: number;
|
|
18
19
|
};
|
|
@@ -21,4 +22,4 @@ export type UseRealtimeSocketReturn = {
|
|
|
21
22
|
disconnect: () => void;
|
|
22
23
|
clearProcessedIds: () => void;
|
|
23
24
|
};
|
|
24
|
-
export declare function useRealtimeSocket({ chatSettings, chatId, messages, onMessage, onCognition, onCognitionComplete, onError, onChatClosed, onAgentCapturedUrl, onAgentTopic, onAgentSummary, fetchHistory, backupPollingInterval, }: UseRealtimeSocketOptions): UseRealtimeSocketReturn;
|
|
25
|
+
export declare function useRealtimeSocket({ chatSettings, chatId, messages, onMessage, onCognition, onCognitionComplete, onError, onChatClosed, onAgentCapturedUrl, onAgentTopic, onAgentSummary, onRatingRequest, fetchHistory, backupPollingInterval, }: UseRealtimeSocketOptions): UseRealtimeSocketReturn;
|
|
@@ -44,6 +44,12 @@ export declare const chatResponseApiSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
44
44
|
type: z.ZodLiteral<"chat_closed_expired">;
|
|
45
45
|
content: z.ZodString;
|
|
46
46
|
}, z.core.$strip>;
|
|
47
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
created_at: z.ZodString;
|
|
49
|
+
data: z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"chat_rating">;
|
|
51
|
+
content: z.ZodString;
|
|
52
|
+
}, z.core.$strip>;
|
|
47
53
|
}, z.core.$strip>]>;
|
|
48
54
|
export type ChatResponseApi = z.infer<typeof chatResponseApiSchema>;
|
|
49
55
|
type NotificationData = ChatResponseApi["data"];
|
|
@@ -91,6 +97,12 @@ export type ChatClosedExpiredNotification = {
|
|
|
91
97
|
type: "chat_closed_expired";
|
|
92
98
|
}>;
|
|
93
99
|
};
|
|
100
|
+
export type ChatRatingNotification = {
|
|
101
|
+
created_at: string;
|
|
102
|
+
data: Extract<NotificationData, {
|
|
103
|
+
type: "chat_rating";
|
|
104
|
+
}>;
|
|
105
|
+
};
|
|
94
106
|
export declare const chatResponseSchema: z.ZodObject<{
|
|
95
107
|
message_id: z.ZodString;
|
|
96
108
|
response: z.ZodObject<{
|
|
@@ -21,5 +21,6 @@ export interface ChatInterfaceProps {
|
|
|
21
21
|
onCleanChat?: () => void;
|
|
22
22
|
isChatClosed?: boolean;
|
|
23
23
|
onStartNewChat?: () => void;
|
|
24
|
+
onRateChat?: (rating: number) => void;
|
|
24
25
|
}
|
|
25
26
|
export declare function ChatInterface(props: ChatInterfaceProps): import("react/jsx-runtime").JSX.Element;
|