https://discord.gg/botpress logo
#🤝help
Inter Bot Delegation
# 🤝help
b

busy-finland-27436

06/28/2023, 10:32 AM
How can I implement inter-bot delegation in Botpress 12? I tried to implement the following solution, but it did not work. Can anyone please help me out with this? 1) http://botpress-docs.s3-website-us-east-1.amazonaws.com/docs/12.22.1/tutorials/interbot/ 2) https://github.com/botpress/solutions/tree/master/custom%20modules/delegate-bot-conversation
a

acceptable-kangaroo-64719

06/28/2023, 10:33 AM
Hey @busy-finland-27436, the old botpress repo has been moved to /v12, so the example delagating bot is here https://github.com/botpress/v12/tree/master/examples/interbot
You're on the right track using the custom module for this, though. What specificlly isn't working?
b

busy-finland-27436

06/28/2023, 10:38 AM
The above solution does not work. I have created master bot through which user interacts. And I've also created two bots HR and IT related bot. After bot delegation, master bot should be able to response both HR and IT related response but does not work.
a

acceptable-kangaroo-64719

06/28/2023, 10:41 AM
There's a lot that can go wrong with inter-bot delegation: * The secondary bots don't understand the question * The secondary bots give the wrong answer * There's a connection issue between the primary and secondary bots * The primary bot doesn't instigate the delagation * The primary bot tries delegating to the wrong bot
Which of those is most like your error case?
b

busy-finland-27436

06/28/2023, 10:42 AM
Can you please provide me detailed steps @acceptable-kangaroo-64719
Inside primary bot, i have called
delegate-to-sub-bot.js
action. Secondary bots will only show simple text message so there might not be any problem
wrong answer
a

acceptable-kangaroo-64719

06/28/2023, 10:51 AM
are you doing a point-to-point delegation or an ensemble? And are you staying with the secondary bot after they give the answer, or reverting immediately back to the primary bot?
b

busy-finland-27436

06/28/2023, 10:51 AM
for now i'm just doing point-to-point which means there is only one secondary bot for now
but i need both @acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

06/28/2023, 10:54 AM
okay, and in your secondary bot do you stay in that bot or immediately transfer back to the primary bot?
b

busy-finland-27436

06/28/2023, 10:57 AM
first, primary bot should response the question of secondary bot. and also i must be able to immediately transfer back to the primary bot or stay in secondary bot. I need both requirements.
a

acceptable-kangaroo-64719

06/28/2023, 10:59 AM
ok. Why are you using the
delegate-to-sub-bot.js
action and not the cutom module?
b

busy-finland-27436

06/28/2023, 11:00 AM
how can i implement custom module, there is no any detailed steps that's why i tried with this.
@acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

06/28/2023, 11:01 AM
b

busy-finland-27436

06/28/2023, 11:03 AM
after importing
delegate-bot-conversation
module, do not i need to call action of this module?
a

acceptable-kangaroo-64719

06/28/2023, 11:05 AM
no, it's a skill so you would add the skill node
inside the node you can configure which bots to delegate to and how to cancel or leave the delegation
b

busy-finland-27436

06/28/2023, 11:07 AM
do i need to edit skill inside primary bot @acceptable-kangaroo-64719 ?
a

acceptable-kangaroo-64719

06/28/2023, 11:07 AM
yes. You also need to read the documentation on the module
b

busy-finland-27436

06/28/2023, 11:10 AM
thanks buddy let me try first
@acceptable-kangaroo-64719 Now i got error
a

acceptable-kangaroo-64719

06/28/2023, 12:00 PM
400 errors typically mean that your request is wrong. Are you sure you're using the right bot id in the delegation skill?
b

busy-finland-27436

06/28/2023, 12:00 PM
yup
it's human-resource
@acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

06/28/2023, 12:02 PM
and you have only one bot id in the delegation skill?
b

busy-finland-27436

06/28/2023, 12:03 PM
yup
@acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

06/28/2023, 12:05 PM
did you restart botpress after installing the module?
b

busy-finland-27436

06/28/2023, 12:05 PM
yup
again i will restart
@acceptable-kangaroo-64719
i tried restart but it does not fix the problem
getting 400 above as mentioned in above screenshot
a

acceptable-kangaroo-64719

06/28/2023, 12:15 PM
is the screenshot you shared the whole error?
b

busy-finland-27436

06/28/2023, 12:17 PM
yup
in fact, there is no any log of error i have added the error log
@acceptable-kangaroo-64719
const postConverse = async (userId, text, axiosConfig) => { const { data } = await axios .post(
/converse/${userId}/secured
, { type: 'text', text: text || event.preview, userIdentity: user.identity || {}, includedContexts: ['global'] }, { ...axiosConfig, params: { include: 'nlu' } } ) .catch(() => ({ data: {} /* We don't want the error to crash the master bot */ })) return data }
problem is in this request
a

