Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
botpress-hitl
Advanced tools
Official HITL (Human In The Loop) module for Botpress. This module has been built to easily track and write in your conversation when it's needed. By using this module, you can stop automatic responses of your bot and take control on any conversations.
**Support connectors: ** botpress-messenger
Installing modules on Botpress is simple. By using CLI, users only need to type this command in their terminal to add messenger module to their bot.
botpress install hitl
The HITL module should now be available in your bot UI, and the APIs exposed.
By using this module, you can look to all your conversations at the same place. You don't have to use external connectors interface to follow your conversations.
You can filter conversations based on their status (paused/active) by using filtering button in the UI.
You can pause or resume any conversations from the UI.
POST /api/botpress-hitl/sessions/{$id}/pause
Pause a specific conversation by using his id
.
POST /api/botpress-hitl/sessions/{$id}/unpause
Resume a conversation for a specific user.
A basic implementation example that shows how easy it is to implement a help request in Messenger.
const _ = require('lodash')
module.exports = function(bp) {
bp.middlewares.load()
bp.hear(/HITL_START/, (event, next) => {
bp.messenger.sendTemplate(event.user.id, {
template_type: 'button',
text: 'Bot paused, a human will get in touch very soon.',
buttons: [{
type: 'postback',
title: 'Cancel request',
payload: 'HITL_STOP'
}]
})
bp.notifications.send({
message: event.user.first_name + ' wants to talk to a human',
level: 'info',
url: '/modules/botpress-hitl'
})
bp.hitl.pause(event.platform, event.user.id)
})
bp.hear(/HITL_STOP/, (event, next) => {
bp.messenger.sendText(event.user.id, 'Human in the loop disabled. Bot resumed.')
bp.hitl.unpause(event.platform, event.user.id)
})
bp.hear({ type: 'message', text: /.+/i }, (event, next) => {
bp.messenger.sendText(event.user.id, 'You said: ' + event.text)
})
}
Note: This is the only code you need to add to your bot in your index.js
file.
Botpress Team would really like to have some help from the community to work on this important module. By helping us, you will contribute to the core and by the way, you will become one of our Botpress Leaders!
There's a Slack community where you are welcome to join us, ask any question and even help others.
Get an invite and join us now! 👉https://slack.botpress.io
botpress-hitl is licensed under AGPLv3.
FAQs
Official HITL (Human In The Loop) module for Botpress
The npm package botpress-hitl receives a total of 1 weekly downloads. As such, botpress-hitl popularity was classified as not popular.
We found that botpress-hitl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.