Skip to content
This repository was archived by the owner on Dec 19, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*~
*.DS_STORE
node_modules/*
npm-debug.log
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The list of actions is in **action syntax** (see below).

Conditions fall under the following categories:
* Inputs: User input matching a string. E.g., `"one"` or `"two"`. The presence of quotes indicates a string that must be matched by the last user input. An asterisk `*` matches *any* user input.
* Expressions: Mathematical syntax representing equality, inequality, and so on. Most basic math expressions are valid e.g. `count>4`. Expressions can use variables that exist in the blackboard, using the blackboard variable syntax (see above).
* Expressions: Mathematical syntax representing equality, inequality, and so on. Most basic math expressions are valid e.g. `count>4`. Expressions can use variables that exist in the blackboard, using the blackboard variable syntax (see above).
* Values: There is only one type of these at present, `wait:[time in seconds to wait]`. This evaluates to true after that much time has elapsed after entering the current state.

### Actions
Expand Down Expand Up @@ -183,7 +183,7 @@ Interacting with this bot, you can see that the **viz** view displays the state

### Suggestion chips

User interactions can be expedited though the use of suggestion chips. These are prompts that are shown to the user when interacting through text.
User interactions can be expedited though the use of suggestion chips. These are prompts that are shown to the user when interacting through text.

```javascript
bot = {
Expand Down Expand Up @@ -277,7 +277,7 @@ bot = {
}
```

This example adds a global exit. No matter where the Pointer is at on the graph, the user can always pet the kitten. This introduces a problem, though, because the user could potentially pet the kitten before it was named, so an initial value for the name is configured in the blackboard. When the origin is entered, the variable `desired_pets` is set to a random value between 1 and 5. When the user pets the kitten too much, the `angry_pet` node is entered.
This example adds a global exit. No matter where the Pointer is at on the graph, the user can always pet the kitten. This introduces a problem, though, because the user could potentially pet the kitten before it was named, so an initial value for the name is configured in the blackboard. When the origin is entered, the variable `desired_pets` is set to a random value between 1 and 5. When the user pets the kitten too much, the `angry_pet` node is entered.

![](doc_images/kittens3.png?raw=true)

Expand Down Expand Up @@ -344,7 +344,7 @@ bot = {
}
```

This final example adds state transitions that form a cycle of activity. If no interaction occurs, the kitten will naturally cycle between the states of `hungry`, `sleeping`, and `angry`. The `wait:10` condition on the exit will delay for a particular amount of time before automatically advancing into that state.
This final example adds state transitions that form a cycle of activity. If no interaction occurs, the kitten will naturally cycle between the states of `hungry`, `sleeping`, and `angry`. The `wait:10` condition on the exit will delay for a particular amount of time before automatically advancing into that state.

![](doc_images/kittens4.png?raw=true)

Expand All @@ -355,3 +355,18 @@ This concludes the tutorial. For more examples of types of bots, check out:
* `quiz.js` A basic quiz game where the user answers questions and these are used to determine a Hip Hop DJ name.
* `tesla.js` A bot based on the tracery [twitter bot](https://twitter.com/losttesla) of the same name.

### Install and Run Bottery

To run Bottery in your local machine you need to have node/npm installed on your system, if you haven't then visit https://nodejs.org/en/ and follow the installation guide. Once its done then browse into the project directory and run:

```
$npm install
$npm install -g grunt-cli

```

When installation is done, run:
```
$grunt serve
```
The default port to host the app is set to 9000 and for livereload module is 35730, you can change it by passing parameters with `$grunt serve -port <port> -liveReloadPort <liveReloadPort>`
52 changes: 52 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'use strict';

module.exports = function(grunt){
var protocol = grunt.option('https')?'https' : 'http';
var liveReloadPort = grunt.option('liveReloadPort') || 35730;
var serverPort = grunt.option('port') || 9000;
var HOST_IP = 'localhost';
grunt.initConfig({
connect: {
options: {
port: serverPort,
hostname: HOST_IP,
base: './src',
protocol : protocol
},
livereload: {
options: {
middleware: function(connect) {
return [
require('connect-livereload')({ port: liveReloadPort }),
require('serve-static')('./')
];
}
}
}
},
watch: {
options: {
livereload: liveReloadPort
},
files: [
'./js/**/*.js',
'./bots/**/*.js',
'./css/**/*.css',
'!./js/vendor/*',
]
},
open: {
dev: {
path: '<%= connect.options.protocol %>://<%= connect.options.hostname %>:<%= connect.options.port %>/'
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-open');
grunt.registerTask('serve', [
'connect:livereload',
'open:dev',
'watch'
]);
}
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "bottery",
"version": "1.0.0",
"description": "## A conversational agent prototyping platform by [Kate Compton](https://github.com/galaxykate).",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/smishr4/bottery.git"
Copy link
Contributor Author

@smishr4 smishr4 Nov 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh well, I cloned it from my fork and forgot to put git name when doing npm init thats why it had my name, I think you are right that it should be google and I should fix it. Let me know if you are sure about that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in the below commit 👍

},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/smishr4/bottery/issues"
},
"homepage": "https://github.com/smishr4/bottery#readme",
"devDependencies": {
"grunt": "^1.0.1",
"grunt-cli": "^1.2.0"
},
"dependencies": {
"connect-livereload": "^0.6.0",
"grunt-contrib-connect": "^1.0.2",
"grunt-contrib-watch": "^1.0.0",
"grunt-open": "^0.2.3"
}
}