All Projects → tompaana → bot-message-routing

tompaana / bot-message-routing

Licence: MIT License
Message routing component for chatbots built with Microsoft Bot Framework C# SDK.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to bot-message-routing

Botpress
🤖 Dev tools to reliably understand text and automate conversations. Built-in NLU. Connect & deploy on any messaging channel (Slack, MS Teams, website, Telegram, etc).
Stars: ✭ 9,486 (+17798.11%)
Mutual labels:  bot-framework, microsoft-bot-framework, chatbots
Urban Bot
🤖 The universal chatbot library based on React. Write once, launch Telegram, Facebook, Slack, ... every messenger with chatbots
Stars: ✭ 223 (+320.75%)
Mutual labels:  bot-framework, chatbots
Botonic
Build chatbots and conversational experiences using React
Stars: ✭ 144 (+171.7%)
Mutual labels:  bot-framework, chatbots
Wisty.js
🧚‍♀️ Chatbot library turning conversations into actions, locally, in the browser.
Stars: ✭ 24 (-54.72%)
Mutual labels:  bot-framework, chatbots
Botbuilder Community Js
Part of the Bot Builder Community Project. Repository for extensions for the Bot Builder JavaScript SDK, including middleware, dialogs, recognizers and more.
Stars: ✭ 88 (+66.04%)
Mutual labels:  bot-framework, chatbots
Botfuel Dialog
Botfuel SDK to build highly conversational chatbots
Stars: ✭ 96 (+81.13%)
Mutual labels:  bot-framework, chatbots
rasa-docker-arm
Rasa Docker image for ARMv7. Runs on a Raspberry Pi.
Stars: ✭ 19 (-64.15%)
Mutual labels:  bot-framework, chatbots
Poshbot
Powershell-based bot framework
Stars: ✭ 410 (+673.58%)
Mutual labels:  bot-framework, chatbots
BotBuilder.Standard
An unofficial CoreCLR targeted .NET Standard ported version of BotBuilder.
Stars: ✭ 22 (-58.49%)
Mutual labels:  bot-framework, microsoft-bot-framework
MyBot
🧠 Create chatbots easily with Bot Framework! 🤖
Stars: ✭ 30 (-43.4%)
Mutual labels:  bot-framework, chatbots
intelligo.js.org
The official website for Intelligo chatbot framework.
Stars: ✭ 18 (-66.04%)
Mutual labels:  bot-framework, chatbots
Fb Botmill
A Java framework for building bots on Facebook's Messenger Platform.
Stars: ✭ 67 (+26.42%)
Mutual labels:  bot-framework, chatbots
airy
💬 Open source conversational platform to power conversations with an open source Live Chat, Messengers like Facebook Messenger, WhatsApp and more - 💎 UI from Inbox to dashboards - 🤖 Integrations to Conversational AI / NLP tools and standard enterprise software - ⚡ APIs, WebSocket, Webhook - 🔧 Create any conversational experience
Stars: ✭ 299 (+464.15%)
Mutual labels:  bot-framework, chatbots
Rasa
💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
Stars: ✭ 13,219 (+24841.51%)
Mutual labels:  bot-framework, chatbots
Botframework Sdk
Bot Framework provides the most comprehensive experience for building conversation applications.
Stars: ✭ 6,673 (+12490.57%)
Mutual labels:  bot-framework, microsoft-bot-framework
Awesome Bots
The most awesome list about bots ⭐️🤖
Stars: ✭ 2,864 (+5303.77%)
Mutual labels:  bot-framework, chatbots
hands-on-bots-node
Repositório responsável pelas vídeo aulas inerentes a nova série do canal: Hands on
Stars: ✭ 32 (-39.62%)
Mutual labels:  bot-framework, microsoft-bot-framework
msbotbuilder-go
Microsoft Bot Framework SDK for Go
Stars: ✭ 113 (+113.21%)
Mutual labels:  bot-framework, microsoft-bot-framework
flow-bot
Framework to make bots based on Microsoft Bot Framework.
Stars: ✭ 14 (-73.58%)
Mutual labels:  bot-framework, microsoft-bot-framework
intelligo-generator
🛠️ Chatbot generator for Intelligo Framework.
Stars: ✭ 31 (-41.51%)
Mutual labels:  bot-framework, chatbots

