Code Monkey home page Code Monkey logo

rasa-2.x-form-examples's Introduction

Rasa 2.x Form Examples

Archived

This repository contains a collection of tutorials that will help you understand forms. Each example is self contained and is part of a series of videos on our youtube channel. Note that all the demos here are built with Rasa 2.3 in mind. These examples won't work for Rasa 3.x onward.

Installation

To run all the examples here you'll need to install Rasa, preferably in a virtualenv in the root directory.

python -m pip install rasa==2.3

If you'd also like to use Rasa X, you can install this via;

python -m pip install rasa-x --upgrade -i https://pypi.rasa.com/simple

1. Custom Actions

It helps to understand custom actions and slots before we talk about forms. In this simple bot we show how they work by keeping track of a users name.

Code can be found in the 01-actions folder.

2. Slots

It helps to understand custom actions and slots before we talk about forms. In this simple bot we show how they work by keeping track of a users name.

Code can be found in the 02-slots folder.

3. Simple Forms

If we want to query multiple things from the user, it may be best to use forms instead of custom actions. Luckily for us, we can use our RulePolicy to help us out.

Code can be found in the 03-simple-forms folder.

4. Asking Questions

You can customise how questions are asked in a form. You can write templates in a domain.yml file or use custom actions.

5. Form Validation

What if we want to validate the input of our form? We don't want to have a name that's an empty string after all!

Code can be found in the 04-checking-form-input folder.

5. Entities and Forms

The user might give the response in a sentence, in which case we'll want to detect entities instead of grabbing the full text.

Code can be found in the 05-entities-and-forms folder.

6. Expanding Forms

The user might give the response in a sentence, in which case we'll want to detect entities instead of grabbing the full text.

Code can be found in the 06-expanding-forms folder.

7. Elaborate Name Form Example

In this final example we'll show an elaborate example of a form that can ask for names.

rasa-2.x-form-examples's People

Contributors

koaning 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rasa-2.x-form-examples's Issues

Fetch question dynamically and place the input in slot

RASA version 2.3.1
Python version 3.8.5
RASA sad version 2.3.1

I want to ask user questions in the chatbot dynamically.
so, basically, I already have questions stored inside the database and I am fetching those questions in an action file and after that, I want to start form. that question's answers will be stored in a particular slot.
so, whenever I add one more question inside the database it will ask in the chatbot.

Validation rules for regex-regulated slot while in the active loop of the form

Are there other ways to validate a slot in an ongoing form, except for a custom action?

For example:
You have a form for reporting an incident of a certain device. To do this, you have to provide

  • a 9-digit number which is used by the the company as, lets say, the identifier in the asset management db.
  • describe the issue
  • provide your name
    The identifier is the first slot, and hence doesn't mean "the end of the form". I have the impression that custom validation is always done "at the end" when a form has filled all slots.

Could be nice to have a default validation rule (i.e. fallback sentence with extra instructions) for regex-regulated entities as slots?
In this example: If a user gives 8 numbers (by mistake for example) the bot should be able to say "Small mistake there, I expected 9 digits".

Example '06-custom-name-experience' is not working

Example 06-custom-name-experience is not working as shown in the YT video, if the first name is not in the list, rasa just asks for the first name again, no button, no payload ...

Rasa Version : 2.8.1
Rasa SDK Version : 2.8.1
Rasa X Version : 0.42.0
Python Version : 3.7.7

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.