botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
71 stars 83 forks source link

[FEATURE] Experience rating when HITL hands off from Agent back to the chatbot. #1290

Open dvncan opened 3 years ago

dvncan commented 3 years ago

Is your feature request related to a problem? Please describe. In order to collect sentiment on the specific conversation I need to email the user after the conversation has been resolved, which is done outside of botpress.

Describe the solution you'd like After the handoff to live agent is complete, I would like to gather the sentiment of the user for that specific conversation. After the agent resolves the conversation I want the flow editor to trigger a message to be sent asking the user "How did we do? Please rate our service out of 5". Currently I am unable to accomplish this.

Describe alternatives you've considered Alternatives I have tried are:

Additional context A potential client has requested this feature. This feature would allow for an improved user experience by allowing a customized conversation ending to be triggered.

srckarthik commented 3 years ago

This is karthik. Thank for posting the query. I will wait for the response and solution

srckarthik commented 3 years ago

my main expectation is 'How the next node knows whether the Agent has handed over the chat to bot or not, is there any flag or value been passed back bot, that bot need to check and move the flow to next node'

Please share the solution for that

dvncan commented 3 years ago

Hey @srckarthik,

It has come to my attention that we can customize the API endpoint after HITL has successfully closed, set a temporary variable and check for variable = true before sending the customer satisfaction survey.

Here is some code from a custom action I use to check if an agent is available, we can modify this so it triggers after HITL successfully closes conversation and set a temporary variable.

const config = await bp.http.getAxiosConfigForBot(event.botId, { localUrl: true }) //bp.logger.info(JSON.stringify(config, null, 2)) const res = await axios.get('/mod/hitlnext/agents', config) //bp.logger.info(JSON.stringify(res.data, null, 2)) //bp.logger.info(res.data.some(x => x.online))

//set temp variable which will describe state

event.state.temp.onlineAgents = res.data.some(x => x.online)`

you could modify this to set a flag that confirms conversation is complete

xXWarMachineRoXx commented 1 year ago

How are you populating online agents ??

xXWarMachineRoXx commented 1 year ago

Also did you make a custom component that every agent can access on thier web chat to transfer control to themseleves?