Trouble with JumpTo [Report ID: report_01HYSCC54HB...
# 🤝help
b
hoping someone can sort out our JumpTo issues. neither of the following are working for us: 1) intent and hook: function hook(event: IO.IncomingEvent): Promise { /** Your code starts below */ const detectedIntent = event.nlu.intent.name; if (detectedIntent === "start_over") { const sessionId = bp.dialog.createId(event); const targetFlow = "main.flow.json"; const targetNode = "existing_or_potential_client"; if (bp && bp.dialog && typeof bp.dialog.jumpTo === "function") { await bp.dialog.jumpTo(sessionId, event, targetFlow, targetNode); bp.logger.info(
Successfully redirected to ${targetFlow}:${targetNode}
); } else { bp.logger.error("bp.dialog or bp.dialog.jumpTo is not available."); } } /** Your code ends here */ } 2) execute card: const sessionId = bp.dialog.createId(event); const targetFlow = "main.flow.json"; const targetNode = "existing_or_potential_client"; // Check if the user's choice is 'Start Over' if (workflow.startOver === 'Start Over') { // Directly jump to the specified node in the specified flow if (bp && bp.dialog && typeof bp.dialog.jumpTo === "function") { bp.dialog.jumpTo(sessionId, event, targetFlow, targetNode) .then(() => { bp.logger.info(
Successfully redirected to ${targetFlow}:${targetNode}
); }) .catch(err => { bp.logger.error(
Failed to redirect: ${err.message}
); }); } else { bp.logger.error("bp.dialog or bp.dialog.jumpTo is not available."); } }
f
Hey there, Just wondering where you saw that you could use
bp
?
b
Thanks for responding 🙂 The usage of bp comes from various examples and documentation of Botpress's SDK and API. It is a common practice in Botpress development to use the bp object to access Botpress functions and utilities. Should I try without 'bp'? Maybe this? for hook?? async function hook(event) { const detectedIntent = event.nlu.intent.name; if (detectedIntent === 'start_over') { const sessionId = event.target; const targetFlow = 'main.flow.json'; const targetNode = 'existing_or_potential_client'; if (typeof event.state.sessionId === 'function') { await event.state.sessionId(sessionId, event, targetFlow, targetNode); } else { throw new Error('sessionId function is not available'); } } } or, for execute cards??? if (workflow.startOver === 'Start Over') { const sessionId = event.target; const targetFlow = 'main.flow.json'; const targetNode = 'existing_or_potential_client'; if (typeof event.state.sessionId === 'function') { await event.state.sessionId(sessionId, event, targetFlow, targetNode) .then(() => { console.info(
Successfully redirected to ${targetFlow}:${targetNode}
); }) .catch(err => { console.error(
Failed to redirect: ${err.message}
); }); } else { console.error('sessionId function is not available.'); } } looking forward to receiving your help on this JumpTo situation.
f
I am pretty sure that
bp.
is something to use with the V12 I have seen examples of people using
bp.
, but none of them were stable. Maybe someone like @acceptable-kangaroo-64719 or @famous-jewelry-85388 knows a bit more about .bp than me. Mean while could you let me know what you are trying to do?
b
thanks! interested to see what they come back with 🙂 basically, if someone should type in "start over" or some iteration of that (or, click on "Start Over" from a single choice card), the site visitor would be pulled from whatever workflow they are in and be brought to a particular node (in this case, targetNode = 'existing_or_potential_client') in the main flow.
f
Ah okay. The router agent is in beta, but it would allow you to do this.
b
any idea on when this might be released? if not soon, I'll jut remove the workflows/text content that tells site visitors about it. that way, I can get this bot live on the site
f
Botpress unfortunately doesn't give out timelines so I am not sure 🙂
b
i've scrapped this idea. now i'm just desparately trying to get any features of the bot to work. i deployed it today at https://contactlesspaymentprocessing.com/ and i'm sooooooo disappointed. so underwhelmed and confused by how bad this is
f
What seems to be the issue?
b
i guess engineering is looking into why my bot looks (and acts) so bad. go to my website mentioned above and activate the bot. you'll see the text breaks in the middle of words. the dropdown selector overlays on the chat, the dropdown option shows the same text as the text field abot it. on the back end, although there are no zapier cards until the end of my flow, zapier triggers at the end of each node. it's a shit show https://cdn.discordapp.com/attachments/1244119121117974641/1245044060104818718/2024-05-27_13-14-59.png?ex=66575123&is=6655ffa3&hm=5ba3f661217a032b083ea264365c546852e3d4a61286632f873fd2dbee5e6c3e& https://cdn.discordapp.com/attachments/1244119121117974641/1245044060444561418/2024-05-27_13-49-10.png?ex=66575123&is=6655ffa3&hm=d965e000d92cb45c668aa553545553c9dd230fab2483815c0b3b79479732ed8d&
42 Views