Giter VIP home page Giter VIP logo

clevy_test's Introduction

Clevy Simple Technical Test

The goal of this simple exercise is to create a very basic chatbot, that is able to answer a few simple questions.

Installation

  1. Clone this repository on a machine that run NodeJS (>= 8.9) and MySQL
  2. Run npm install to install dependencies
  3. Configure the MySQL Database

Install MySQL.

The default database name is clevy-simple-test, check if it's available. Init the database with the following command:

mysql -u USER -p < setup/mysql-init.sql
# Replace USER by a username allowed to make changes or use root
# use -p if you need a password

Configure your database connection settings in the config/mysql.js file (see the config section).

For MySQL 8 users, you need to allow connections with:

# In the MySQL Client (mysql -u USER -p)
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'
# Exemple if user is root and password is password

How to use

node bot.js "are you a bot?"

The bot stores interaction logs in the table interaction-logs.

Configuration

MySQL

Config file in config/mysql.js

// Exemple
module.exports = {
	host: '127.0.0.1',
	port: 3306,
	user: 'root',
	password: 'password',
	database: 'clevy-simple-test',
};

API Token

API Tokens are stored the config folder.

  • recast.key : Recast API

For a simplicity purpose I used files to store token, it would be more secure to use environment variables in production.

CSV file

The bot answers are located in the config/answers.csv. The first column contains intents, and the second answers.

The program works if no answers are valid, but the bot will never understand a question.

Dependencies

  • NodeJS (Tested on >= 8.9)
  • Axios
  • MySQL (Tested on MySQL 8, should work with lower versions)

clevy_test's People

Watchers

 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.