Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev1 #5

Open
wants to merge 83 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
4454916
npm init
morsh Aug 8, 2016
444aa57
npm init
amiturgman Aug 8, 2016
12d1c97
erge package.json
amiturgman Aug 8, 2016
462757e
adding basic bot logics
amiturgman Aug 8, 2016
f18e3ad
adding basic dialog
amiturgman Aug 8, 2016
528c7ee
adding config
morsh Aug 8, 2016
2ca3e2c
adding nconf to configuration
morsh Aug 8, 2016
c60cc37
adding condition handler
morsh Aug 8, 2016
e1ac698
adding sample scenario json
morsh Aug 9, 2016
620aa13
index- wip
amiturgman Aug 9, 2016
1dc2aea
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
amiturgman Aug 9, 2016
5110fff
adding next step handler
morsh Aug 9, 2016
bd39a09
Delete dev.private.json
Aug 9, 2016
8ad5312
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
morsh Aug 9, 2016
7f34054
wip- BotTree
amiturgman Aug 9, 2016
1111997
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
amiturgman Aug 9, 2016
1f174c5
while parent on next step
morsh Aug 9, 2016
89cdae8
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
morsh Aug 9, 2016
c4ce4fc
update comment on next selection
morsh Aug 9, 2016
325596d
finalizing normalization logics
amiturgman Aug 9, 2016
e013015
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
amiturgman Aug 9, 2016
eefc03c
adding dialog handler
morsh Aug 9, 2016
8af5978
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
morsh Aug 9, 2016
e7c30a4
wip
amiturgman Aug 9, 2016
ae62786
updating the schema
morsh Aug 9, 2016
62b4ae5
wip
amiturgman Aug 9, 2016
0b02fa8
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
amiturgman Aug 9, 2016
bc13fa7
wip 2
morsh Aug 9, 2016
446bf2f
adding handler plug in supprt
morsh Aug 9, 2016
fb4d5a6
wip
amiturgman Aug 9, 2016
b9cf047
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
amiturgman Aug 9, 2016
13dee53
adding extensions
morsh Aug 9, 2016
722c302
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
morsh Aug 9, 2016
00334bf
wip
amiturgman Aug 9, 2016
0838c31
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
amiturgman Aug 9, 2016
59a142a
wip
morsh Aug 9, 2016
a4fc75e
wip
morsh Aug 9, 2016
0765984
wip
amiturgman Aug 9, 2016
9df48c0
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
morsh Aug 9, 2016
d0d1fc3
move subscenarios to separate files
amiturgman Aug 9, 2016
1eaf550
wip
amiturgman Aug 9, 2016
c9f18a2
organizing code
amiturgman Aug 9, 2016
b2fc6c8
moving bot graph dialog to a node module
amiturgman Aug 9, 2016
36077aa
wip
amiturgman Aug 9, 2016
7dbdbe4
wip
amiturgman Aug 9, 2016
0370871
wip
amiturgman Aug 9, 2016
8d7f68b
wip
amiturgman Aug 9, 2016
ae2a760
wip
amiturgman Aug 9, 2016
429891b
wip
amiturgman Aug 9, 2016
4b55a21
wip
amiturgman Aug 9, 2016
b68c424
wip
amiturgman Aug 10, 2016
b667753
adding luis recognizer
morsh Aug 10, 2016
8ad5d48
Merge branch 'master' of https://github.com/CatalystCode/bot-trees
morsh Aug 10, 2016
ec5ccc3
initial bots intents checkin
morsh Aug 10, 2016
6108ddb
wip
amiturgman Aug 10, 2016
40ffa3f
adding score handling to bot dialog
morsh Aug 10, 2016
79cb4cb
Merge branch 'dev' of https://github.com/CatalystCode/bot-trees into dev
morsh Aug 10, 2016
d9afb0e
added start over scenario in bots
morsh Aug 10, 2016
ae8b0bc
adding scenario router
morsh Aug 10, 2016
6c9b6e0
changing bots to models
morsh Aug 10, 2016
892bc2f
added formatting by session data to text steps
morsh Aug 10, 2016
b3306e2
wip
amiturgman Aug 10, 2016
3f03491
adding intent scorer
morsh Aug 10, 2016
4238157
merge
amiturgman Aug 10, 2016
c5280c4
merge
amiturgman Aug 10, 2016
fea86f0
Merge branch 'dev' of https://github.com/CatalystCode/bot-trees into dev
amiturgman Aug 10, 2016
fca17c6
proxing dialog message text to scorer
morsh Aug 10, 2016
dea74af
wip
amiturgman Aug 10, 2016
c7e884e
wip
amiturgman Aug 10, 2016
b40418e
wip
amiturgman Aug 10, 2016
c34afbd
reorganize folders and add logging
amiturgman Aug 10, 2016
a8175ed
wip
amiturgman Aug 11, 2016
a964387
wip
amiturgman Aug 11, 2016
e93ce09
Merge pull request #1 from CatalystCode/dev
amiturgman Aug 11, 2016
aa74f69
wip
amiturgman Aug 11, 2016
8dbee1b
removing local bot-graph-dialog
amiturgman Aug 11, 2016
d94c8e4
Merge branch 'dev' of https://github.com/CatalystCode/bot-trees into dev
amiturgman Aug 11, 2016
17c34b7
Merge pull request #2 from CatalystCode/dev
amiturgman Aug 11, 2016
8884b8c
added scenarios 1-4
aribornstein Aug 25, 2016
7e92703
Implemented scenarios 1-4 and added a jump type to the underlying b…
aribornstein Aug 25, 2016
4f9e1c7
Added item number RTS response support and constants
aribornstein Aug 28, 2016
1fd8c61
Update index.js
aribornstein Sep 1, 2016
ed82806
Update and rename amdocs.json to billing.json
aribornstein Sep 1, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ logs
*.log
npm-debug.log*

