Bot-HandOff
A common request from companies and organizations considering bots is the ability to "hand off" a customer from a bot to a human agent, as seamlessly as possible.
This project implements a framework called Handoff which enables bot authors to implement a wide variety of scenarios, including a full-fledged call center app, with minimal changes to the actual bot.
It also includes a very simple implementation that illustrates the core concepts with minimal configuration.
This project is in heavy flux, but is now in a usable state. However this should still be considered a sample, and not an officially supported Microsoft product.
This project is written in TypeScript.
Source Code
See example folder for a full bot example.
Basic Usage
import * as bot_handoff from 'bot_handoff';
const isAgent = (session: builder.Session) => session.message.user.name.startsWith("Agent");
const isOperator = (session: builder.Session) => session.message.user.name.startsWith("Operator");
bot_handoff.setup(bot, app, isAgent, isOperator, {
mongodbProvider: process.env.MONGODB_PROVIDER,
directlineSecret: process.env.MICROSOFT_DIRECTLINE_SECRET
});
Required environment variables:
"MICROSOFT_APP_ID" : "",
"MICROSOFT_APP_PASSWORD" : "",
"MICROSOFT_DIRECTLINE_SECRET" : "",
"MONGODB_PROVIDER" : ""
License
MIT License