npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@broadly/botpress-hitl

v10.6.2-broadly.9

Published

Official HITL (Human In The Loop) module for Botpress

Downloads

7

Readme

botpress-hitl

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

Installation

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.

Features

Viewing conversations

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.

Filtering by status

You can filter conversations based on their status (paused/active) by using filtering button in the UI.

Pausing/resuming conversations

You can pause or resume any conversations from the UI.

API

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.

Example

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.

Roadmap

  • Add pause bot in the UI
  • Implement other types of message to view them in UI (template, buttons, etc.)

Contribution

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!

Community

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

License

botpress-hitl is licensed under AGPLv3.