Bot Message Routing (component)

NOTE!

This project is not maintained actively.

Build status Nuget status

This project is a message routing component for chatbots built with Microsoft Bot Framework C# SDK. It enables routing messages between users on different channels. In addition, it can be used in advanced customer service scenarios where the normal routines are handled by a bot, but in case the need arises, the customer can be connected with a human customer service agent.

For an example on how to take this code into use, see Intermediator Bot Sample.

Possible use cases

This is a .NET Core project compatible with Bot Framework v4. The .NET Framework based solution targeting Bot Framework v3.x can be found under releases here.

If you're looking to build your bot using the Node.js SDK instead, here's the Node.js/Typescript message routing project.

Implementation

Terminology

Term Description
Aggregation (channel) A channel where the chat requests are sent. The users in the aggregation channel can accept the requests. Applies only if the aggregation channel based approach is used!
Connection Is created when a request is accepted - the acceptor and the requester form a connection (1:1 chat where the bot relays the messages between the users).

The ConversationReference class, provided by the Bot Framework, is used to define the user/bot identities. The instances of the class are managed by the RoutingDataManager class.

Interfaces

IRoutingDataStore

An interface for storing the routing data, which includes:

  • Users
  • Bot instances
  • Aggregation channels
  • Connection requests
  • Connections

An implementation of this interface is passed to the constructor of the MessageRouter class. This solution provides two implementations of the interface out-of-the-box: InMemoryRoutingDataStore (to be used only for testing) and AzureTableRoutingDataStore.

The classes implementing the interface should avoid adding other than storage related sanity checks, because those are already implemented by the RoutingDataManager.

ILogger

An interface used by the MessageRouter class to log events and errors.

Classes

MessageRouter class

MessageRouter is the main class of the project. It manages the routing data (using the RoutingDataManager together with the provided IRoutingDataStore implementation) and executes the actual message mediation between the connected users/bots.

Properties
Methods
  • CreateSenderConversationReference (static): A utility method for creating a ConversationReference of the sender in the Activity instance given as an argument.
  • CreateRecipientConversationReference (static): A utility method for creating a ConversationReference of the recipient in the Activity instance given as an argument. Note that the recipient is always expected to be a bot.
  • SendMessageAsync: Sends a message to a specified user/bot.
  • StoreConversationReferences: A convenient method for storing the sender and the recipient in the Activity instance given as an argument. This method is idempotent; the created instances are added only if they are new.
  • CreateConnectionRequest: Creates a new connection request on behalf of the given user/bot.
  • RejectConnectionRequest: Removes (rejects) a pending connection request.
  • ConnectAsync: Establishes a connection between the given users/bots. When successful, this method removes the associated connection request automatically.
  • Disconnect: Ends the conversation and severs the connection between the users so that the messages are no longer relayed.
  • RouteMessageIfSenderIsConnectedAsync: Relays the message in the Activity instance given as an argument, if the sender is connected with a user/bot.

Other classes

RoutingDataManager contains the main logic for routing data management while leaving the storage specific operation implementations (add, remove, etc.) for the class implementing the IRoutingDataStore interface. This is the other main class of the solution and can be accessed via the MessageRouter class.

AzureTableRoutingDataStore implements the IRoutingDataStore interface. The constructor takes the connection string of your Azure Table Storage.

InMemoryRoutingDataStore implements the IRoutingDataStore interface. Note that this class is meant for testing. Do not use this class in production!

AbstractMessageRouterResult is the base class defining the results of the various operations implemented by the MessageRouter and the RoutingDataManager classes. The concrete result classes are:

For classes not mentioned here, see the documentation in the code files.

Contributing

This is a community project and all contributions are more than welcome!

If you want to contribute, please consider the following:

  • Use the development branch for the base of your changes
  • Remember to update documentation (comments in code)
  • Run the tests to ensure your changes do not break existing functionality
    • Having an Azure Storage to test is highly recommended
    • Update/write new tests when needed
  • Pull requests should be first merged into the development branch

Please do not hesitate to report ideas, bugs etc. under issues!

Acknowledgements

Special thanks to the contributors (in alphabetical order):

Note that you may not find (all of their) contributions in the change history of this project, because all of the code including this core functionality used to reside in Intermediator Bot Sample project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].