GithubHelp home page GithubHelp logo

kogno / kogno Goto Github PK

View Code? Open in Web Editor NEW
71.0 3.0 3.0 4.06 MB

Kogno is an open source framework running on the Ruby programming language for developing chatbots.

Home Page: https://kogno.io

License: Other

Ruby 100.00%
chatbot-framework chatbots conversational-ai conversational-bots ruby ruby-gem framework messenger-bot messenger-platform telegram-bot whatsapp-bot chatbot

kogno's Introduction

Kogno

Kogno is an open source framework running on the Ruby programming language for developing conversational applications.

It is based on the MVC architecture and strongly inspired by Rails, so if you have ever worked on this framework, Kogno will be very familiar to you.

The following messaging platforms are currently supported: WhatsApp, Messenger and Telegram, maintaining a unified code in a single application for all of them.

Full Documentation

You can read the full documentation at https://docs.kogno.io or just continue here.

Getting Started

1. Install Kogno gem:

$ gem install kogno

2. At the command prompt, create a new Kogno application:

$ kogno new my_chatbot

3. Change directory to my_chatbot and install the dependencies:

The MySQL development libraries must be previously installed before running the following command.

$ bundle install

4. Configure the database at config/database.yml:

adapter: mysql2
pool: 5
username: your_user_name
password: your_password
host:  localhost
database: your_database_name
encoding: utf8mb4
collation: utf8mb4_unicode_ci

5. Create framework's tables in database:

$ kogno install

6. Start your web server to receive incoming updates via an outgoing webhook from the messaging platforms:

$ kogno http start
In order to receive webhooks you must configure the messaging platforms:

How an app written in Kogno looks like?

The code below represents a Context class, which is the equivalent of a Controller class in Ruby on Rails:

class MainContext < Conversation

  def blocks

    intent "greeting" do
    
      @reply.text "Hello!"
      @reply.button(
        "How can I help you today?",
        [
          {
            title: "View Products",
            payload: "featured_products"
          },
          { 
            title: "My Cart",
            payload: "purchases/view_cart"
          }
        ]
      )
      
    end
    
    postback "featured_products" do
    
      @reply.text "Alright."
      @reply.template "products/featured", title: "Here is a list of today's featured products."
      
    end
    
    keyword ["stop", "quit"] do
    
      @reply.text "Alright"
      @reply.typing 2.seconds
      @reply.text "I'll stop writing you now.."
      
    end
    
    everything_else do 
    
      @reply.text "Sorry, but I don't understand what you said."
      
    end

  end

end

In the example above, MainContext has the ability to handle the following scenarios:

To better understand how blocks work and to see the full list of them, check the following link https://docs.kogno.io/contexts/blocks.

Contribute

You can contribute a lot to this project by developing conversational applications with Kogno and in case you find a bug, please report it.

And if you're as passionate about it as we are, come and code with us by fixing bugs, adding more integrations and creating more features.

License

Kogno is released under the MIT License.

Learn More

Read the full the documentation at http://docs.kogno.io.

Also you can download the source code of the flight reservation demo app written in Kogno.

kogno's People

Contributors

macuna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.