newbot-dialogflow

1.1.1 • Public • Published

Description

Integrate the DialogFlow skill into NewBot

Installation

Install with

npm install newbot-dialogflow

Use

  1. In your skill, import the package
  2. Add the skill in the skills property and configure
import dialogflow from 'newbot-dialogflow'
import code from './main.converse'

export default {
    code,
    skills: {
        dialogflow: dialogflowSkill({
            projectId: 'ENTER_PROJECT_ID_HERE',  // https://dialogflow.com/docs/agents#settings,
            sessionId: 'quickstart-session-id',
            languageDefault: 'en-EN', // optionnal
            credentials: 'PATH_TO_JSON_FILE' // https://cloud.google.com/docs/authentication/production
        })
    }
} 

Use in ConverseScript

In main.converse :

Get Response

@Intent('input.welcome')  // action name
welcome() {
    > { :intent.response  } // response
} 

Get Response

@Intent('input.welcome')  // action name
welcome() {
    > Hey { :intent.firstname.value  } // display parameter "firstname"
} 

Get Error

@Intent('dialogflow.error')
error() {
    > { :intent.error } // display JS error
}

Readme

Keywords

none

Package Sidebar

Install

npm i newbot-dialogflow

Weekly Downloads

5

Version

1.1.1

License

ISC

Unpacked Size

4.02 kB

Total Files

3

Last publish

Collaborators

  • webcreative5