# remove private
*.private.*

# Runtime data
pids
*.pid
Expand Down Expand Up @@ -35,3 +38,5 @@ jspm_packages

# Optional REPL history
.node_repl_history

.DS_Store
46 changes: 46 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/index.js",
"stopOnEntry": false,
"args": [],
"cwd": "${workspaceRoot}",
"preLaunchTask": null,
"runtimeExecutable": null,
"runtimeArgs": [
"--nolazy"
],
"env": {
"NODE_ENV": "development"
},
"externalConsole": false,
"sourceMaps": false,
"outDir": null
},
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"address": "localhost",
"restart": false,
"sourceMaps": false,
"outDir": null,
"localRoot": "${workspaceRoot}",
"remoteRoot": null
},
{
"name": "Attach to Process",
"type": "node",
"request": "attach",
"processId": "${command.PickProcess}",
"port": 5858,
"sourceMaps": false,
"outDir": null
}
]
}
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# bot-graph-dialog
Bot Graph Dialog


Getting Started
================
```
git clone https://github.com/CatalystCode/bot-trees.git
cd bot-trees
npm install
npm start
```


Run Locally
===========
Create a `config/dev.private.json` base on the `config/dev.sample.json` file. Edit it and add your App Id and Password.
After connecting your bot to this endpoint, type `workout` in order to start the workout scenario.


