Giter Site home page Giter Site logo

rasa-agent-bot-demo's Introduction

Chatwoot Agent Bot Demo using Rasa

This is a sample implementation of agent bot capabilities in chatwoot using rasa . Rasa Open Source is a machine learning framework to automate text- and voice-based assistants.

You can refer the rasa documentation to get it up and running in your machine.

This implementation isn't a recommended set up for production, but just to illustrate the capabilities of the platform. Please build on top of this ideas discussed to have in running in production.

Follow the given steps to get your agent bot integration up and running.

Refer the Video Walkthrough and blog post

Get a rasa project up and running.

Go to a new directory and create a rasa project. If you have rasa installed in your machine you can get it up and running by follow in commands. Refer docs to get the installation up and running.

mkdir rasa
cd rasa
rasa init --no-prompt

go to credentials.yml file in the directory and ensure the following value is set. This is to ensure we can communicate with rasa through rest api

rest:
  # you don't need to provide anything here - this channel doesn't
  # require any credentials

start the rasa server with following command

 rasa run -m models --enable-api --log-file out.log

Get your chatwoot up and create an agent bot

go to your chatwoot directory and ensure your local server is running. Start a rails console in your directory.

bundle exec rails c

Inside the rails console, type the following commands to create an agent bot and get its access token. Save the retrieved token as you would need it in further step.

bot = AgentBot.create!(name: "Rasa Bot", outgoing_url: "http://localhost:8000")
bot.access_token.token

Connect Agent Bot to your inbox by running the following command

AgentBotInbox.create!(inbox: Inbox.first, agent_bot: bot)

Clone this repo into your machine and run the rasa router script.

clone repo using the following command.

git clone [email protected]:chatwoot/rasa-agent-bot-demo.git

open up the rasa-router/index.php file in your editor and change the follow values with appropriate ones.

$rasa_url = 'http://localhost:5005';
$chatwoot_url = 'http://localhost:3000';
$chatwoot_bot_token = '<your agent bot token>';

run the php server in the rasa-router directory

cd rasa-router
php -S localhost:8000

Connect to your chatwoot webwidget and start a conversation.

if you are on your local machine, you can access the widget through the test page

http://localhost:3000/widget_tests

Notes

You can also refer to the RasaHQ / rasa-demo for adding additional capabilities to your bot. If training rasa through scripts isn’t your thing, check the exciting rasa projects which gives a UI to create your rasa stories.

You can build on top of the ideas discussed here to implement your solutions. Refer to the chatwoot api to see the available options in chatwoot for your bots.Pretty excited to see what you guys come up with.

rasa-agent-bot-demo's People

Contributors

sojan-official 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.