@jovotech/model-dialogflow
TypeScript icon, indicating that this package has built-in type declarations

4.0.3 • Public • Published

Jovo Model: Dialogflow

Learn how to turn the Jovo Model into a Dialogflow agent.

Introduction

Language models for Dialogflow are called Dialogflow agents. You can either manage them via API (what the Jovo CLI is doing during deployment) or in the Dialogflow console, which offers a graphical user interface.

Dialogflow agents include:

  • Intents with training phrases (phrases in the Jovo Model) and entities (inputs)
  • Entity types (input types)
  • And more, like events, actions, fulfillment

Learn more about the structure in the official Dialogflow documentation. The Jovo Model can be translated into this structure by using the jovo build command (see below) or the npm package (see below).

Dialogflow-specific Elements in the Jovo Model

This section provides an overview how the Jovo Model (see general structure in the main Jovo Model docs) can be extended with platform-specific content for Dialogflow.

Intents

You can add options to Jovo intents like this:

"HelloWorldIntent": {  
	"phrases":[  
		"hello",
		"say hello",
		"say hello world"
	],
	"dialogflow": {
		"priority": 500000,
		"webhookForSlotFilling": true
	}
},

In the above example, you can see that you can add specific elements like a priority to an intent.

The priority can have the following value :

Definition Value Color
Highest 1000000 Red
High 750000 Orange
Normal 500000 Blue
Low 250000 Green
Ignore 0 Grey

Inputs and Input Types

You also can manage your entity as a list by specifying the parameter isList:

"entities": [
	"any": {
		"type": {
			"dialogflow": "@sys.any"
		},
		"dialogflow": {
			"isList": true
		}
	}
]

You can add a specific parameter automatedExpansion to allow automated expansion like this:

"inputTypes": [
    {
        "name": "myCityInputType",
	    "dialogflow": {
        	"automatedExpansion": true
      	},
        "values": [
            {
                "value": "Berlin"
            },
            {
                "value": "New York",
                "synonyms": [
                    "New York City"
                ]
            }
        ]
    }
],

System Entities

Find all types in the official Dialogflow system entities documentation.

If your intent uses an entity (see how they are added to the Jovo Model) that requires a Dialogflow system entity type, you can add it like this:

"entities": [
	"name": {
		"type": {
			"dialogflow": "@sys.given-name"
			// ...
		}
	}
]

Dialogflow-only Elements

Some elements (intents, entities) might be required only by the Dialogflow portion of your Jovo project. For this you can add a dialogflow object to your Jovo Model.

 "dialogflow": {
    "intents": [
        {
            "name": "Default Fallback Intent",
            "auto": true,
            "webhookUsed": true,
            "fallbackIntent": true
        },
        {
            "name": "Default Welcome Intent",
            "auto": true,
            "webhookUsed": true,
            "events": [
                {
                    "name": "WELCOME"
                }
            ]
        }
    ],
    "entities": [
        {
            "name": "hobby",
            "isOverridable": true,
            "isEnum": false,
            "automatedExpansion": false
        }
    ]
}

The dialogflow object contains the agent data in its original syntax. For example, you export your Dialogflow Agent, look at the files, and copy-paste the stuff that you need into this part of the Jovo Language Model file.

Using the Dialogflow Jovo Model npm Package

Install the package like this:

$ npm install @jovotech/model-dialogflow

You can learn more about all the Jovo Model features here: Using the Jovo Model npm Packages.

Readme

Keywords

none

Package Sidebar

Install

npm i @jovotech/model-dialogflow

Weekly Downloads

0

Version

4.0.3

License

Apache-2.0

Unpacked Size

133 kB

Total Files

22

Last publish

Collaborators

  • jovotech