• This repository has been archived on 27/Nov/2019
  • Stars
    star
    188
  • Rank 205,563 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bot Connector allows you to connect your bot to multiple messaging channels.

[Archived] Open Source Bot Connector

As communicated earlier in August 2019, this repository has been archived and the source code is not maintained by the SAP Conversational AI team.

All Bot Connector capabilities are integrated in our bot building platform.

If you are running a standard / customised version of open source bot connector on your platform, please migrate to the bot connector available on our bot building platform (hosted in on SAP Cloud Platform), which offers integration with a wide number of channels which that we plan to make more robust.

If you have any questions, please contact our team.

Bot Connector Logo

Supported Channels Getting Started How it works Messages Formats Getting Started with SAP Conversational AI

💬 Questions / Comments? Join the discussion on our community Slack channel!

Bot Connector

Bot Connector allows you to connect your bot to multiple messaging channels.

It provides a higher level API to manage several messaging platforms at once, and lets you focus on your bot by using a simple and unique format to talk to the entire world.

Documentation

You can see the API documentation here

Or generate the documentation with the following command:

yarn docs && open docs/index.html

Supported Channels

Bot Connector supports the following channels:

You can find more information on each channel in the wiki

More will be added, and you can contribute if you want to, and add a thumbs up for the channel you want to see implemented first ;) (To do so, fork this repo, add a thumbs up and make a PR!)

  • Discord 👍👍👍
  • Ryver 👍
  • Viber
  • Wechat 👍👍
  • Zinc.it 👍
  • Salesforce 👍

Getting started

The following examples use yarn package manager but you can use your favorite one like npm, or pnpm.

In order to run the connector you need MongoDB and Redis installed and running. The configuration files for both are stored in config directory.

Installation

Clone the repository and install the dependencies

git clone https://github.com/SAPConversationalAI/bot-connector.git
cd bot-connector
yarn install

Available Commands

  • yarn start - Start application in production mode
  • yarn start:dev - Start application in development mode
  • yarn start:dev:debug - Start application in development mode with debugger
  • yarn test - Run unit & integration tests
  • yarn test:debug - Run unit & integration tests with debugger
  • yarn test:coverage - Run unit & integration tests with coverage report
  • yarn lint - Run ESLint
  • yarn build - Build artifacts for production
  • yarn docs - Generate apidoc documentation

Configurations/Environments

You need to create a configuration file based on the following schema:

config/{env}.js (e.g. config/development.js for NODE_ENV=development)

module.exports = {
  db: {
    host: 'localhost',
    port: 27017,
    dbName: 'botconnector',
  },
  server: {
    port: 8080,
  },
  redis: {
    port: 6379,
    host: 'localhost',
    auth: '',
    db: 7,
    options: {},  // see https://github.com/mranney/node_redis#rediscreateclient
  },
  mail: {},  // valid object to be passed to nodemail.createTransport()
  base_url: '',  // base url of the connector
  facebook_app_id: '',
  facebook_app_secret: '',
  facebook_app_webhook_token: '',
  amazon_client_id: '',  // Client ID for use with Login with Amazon (Amazon Alexa channel)
  amazon_client_secret: '',  // Client Id for use with Login with Amazon (Amazon Alexa channel)
}

Running in development mode (hot reload)

yarn start:dev

Setup your connector

First of all, you need to create a connector with the Bot Connector's API.

curl -X POST 'http://localhost:8080/connectors' --data 'url=YOUR_BOT_ENDPOINT_URL'

Then you need some code so the Bot Connector, via the connector you've just created, can send you the messages it receives. You can use the code from the example as a starter.

cd example
yarn install
yarn start

Now that your bot (well, your code) and the Bot Connector are running, you have to create channels. A channel is the actual link between your bot (the connector) and a specific service like Messenger, Slack or Kik. One connector can have multiple channels.

How it works

There are two distinct flows:

  • your bot receives a message from a channel
  • your bot sends a message to a channel

This pipeline allows us to have an abstraction of messages independent of the platform and implement only a few functions for each messaging platform (input and output parsing).

Receive a message

The Bot Connector posts on the endpoint stored with the connector each time a new message arrives from a channel.

  • a new message is received by Bot Connector
  • the message is parsed by the corresponding service
  • the message is saved in MongoDB
  • the message is post to the bot endpoint

BotConnector-Receive

Post a message

To send a new message, you have to post it to Bot Connector's API

  • the messages are saved in MongoDB
  • the messages are formatted by the corresponding service to match the channel's format
  • the messages are sent by Bot Connector to the corresponding channel

BotConnector-Sending

Messages format

