anshumankmr / Conversation-Agent-using-Dialogflow-and-Node

A conversation agent using the MVC Architecture to simulate the working of a conversation agent used by a third party repair company.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conversation Agent With Express, Dialogflow, and MongoDB

A conversation agent using the MVC Architecture to simulate the working of a conversation agent used by a third party repair company.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

A working version of Node and Node Package Manager is a must. Also, a UNIX based OS is ideal. Please refer to this guideline for further details.

Run this command to see what version of npm you have.s

npm --version

The application has been tested to be stable with npm version 7.0.14.

Also, highly reccomended is ngrok. Also, also, we highly reccomend Insomnia or Postman for testing.

Installing

Download the repo like so

git clone https://github.com/anshumankmr/Conversation-Agent-using-Dialogflow-and-NodeJS

Change into the directory using

cd Conversation-Agent-using-Dialogflow-and-NodeJS

Run

npm install 

Running the Bot

Run this command

npm start

Run this

ngrok http 3000

Copy the https link generated by ngrok into the Dialoglow Agent's fulfillment section. It should look like this:

https://{{a randomly generated string }}.ngrok.io

Check this to be sure the API is running:

curl --request GET \
  --url https://{{the same randomly generated string as before }.ngrok.io/serverHealth \
  --header 'Content-Type: application/json' \
  --data '{
	"model": "XR",
    "brand": "iPhone",
    "issue": "Battery life has reduced by a lot. I think you guys have created a software update to slow it down."
}'

We can also try this in Insomnia we have here. Either way you should see this:

Server Health Looks Okay. We are good to go.

TO BE SHARED: The agents file

Running the tests

Currently, I am going to add some tests using Mocha and Chai. So that's work in progress.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

A conversation agent using the MVC Architecture to simulate the working of a conversation agent used by a third party repair company.

License:MIT License


Languages

Language:JavaScript 100.0%