proactive agent proxy now runs models for responses

This commit is contained in:
2025-08-07 00:48:43 -05:00
parent 166cded7da
commit 27d7474354
4 changed files with 340 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
// Add this code to the Messenger's 'On Engagement Load' block
window.askIVA = (input, postBack, metadata, configuration) => {
// store.main.showMessenger();
// store.main.setView("chat");
// store.main.setNcPing(crypto.randomUUID());
store.conversationEvent.sendMessage({
input,
postBack,
metadata,
configuration,
});
};
// Set form when messenger is opened
vm.$watch(
() => store.main.newConversation,
async (value) => {
if (value) {
console.log("Starting New Conversation...");
setTimeout(() => {
window.askIVA("Digital Wecome Event");
}, 100);
}
}
);

View File

@@ -0,0 +1,17 @@
(async () => {
proactive_agent.joinConversation(conversationData.id);
})()
.catch((error) => {
console.log(error.message);
recognizedObject.answers.push("");
recognizedObject.errorInfo = {
...recognizedObject.errorInfo,
label: {
data: error.toJSON ? error.toJSON() : {},
message: error.message,
},
};
})
.finally(() => {
next();
});