All messages coming from the bot are parsed and modified to match the destination channel specifications. Bot Connector supports several message formats:

  • Text
{
  type: 'text',
  content: 'MY_TEXT',
}
  • Picture
{
  type: 'picture',
  content: 'IMAGE_URL',
}
  • Video
{
  type: 'video',
  content: 'VIDEO_URL',
}
  • Quick Replies
{
  type: 'quickReplies',
  content: {
    title: 'TITLE',
    buttons: [
      {
        title: 'BUTTON_1_TITLE',
        value: 'BUTTON_1_VALUE',
      }, {
        title: 'BUTTON_2_TITLE',
        value: 'BUTTON_2_VALUE',
      }
    ]
  }
}
  • List
{
  type: 'list',
  content: {
    elements: [
      {
        title: 'ELEM_1_TITLE',
        imageUrl: 'IMAGE_URL',
        subtitle: 'ELEM_1_SUBTITLE',
        buttons: [
          {
            title: 'BUTTON_1_TITLE',
            value: 'BUTTON_1_VALUE',
            type: 'BUTTON_TYPE',
          }
        ]
      }
    ],
    buttons: [
      {
        title: 'BUTTON_1_TITLE',
        value: 'BUTTON_1_VALUE',
        type: 'BUTTON_TYPE',
      }
    ]
  }
}
  • Card
{
  type: 'card',
  content: {
    title: 'CARD_TITLE',
    subtitle: 'CARD_SUBTITLE',
    imageUrl: 'IMAGE_URL',
    buttons: [
      {
        title: 'BUTTON_TITLE',
        type: 'BUTTON_TYPE', // See Facebook Messenger button formats
        value: 'BUTTON_VALUE',
      }
    ],
  },
}
  • Carousel
{
  type: 'carousel',
  content: [
    {
      title: 'CARD_1_TITLE',
      imageUrl: 'IMAGE_URL',
      buttons: [
        {
          title: 'BUTTON_1_TITLE',
          value: 'BUTTON_1_VALUE',
          type: 'BUTTON_1_TYPE',
        }
      ]
    }
  ],
}

Getting started with SAP Conversational AI

We build products to help enterprises and developers have a better understanding of user inputs.

  • NLP API: a unique API for text processing, and augmented training.
  • Bot Building Tools: all you need to create smart bots powered by SAP Conversational AI's NLP API. Design even the most complex conversation flow, use all rich messaging formats and connect to external APIs and services.
  • Bot Connector API: standardizes the messaging format across all channels, letting you connect your bots to any channel in minutes.

Learn more about:

API Documentation Discover the platform First bot tutorial Advanced NodeJS tutorial Advanced Python tutorial

More Repositories

1

PyHDB

SAP HANA Connector in pure Python
Python
306
star
2

cloud-platform-iot-starterkit

This repository provides information and code for working with SAP Cloud Platform Internet of Things. It enables users to get an end-to-end IoT solution with either real hardware or simulators up and running fast and start their own extensions and usage based on this.
Java
277
star
3

SAPConversationalAI

✨ 🤖 🤖 Build your own conversational bot on our Collaborative Bot Platform! 🤖🤖 ✨
273
star
4

BUILD

BUILD is an open-source, cloud-based and social platform that enables users, even those with no UI development knowledge, to easily create fully interactive prototypes with realistic data, share them with colleagues and consolidate this feedback without writing a line of code.
Gherkin
192
star
5

cloud-espm-v2

This sample is a reference application project, showcasing an end-to-end development scenario for a Java-based app on SAP BTP. The app has a SAPUI5 web frontend, uses OData to connect to a Java-based cloud backend which in turn connects via JPA to an SAP HANA DB in the cloud.
Java
104
star
6

teched2020-DEV260

DEV260 - Build SAP Fiori Apps with the ABAP RESTful Application Programming Model
103
star
7

teched2020-developer-keynote

SAP TechEd 2020: Developer Keynote
Shell
102
star
8

grunt-openui5

Grunt tasks around OpenUI5
JavaScript
88
star
9

openui5-basic-template-app

OpenUI5 basic template app
JavaScript
87
star
10

contextual-ai

Contextual AI adds explainability to different stages of machine learning pipelines - data, training, and inference - thereby addressing the trust gap between such ML systems and their users. It does not refer to a specific algorithm or ML method — instead, it takes a human-centric view and approach to AI.
Jupyter Notebook
85
star
11

lumira-extension-viz

lumira
JavaScript
84
star
12

ml-model-watermarking

Protect your machine learning models easily and securely with watermarking 🔑
Python
84
star
13

com.sap.openSAP.hana5.example