acceptable-kangaroo-64719

06/28/2023, 12:21 PM
why is
text
repeated twice? It should be
text: event.preview
b

busy-finland-27436

06/28/2023, 12:26 PM
i've not edited the action it was already there @acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

06/28/2023, 12:26 PM
interesting
b

busy-finland-27436

06/28/2023, 12:27 PM
postConverse method is inside delete-to-sub-bot.js
a

acceptable-kangaroo-64719

06/28/2023, 12:27 PM
no, there's an or operator there in the original code
oh I think discord rendered it as somethign funky in markdown
||testing||
ah, yep it did
okay, well let's see if @famous-jewelry-85388, the author of the module, has anything to add
b

busy-finland-27436

06/28/2023, 12:30 PM
Do i have to wait for it?
will it be possible to send me a sample implementing bot delegation with at least 3 secondary bot?
@acceptable-kangaroo-64719
Hi, @famous-jewelry-85388, @acceptable-kangaroo-64719 ! any updates regarding the issue.
a

acoustic-hair-60678

06/29/2023, 4:28 AM
Hi @busy-finland-27436 Bassam is on vacation for the next couple of weeks. Until he's back let's see if Gordy or someone else from the team is able to help
b

busy-finland-27436

06/29/2023, 4:35 AM
alright
@acceptable-kangaroo-64719 are you available?
a

acceptable-kangaroo-64719

07/03/2023, 10:35 AM
Hey, I was also on holiday for a bit. Are you still having trouble with this?
b

busy-finland-27436

07/03/2023, 3:24 PM
Yes, still facing same issue
@acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

07/03/2023, 3:26 PM
alright. Have you tried anything new in the last 5 days?
b

busy-finland-27436

07/04/2023, 3:48 AM
i have found other doc which works but i need that one to meet my requirements
@acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

07/04/2023, 10:01 AM
what do you mean?
b

busy-finland-27436

07/12/2023, 7:19 AM
the way of implementing bot delegation in other doc which works for me is different.
@acoustic-hair-60678 @acceptable-kangaroo-64719 any update regarding the issue
@acceptable-kangaroo-64719 brother
I am still having issue while implementing bot-delegation
a

acceptable-kangaroo-64719

07/27/2023, 10:32 AM
Is this method no longer working for you?
b

busy-finland-27436

07/27/2023, 10:32 AM
yup
i've been trying this but not working
i have just copy and paste ´delegate-bot-conversastion´ inside module and enable this. And follow the steps mentioned in doc but did not work
can you provide me working sample. just provide me primary bot and two secondary bot
a

acceptable-kangaroo-64719

07/27/2023, 10:53 AM
do you get logs in your secondary bot?
b

busy-finland-27436

07/27/2023, 10:56 AM
no
nothing happen
@acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

07/27/2023, 10:59 AM
There are example bots in https://github.com/botpress/solutions/tree/master/custom%20solutions/Delegate%20conversation, do you have those working on your instance?
b

busy-finland-27436

07/27/2023, 11:02 AM
to intetact with secondary bot i need to select the respective primary bot at first. this way bot delagation works. if i type someting in primary bot primary bot need to automatically recognize secondary bots.
@acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

07/27/2023, 11:08 AM
yes, that's one way delegation can work
b

busy-finland-27436

07/27/2023, 11:11 AM
i need another way.
this is like a menu
maser bot must be able to interact with secondary bots directly
@acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

07/27/2023, 11:14 AM
then you need to use the custom module version of delegation
b

busy-finland-27436

07/27/2023, 11:16 AM
then why it's not working. has anyone implemented this way before? @acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

07/27/2023, 11:17 AM
I'm not sure
b

busy-finland-27436

07/27/2023, 11:24 AM
what we can do then?😀😀
any update brother😀😀 @acceptable-kangaroo-64719
a

acceptable-kangaroo-64719

07/27/2023, 12:00 PM
it's gonna take me a lot longer than 30 min to get this spun up. I'm still building the module.
b

busy-finland-27436

07/27/2023, 12:02 PM
ok brother
a

acceptable-kangaroo-64719

07/27/2023, 12:33 PM
ok just spoke with the engineer who created the module, and they said that the module was designed to run on a custom version of Botpress that was only available to a specific client, and isn't intended to be used on the main Botpress branch. So unfortunately it means that, if you want to implement delegation on your bots, you're going to need to dive into the code and write your own custom delegation module, because this one won't work with the publicly available BP versions.
b

busy-finland-27436

07/31/2023, 5:11 AM
ok