proactive agent proxy now runs models for responses
This commit is contained in:
25
proactiveAgent/snippets/DigitalWelcomeEvent.js
Normal file
25
proactiveAgent/snippets/DigitalWelcomeEvent.js
Normal 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);
|
||||
}
|
||||
}
|
||||
);
|
||||
17
proactiveAgent/snippets/join.js
Normal file
17
proactiveAgent/snippets/join.js
Normal 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();
|
||||
});
|
||||
Reference in New Issue
Block a user