openSAP HANA5/HANA6 Course: Example Completed Implementation
JavaScript
83
star
14

karydia

Kubernetes Security Walnut
Go
78
star
15

cloud-cap-nodejs-codejam

Material for the CodeJam on SAP Cloud Application Programming Model with Node.js.
Shell
76
star
16

SDK-NodeJS

SAP Conversational AI official SDK for Node.js
JavaScript
70
star
17

btp-full-stack-typescript-app

A sample project to demonstrate how to implement a full-stack app with SAP Cloud Application Programming Model, plus SAPUI5 and TypeScript.
TypeScript
68
star
18

cloud-cap-walkthroughs

This project contains exercises and tutorials for SAP Cloud Application Programming Model.
65
star
19

cloud-s4-sdk-pipeline

The Cloud SDK pipeline uses the Cloud SDK continuous delivery server for building, checking, and deploying extension applications. Projects based on the SAP Cloud SDK archetype will automatically use this pipeline.
Groovy
65
star
20

teched2020-DEV164

DEV164 - Developing Apps with SAPUI5
60
star
21

teched2019-cloud-cf-product-list

Resources for SAP TechEd SEC364 Hands-on workshop, "Secure Microservices in Cloud Foundry Environment on SAP Cloud Platform".
57
star
22

openui5-masterdetail-app

OpenUI5 master detail template app
JavaScript
56
star
23

cloud-s4-sdk-book

Sample source code for book Extending SAP S/4HANA
Java
53
star
24

cloud-sample-spaceflight-java

Build Java applications with the application programming model on SAP Cloud Platform.
49
star
25

cloud-odata-java

OData library for Java
Java
48
star
26

yaas-storefront

Storefront Template for Single-Page HTML5 shops built on YaaS/Commerce-as-a-Service. Built using angular.js.
JavaScript
48
star
27

cloud-sample-spaceflight-node

Build node applications with the application programming model on SAP Cloud Platform.
JavaScript
47
star
28

helm-broker

A Service Broker which exposes Helm charts as Service Classes in the Service Catalog
Go
47
star
29

teched2020-DAT160

DAT160 - Cloud Native Development with SAP HANA
JavaScript
46
star
30

techne

Design Guidelines, Components and Patterns Library for modern, mobile-first, user-centric Experience Design
Less
40
star
31

cloud-dirigible

Dirigible is an open source project that provides Integrated Development Environment as a Service (IDEaaS) as well as the runtime engines integration for the running applications
HTML
39
star
32

teched2020-DEV268

DEV268 - SAP Cloud Platform, ABAP Environment Connectivity and Integration
ABAP
38
star
33

machine-learning-dgm

Learning to Remember: A Synaptic Plasticity Driven Framework for Continual Learning
Python
37
star
34

HANAVora-Extensions

Spark extensions for business contexts
Scala
37
star
35

spring-cloud-sap

Spring Cloud Connectors for SAP HANA Cloud Platform (HCP) and SAP HANA DB platform
Java
37
star
36

digitalboardroom-multidesktop-fullscreen-chrome

Open SAP Digital Boardroom agendas in full-screen on multiple monitors with a Chrome application.
JavaScript
36
star
37

i40-aas

Provide a set of tools to realize the Asset Administration Shell for Industrie 4.0.
JavaScript
36
star
38

btp-workflow-management-opensap

This repository contain the exercises for the openSAP course "Improve Business Processes with SAP Workflow Management."
JavaScript
33
star
39

jenkins-pipelines

Jenkins pipeline implementations for Continuous Delivery.
32
star
40

hana-native-adapters

Since SAP HANA SPS09 supports writing new adapters for Smart Data Access, Batch Data Loading, ETL, Realtime Replication, and Realtime Transformations. While common adapters are provided by SAP, everyone can write their own adapters using the SAP HANA Adapter SDK. This project aims to provide additional adapters for using them or as samples.
Java
32
star
41

jam-collaboration-sample

A collection of simple sample code containing examples that demonstrate simple API and integration workflows.
Java
30
star
42

xsk

Compatible environment for SAP HANA Extended Application Services (XS) based applications outside of SAP HANA instance running in a container deployed on Kubernetes
Java
30
star
43

cloud-cf-furnitureshop-documentation

Step-by-step documentation to create a cloud-native application on SAP Cloud Platform Cloud Foundry environment.
29
star
44

bosh-kubernetes-cpi-release

The goal for this project is to provide a fully functional BOSH CPI. It will eventually allow to deploy any BOSH release to any Kubernetes cluster.
Haskell
29
star
45

teched2021-DEV261

