Inter Bot Delegation
# 🤝help
b
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
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
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
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
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
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
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
okay, and in your secondary bot do you stay in that bot or immediately transfer back to the primary bot?
b
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
ok. Why are you using the
delegate-to-sub-bot.js
action and not the cutom module?
b
how can i implement custom module, there is no any detailed steps that's why i tried with this.
@acceptable-kangaroo-64719
a
b
after importing
delegate-bot-conversation
module, do not i need to call action of this module?
a
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
do i need to edit skill inside primary bot @acceptable-kangaroo-64719 ?
a
yes. You also need to read the documentation on the module
b
thanks buddy let me try first
@acceptable-kangaroo-64719 Now i got error
a
400 errors typically mean that your request is wrong. Are you sure you're using the right bot id in the delegation skill?
b
yup
it's human-resource
@acceptable-kangaroo-64719
a
and you have only one bot id in the delegation skill?
b
yup
@acceptable-kangaroo-64719
a
did you restart botpress after installing the module?
b
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
is the screenshot you shared the whole error?
b
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
why is
text
repeated twice? It should be
text: event.preview
b
i've not edited the action it was already there @acceptable-kangaroo-64719
a
interesting
b
postConverse method is inside delete-to-sub-bot.js
a
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
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
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
alright
@acceptable-kangaroo-64719 are you available?
a
Hey, I was also on holiday for a bit. Are you still having trouble with this?
b
Yes, still facing same issue
@acceptable-kangaroo-64719
a
alright. Have you tried anything new in the last 5 days?
b
i have found other doc which works but i need that one to meet my requirements
@acceptable-kangaroo-64719
a
what do you mean?
b
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
Is this method no longer working for you?
b
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
do you get logs in your secondary bot?
b
no
nothing happen
@acceptable-kangaroo-64719
a
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
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
yes, that's one way delegation can work
b
i need another way.
this is like a menu
maser bot must be able to interact with secondary bots directly
@acceptable-kangaroo-64719
a
then you need to use the custom module version of delegation
b
then why it's not working. has anyone implemented this way before? @acceptable-kangaroo-64719
a
I'm not sure
b
what we can do then?😀😀
any update brother😀😀 @acceptable-kangaroo-64719
a
it's gonna take me a lot longer than 30 min to get this spun up. I'm still building the module.
b
ok brother
a
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
ok