Giter VIP home page Giter VIP logo

dialogflow-max-retries-example's Introduction

dialogflow-max-retries-example

Using webhook for slot filling to allow redirection/exiting after a given number of attempts.

Basic Concept

Use Webhook for slot filling to set a context called param_retries with a paramter retries_left to keep track of remaining attempts for filling the parameter slot param.

When the webhook is called the first time and the parameter is missing, we set the context with value MAX_RETRIES. On every call to webhook and the parameter param is not filled, we decrement the value of retries_left in context param_retries. When this value reaches 0, we will exit/redirect the agent. To exist the intent, you simply clear all existing intents. To redirect to another intent which could be your custom fallback intent for the current intent, you can use agent.followupEvent and pass it name for event that will trigger the fallback intent.

Steps to use this example

  1. Clone this repo.
  2. Create a new agent in dialogflow and import the max-retries-example.zip available in the root folder of this repo.
  3. Deploy the dialogflowFirebaseFulfillment inside functions/index.js using firebase CLI or replace the contents of the inline editor files in fulfillment page of the agent with the corresponding files in functions/ folder.

Contributing

  1. Fork it.
  2. Clone it.
  3. Work on the fulfillment code using your code editor and/or import the agent into your dialogflow, change it and export and save & replace the zip in root.
  4. Submit a PR.

Future Work

  1. Redirection example and custom fallback intent for handling the redirected agent. (See issues).

Please report bugs or request new features in the issues

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.