@fonoster/autopilot 0.12.7 → 0.12.8
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.
|
@@ -133,7 +133,12 @@ async function handleVoiceRequest(req, res) {
|
|
|
133
133
|
})
|
|
134
134
|
.filter(Boolean);
|
|
135
135
|
if (assistantConfig.eventsHook?.url) {
|
|
136
|
-
await (0, sendConversationEndedEvent_1.sendConversationEndedEvent)(assistantConfig.eventsHook,
|
|
136
|
+
await (0, sendConversationEndedEvent_1.sendConversationEndedEvent)(assistantConfig.eventsHook, {
|
|
137
|
+
chatHistory: chatHistory,
|
|
138
|
+
phone: ingressNumber,
|
|
139
|
+
appRef,
|
|
140
|
+
sessionRef
|
|
141
|
+
});
|
|
137
142
|
}
|
|
138
143
|
});
|
|
139
144
|
}
|
|
@@ -22,4 +22,9 @@ export type EventsHook = {
|
|
|
22
22
|
events: EventsHookAllowedEvents[];
|
|
23
23
|
headers?: Record<string, string>;
|
|
24
24
|
};
|
|
25
|
-
export declare function sendConversationEndedEvent(eventsHook: EventsHook,
|
|
25
|
+
export declare function sendConversationEndedEvent(eventsHook: EventsHook, data: {
|
|
26
|
+
chatHistory: Record<string, string>[];
|
|
27
|
+
phone: string;
|
|
28
|
+
appRef: string;
|
|
29
|
+
sessionRef: string;
|
|
30
|
+
}): Promise<void>;
|
|
@@ -22,7 +22,8 @@ exports.sendConversationEndedEvent = sendConversationEndedEvent;
|
|
|
22
22
|
const common_1 = require("@fonoster/common");
|
|
23
23
|
const logger_1 = require("@fonoster/logger");
|
|
24
24
|
const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
|
|
25
|
-
async function sendConversationEndedEvent(eventsHook,
|
|
25
|
+
async function sendConversationEndedEvent(eventsHook, data) {
|
|
26
|
+
const { chatHistory, phone, appRef, sessionRef } = data;
|
|
26
27
|
if (!eventsHook?.events.includes(common_1.EventsHookAllowedEvents.CONVERSATION_ENDED) &&
|
|
27
28
|
!eventsHook?.events.includes(common_1.EventsHookAllowedEvents.ALL)) {
|
|
28
29
|
return;
|
|
@@ -30,6 +31,8 @@ async function sendConversationEndedEvent(eventsHook, chatHistory, phone) {
|
|
|
30
31
|
const parsedEventsHook = common_1.eventsHookSchema.parse(eventsHook);
|
|
31
32
|
const body = {
|
|
32
33
|
eventType: common_1.EventsHookAllowedEvents.CONVERSATION_ENDED,
|
|
34
|
+
appRef,
|
|
35
|
+
sessionRef,
|
|
33
36
|
phone,
|
|
34
37
|
chatHistory
|
|
35
38
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/autopilot",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.8",
|
|
4
4
|
"description": "Voice AI for the Fonoster platform",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"xstate": "^5.17.3",
|
|
60
60
|
"zod": "^3.23.8"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "9f8a2105d2b9d7b98bb32d9439e3314b747e1083"
|
|
63
63
|
}
|