DEV261 - Build Extensions with SAP BTP, Kyma Runtime
JavaScript
29
star
46

activerecord-hana-adapter

Active Record HANA Adapter (This Repository has been archived upon Members choice)
Ruby
29
star
47

cloud-platform-connectivity-principal-propagation

Learn how to set up principal propagation using SAP Cloud Platform Connectivity and Cloud Connector
Java
29
star
48

hcp-portal-service-samples

Code samples of site and page templates, applications, widgets, shell plugins and more, intended to be used as references for development of custom content for SAP HANA Cloud Platform portal service sites.
JavaScript
29
star
49

cloud-connectivityproxy

The Connectivity Proxy component is based on the SAP HANA Cloud connectivity service and allows to proxy requests from JavaScript applications, which are obliged to the Same-Origin-Policy, to backend services.
Java
28
star
50

connect-openui5

Connect middleware for OpenUI5
JavaScript
28
star
51

devops-docker-cx-server

A collection of Jenkins related Dockerfiles that can be used to implement Continuous Delivery pipelines for SAP development projects with project "Piper".
Shell
27
star
52

cloud-platform-workflow-virtual-event

Material for the virtual event on SAP Cloud Platform Workflow.
Shell
27
star
53

SAP-Business-One-Service-Layer-SDK

An SDK for SAP Business One Service Layer OData interface. Provide CRUD and filter functions by in strong type programming languages. Easy to use and efficient for partner to build Business One add-ons.
Java
27
star
54

cloud-s4-sdk-pipeline-lib

The SAP Cloud SDK pipeline library defines essential functions for building cloud extension applications. The SAP Cloud SDK pipeline uses this library.
Groovy
27
star
55

spartacus-bootcamp

Showcase of code examples and concrete use cases on how to implement, extend, and enhance Spartacus for CX customers, partners, and implementers.
TypeScript
26
star
56

angular-metaui

Framework for building angular applications declaratively using rules. For more information: https://sap.github.io/angular-metaui/html
TypeScript
26
star
57

cloud-hana-helloworld

This project provides the full source code for the "Hello World" tutorials on https://hcp.sap.com. In this tutorials you can learn how to make your very first steps on SAP HANA by developing a very simple "Hello World" application using the SAP HANA web-based Development Workbench on the SAP HANA Cloud Platform.
HTML
26
star
58

teched2020-IIS361

IIS361 - Create Analytical SAP Fiori Apps Quickly and Efficiently
JavaScript
25
star
59

smb-summit-hackathon

Build Blocks for the SAP SMB Summit Hackathons.
25
star
60

cloud-sdk-cli

The command line interface for the SAP Cloud SDK
TypeScript
24
star
61

com.sap.openSAP.hana5.templates

openSAP HANA5 Software Development on SAP HANA (Q4/2016) Course Templates
24
star
62

java-memory-assistant

A Java agent to automatically create heap dumps based on configurable thresholds and memory consumption patterns.
Java
24
star
63

teched2020-DEV267

DEV267 - Automated SAP Fiori Apps Testing with Continuous Delivery
CAP CDS
23
star
64

cloud-xsa-hybrid-deployment-tutorial

The Multi Target Application in this tutorial will be built using Microservices leveraging the powerful HANA database capabilities in combination with flexible cloud technology.
23
star
65

SDK-python

SAP Conversational AI official SDK for Python
Python
23
star
66

cloud-samples-foundation

A sample reuse package for the application programming model for SAP Cloud Platform providing common business types like currency, unit of measure, etc.
22
star
67

security-research-differentially-private-generative-models

SAP Security research sample code and tutorials for generating differentially private synthetic datasets using generative deep learning models
Jupyter Notebook
22
star
68

project-odense

RESTful endpoints to enable the usage of abapGit for ABAP Development Tools
ABAP
22
star
69

hcp-cloud-foundry-tutorials

This repository consists of tutorials for SAP HANA Cloud Platform which show how the available backing services of Cloud Foundry can be used.
Java
21
star
70

SDK-iOS

SAP Conversational AI official SDK for Swift
Swift
21
star
71

starter-NodeJS

Recast.AI official starter-kit for NodeJS
JavaScript
21
star
72

logistics-business-network-gtt-samples

This code example contains sample scenario applications that will show how to use SAP Logistics Business Network, global track and trace option to build a tracking application.
Java
20
star
73

SDK-ruby

SAP Conversational AI official SDK for Ruby
Ruby
20
star
74

teched2020-DEV161

DEV161 - Extend SAP S/4HANA with a Custom UI on SAP Cloud Platform
20
star
75

teched2020-DEV163