Demo
====
![Workout1](https://github.com/catalystcode/bot-trees/raw/master/images/workout1.png "workout1 demo")
![Workout2](https://github.com/catalystcode/bot-trees/raw/master/images/workout2.png "workout2 demo")
7 changes: 7 additions & 0 deletions bot/handlers/checkBillProofSimulator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = function (session, next, data) {
var potentialProofs = ['NoRecordFound','RTS','Disclaimed','TreatedAsSPAM'];
//session.dialogData[data.output] = potentialProofs[Math.floor(Math.random() * 4) + 1];
session.dialogData[data.output] = potentialProofs[0];
session.send(session.dialogData[data.output]);
next();
}
11 changes: 11 additions & 0 deletions bot/handlers/genieSimulator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = function (session, next, data) {
//flips a virtual coin and returns the result
if (data.result != null){
session.dialogData[data.output] = data.result;
}
else{
session.dialogData[data.output] = Math.random() < 0.5 ? true : false;
}
session.send();
next();
}
5 changes: 5 additions & 0 deletions bot/handlers/placeholder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = function (session, next, data) {
//Used a placeholder to Amdocs backend logic
session.send("Placeholder Handler Response: " + data.text);
next();
}
9 changes: 9 additions & 0 deletions bot/handlers/summary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

module.exports = function (session, next) {
var summary = "Summary: ";
for (var prop in session.dialogData) {
summary += prop + ': [' + session.dialogData[prop] + ']; ';
}
session.send(summary);
next();
}
37 changes: 37 additions & 0 deletions bot/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var path = require('path');
var builder = require('botbuilder');
var BotGraphDialog = require('bot-graph-dialog');
var config = require('../config');

var microsoft_app_id = config.get('MICROSOFT_APP_ID');
var microsoft_app_password = config.get('MICROSOFT_APP_PASSWORD');

var connector = new builder.ChatConnector({
appId: microsoft_app_id,
appPassword: microsoft_app_password,
});

var bot = new builder.UniversalBot(connector);
var intents = new builder.IntentDialog();

module.exports = connector;

bot.dialog('/', intents);

intents.matches(/^(help|hi|hello|hey)/i, [
function (session) {
session.send('Hi, I am your customer service bot! How are you today?');
}
]);

// ============================================

var scenariosPath = path.join(__dirname, 'scenarios');
var handlersPath = path.join(__dirname, 'handlers');

var routerGraph = require('./scenarios/billing.json');
var routerGraphDialog = new BotGraphDialog({tree: routerGraph, scenariosPath, handlersPath});
intents.onDefault(routerGraphDialog.getSteps());

// ============================================

25 changes: 25 additions & 0 deletions bot/literals/DisclaimedLiteral.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-Advise customer of record in Bill Proof

-Check Bill Delivery Mode:
Paper:
Prompt for Paperless enrollment:
Agree
Enroll user
Disagree
 Dispatch a case for validating bill delivery and resending of billing statement

Paperless:
-Advise customer of record in Bill Proof
Check if email address is correct
If Email address Correct:
-Jump to Offer sending bills via email
If Email Incorrect:
 -Ask for the updated email address
-Change the email address
-Jump to Offer sending bills via email

Offer sending of bills via Email:
If customer agrees:
Get his preferred email address where to send the bill and proceed with resending billing statement
If declines
Remind him to register to MyBills online so he can view his billing statement while waiting for the copy of the bill.
38 changes: 38 additions & 0 deletions bot/literals/RTSLiteral.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Step 4 Flow


Check Bill Delivery Mode:
Paper:
-Advise customer of record in Bill Proof

Check if billing address is correct:
Billing Address Correct:
-Deliver script: "Kindly provide us a landmark or establishment nearest your area."
-Jump to Propose Paperless billing

Billing Address Incorrect:
 -Deliver script: "Can I get your updated billing address so that I can update our records?"
 -Update the billing arrangement. 
 -Once billing address has been updated,dispatch a case for bill resending to correct email address.

Paperless:
-Advise customer of record in Bill Proof
Check if email address is correct
If Email address Correct:
-Jump to Offer sending bills via email
If Email Incorrect:
 -Ask for the updated email address
-Change the email address
-Jump to Offer sending bills via email

Propose Paperless Billing:
If customer agrees:
Enroll in paperless billing
Else :
Dispatch a case for validating bill delivery and resending of the billing statement

Offer sending of bills via Email:
If customer agrees:
Get his preferred email address where to send the bill and proceed with resending billing statement
If declines
Remind him to register to MyBills online so he can view his billing statement while waiting for the copy of the bill.
2 changes: 2 additions & 0 deletions bot/literals/TreatedAsSPAMLiteral.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
 Add our billing address to his address book.
    7.1.2. Disable auto­junk settings
53 changes: 53 additions & 0 deletions bot/literals/noStatusRecordLiteral.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Step 4 Flow

Check if there is a bill run delay advisory:
Run Delay:
Follow cascaded interim handling related to the advisory.
No: Continue to check bill

Check Bill Delivery Mode:
Paper:
Check if billing address is correct:
Billing Address Correct:
Check if bill delivery is within or beyond SLA:
In SLA:
Advise TAT for bill delivery.
Offer to enroll to Paperless Billing.
 If customer agrees
Enroll Customer
Go to Offer Bill Print via Email
Out of SLA:
Deliver SLA appology Script
Offer to enroll in Paperless Billing
If customer agrees
Proceed with Paperless Bill Enrolment. Refer to Change Bill Delivery Mode handling.
If customer disagrees
Dispatch a caChange the email addressse for validating bill delivery and bill resending
Go to Offer Bill Print via Email
Billing Address Incorrect:
Prompt for the correct billing address including landmark or establishment near customer's address.
Change the billing address. Refer to Updating Billing Arrangement handling.
Dispatch a case for bill resending to correct address. 
Go to Offer Bill Print via Email
Paperless:
Check if email address is correct
If Email address Correct:
Check if within SLA
If within SLA:
  Advise customer that bill will be sent to registered email address.
Go to Offer Bill Print via Email
If beyond SLA
Apologize to the customer
Go to Offer Bill Print via Email
If Email Incorrect:
Prompt the correct email address.
Change the email address
 Dispatch a case for bill resending to correct email address

Offer Bill reprint via Email
If customer agrees:
Resend the billing statement
If customer declines:
Remind him to register to MyBills online so he can view his billing statement while waiting for the copy of the bill.


26 changes: 26 additions & 0 deletions bot/scenarios/billing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "billing",
"type": "sequence",
"steps": [
{
"id": "profile",
"subScenario":"profile"
},
{
"id":"firstTime",
"subScenario": "steps/firstTime"
},
{
"id": "billNumber",
"type": "prompt",
"data": {
"type":"number", "text":"What is the bill number being complained for non-receipt?"
}
},
{
"id":"checkBillProof",
"subScenario": "steps/checkBillProof"
}
],
"models": []
}
26 changes: 26 additions & 0 deletions bot/scenarios/profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "profile",
"type": "sequence",
"steps": [
{
"id":"user",
"type":"const",
"value": "John"
},
{
"id":"lastname",
"type":"const",
"value": "Mccarthy"
},
{
"id":"userEmail",
"type":"const",
"value": "[email protected]"
},
{
"id":"userAddress",
"type":"const",
"value":"450 Serra Mall, Stanford, CA 94305"
}
]
}
Loading