Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elct9620/doll
The Chatbot Framework written in Ruby
https://github.com/elct9620/doll
chatbot ruby
Last synced: about 1 month ago
JSON representation
The Chatbot Framework written in Ruby
- Host: GitHub
- URL: https://github.com/elct9620/doll
- Owner: elct9620
- Created: 2016-12-27T05:38:47.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-12T08:49:56.000Z (over 7 years ago)
- Last Synced: 2024-11-10T05:11:22.743Z (2 months ago)
- Topics: chatbot, ruby
- Language: Ruby
- Homepage:
- Size: 38.1 KB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Doll [![Gem Version](https://badge.fury.io/rb/doll.svg)](https://badge.fury.io/rb/doll) [![Build Status](https://travis-ci.org/elct9620/doll.svg?branch=master)](https://travis-ci.org/elct9620/doll) [![Coverage Status](https://coveralls.io/repos/github/elct9620/doll/badge.svg?branch=master)](https://coveralls.io/github/elct9620/doll?branch=master) [![Code Climate](https://codeclimate.com/github/elct9620/doll/badges/gpa.svg)](https://codeclimate.com/github/elct9620/doll)
===The Chatbot Framework written in Ruby
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'doll'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install doll
# Requirement
* Ruby 2.3+
## Usage
Prepare your Rack (`config.ru`)
```ruby
require 'doll'require './config'
require './converse'run Doll.server
```Configure your chatbot (`config.rb`)
```ruby
Doll.configure do
# Support Adapters
adapter Doll::Adapter::Plain.new
adapter Doll::Adapter::Facebook.new(
'ACCESS_TOKEN',
'SECRET_TOKEN',
'VERIFY_TOKEN'
)# NLP Support
use Doll::NLP::Wit.new('API_TOKEN')
end
```Configure your chatbot converse rules (`converse.rb`)
```ruby
Doll.converse do
match /[Hh]ello/, to: :hello
# Current only support `intent` as predict entity for Wit.ai
intent :buynot_found { 'I cannot figure out what you say....' }
end
```Create your dialog classes
```ruby
# TODO: Namespace and Class name can be improvedmodule Hello
# Initialize Dialog
class StartDialog
def process
# TODO: View-like helper comming soon
Doll::Message::Text.new('Hi, Human!')
end
end
end
``````ruby
# TODO: Namespace and Class name can be improvedmodule Buy
# Initialize Dialog
class StartDialog
def process
# TODO: View-like helper comming soon
Doll::Message::Text.new('Ok, I know you want buy something')
end
end
end
```Start your server
```bash
$ puma -C config.ru
```Now, you can access your chatbot via `https://example.com/facebook`
### Rails Integrate
Mount doll routes
```ruby
mount Doll.server => '/doll'
```Add configuration and converse to `config/initializes/doll.rb`
```ruby
Doll.configurate do
adapter # ...
endDoll.converse do
match # ...
intent # ...
end
```Add dialog classes into `app/bot`
```ruby
# app/bot/hello/start_dialog.rbmodule Hello
class StartDialog < Doll::Dialog
def process
# ...
end
end
end
```## Roadmap
* [x] Workable Chatbot
* [ ] Converse
* [x] Regexp Matcher
* [x] NLP intent
* [ ] Routing options
* [ ] Improved routing
* [ ] Session
* [ ] Store
* [ ] Memory-based
* [ ] Redis
* [ ] Converse Management
* [ ] Dialog
* [ ] Response Builder
* [ ] Parameter
* [ ] Adaptetr
* [x] Text Message
* [ ] Image Message
* [ ] LINE
* [ ] Text Message
* [ ] Image Message
* [ ] Middleware
* [ ] NLP
* [x] Wit.ai
* [ ] LUIS.ai## Development
TODO: Write development guide
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/elct9620/doll.