DEV163 - Build a Workflow from Scratch with SAP Cloud Platform Workflow
JavaScript
20
star
76

sap-hana-driver-for-sqltools

A Visual Studio Code extension which extends the SQLTools extension, with a driver to work with the SAP HANA Database. It supports tables and views, as well as running queries on an SAP HANA Database.
TypeScript
20
star
77

cloud-sdk-ios-samples

SAP Cloud Platform SDK for iOS sample apps demonstrating various components and features of the SDK in the context of bigger apps.
Swift
19
star
78

teched2020-DEV264

DEV264 - Deep dive into SAP Cloud Platform Workflow Management
JavaScript
19
star
79

SAP4Kids

A cloud-native application that leverages various SAP technologies to ensure families have access to the food and resources they need during the COVID-19 crisis. This project can be deployed to your free SAP BTP Trial account.
JavaScript
19
star
80

SDK-PHP

SAP Conversational AI official SDK for PHP
PHP
18
star
81

teched2020-IIS360

IIS360 - Simplify Development of SAP Fiori Apps with OData v4
CAP CDS
18
star
82

data-warehouse-cloud-modeling

This repository aims to onboard new users into Modeling in SAP Data Warehouse Cloud in the most practical manner. For that you will build a real working data model, which will embrace specific features and functions.
18
star
83

cloud-paulpredicts

This is a real-life productive application, demonstrating how to create a server back-end to serve multiple front-end technologies. The sample involves all currently available SAP HANA Cloud services. #cloud-sample
Java
18
star
84

cloud-weatherapp

New sample application demonstrating the interplay of several HCP services to develop a full fledged application.
Java
17
star
85

cloud-spring-boot-sample

Sample application demoing Spring Boot running on SAP HANA Cloud Platform.
Java
17
star
86

cloud-foundry-cap-azure-cities

Reference application built according to the SAP Cloud Application Programming Model. It uses an SAP HANA database for structured data, an Azure storage account for unstructured data, and SAP Fiori Elements for the user interface.
JavaScript
17
star
87

cloud-function-nodejs-samples

SAP Cloud Platform Functions samples written in Node.JS
JavaScript
16
star
88

teched2020-DEV261

DEV261 - Build Cloud-Native Extensions for SAP Solutions Based on Kubernetes
16
star
89

hana-cloud-workshop-create-database-artifacts

Learn with our experts in this hands-on workshop how to create and optimize calculation views in SAP Business Application Studio in a federated scenario using data from SAP HANA Cloud.
16
star
90

iot-edge-samples

Showcase of various extension scenarios for SAP IoT Edge, intelligent edge computing software that provides "microservices at the edge" for Internet of Things (IoT).
Java
16
star
91

yaas_java_jersey_wishlist

Due to the retirement of YaaS, this repository is archived and will no longer be maintained. --- This is an example implementation of the YaaS "Wishlist" service based on Java. It uses the RAML definition generated by the SDK without modifications. It shows how to implement a basic service and how to integrate with other services on YaaS.
Java
16
star
92

cloud-cf-multitenant-saas-provisioning-sample

Reference application for a SaaS Provisioning service to develop and deploy a SaaS multi tenant business application on SAP Cloud Platform Cloud Foundry environment.
JavaScript
16
star
93

iot-application-services-sdk-nodejs

A NodeJS package that acts as a thin wrapper over the API of SAP IoT Application Enablement.
JavaScript
16
star
94

yaas-nodejs-client-sdk

YaaS.js, a Node.js client library for SAP Hybris as a Service (YaaS)
JavaScript
15
star
95

pipeline-dsl

Pipeline DSL for Concourse
Python
15
star
96

abap-odata-smoke-test

This ABAP Report performs simple smoke tests for activated ODATA services, providing basic automated testing for your ODATA endpoints.
ABAP
15
star
97

cloud-portal-tutorial-samples

Samples from the SAP Cloud Platform Portal tutorials, including custom SAP Fiori apps, Portal widgets, shell plug-ins, and site templates.
JavaScript
14
star
98

reason-markdown

VFMD (Vanilla-Flavoured Markdown) parser for Reason
Reason
14
star
99

yaas-getting-started-yaasbites

YaaS bites (our getting started series) is a tutorial and sample code set consisting of small, incremental coding exercises to help a developer learn the basics of the YaaS platform. Its goal is to ensure that a Software Developer's initial journies into YaaS are productive and successful.
JavaScript
14
star
100

cloud-jenkins

The Cloud Jenkins sample project builds a web archive for running Jenkins in a developer account of the SAP HANA Cloud Platform. #cloud
Java
14
star