Google Cloud Dialogflow
Use the Dialogflow node to connect directly to a Google Cloud Dialogflow agent. The agent accepts text for analysis.
Name
Give the node a name.
Service Account
Upload the Dialogflow service account private key credentials as generated in your Google Cloud account. Acceptable formats are json, cert, and txt.
Project ID
Specify the project ID for the Dialogflow virtual agent.
Custom Environment
Specify the custom environment for the Dialogflow virtual agent.
See Google Cloud Dialogflow documentation Versions and environments.
Leave this field blank if you have not configured a custom environment for the Dialogflow virtual agent.
Input Type
Connect using Dialogflow Query Input or Dialogflow Event Input.
Type |
Description |
---|---|
Text Input |
Fill in the Query field. Typically, the query text is in a variable. Type two curly brackets {{ to select from the variables in your account. For testing purposes, type some text. |
Event Input |
Fill in the Dialogflow Event Name and Event Parameters. |
Language
Select the language for the query.
Query Parameters
Pass query parameters in JSON format.
"timeZone": "America/New_York",
"geoLocation": {"latitude": 12, "longitude": 85},
"contexts": [{"name":"outage", "lifespanCount":5}],
"resetContexts": true,
"sessionEntityTypes": [{"name":"snack", "entityOverrideMode":"ENTITY_OVERRIDE_MODE_OVERRIDE", "entities":{"value": "Tea", "synonyms": ["tea", "Tea"]}}],
}
Learn more about query parameters with Dialogflow ES and query parameters with Dialogflow CX.
Music on Hold
The caller hears the uploaded audio file while they are placed on hold. Click to upload a WAV file (maximum 3MB).
Fetch Timeout
The fetch timeout is the maximum time in seconds that Studio waits to retrieve data from the API request.
On fetch timeout, the Response contains the exception message and code on the Data tab, and the exception code on the Meta tab.
Tab |
Description |
---|---|
Data |
{"error": <exception message>, "status_code": <exception code>} |
Meta |
{"status_code": <exception code>} |
To troubleshoot a suspected fetch timeout, you can manually add JSON paths for error and status_code to evaluate at runtime. On fetch timeout, status_code = 0.
Response
Match JSON name-value pairs of interest.
-
Click Preview Response to see the JSON name-value pairs.
Alternatively, to enter JSON directly, click the pencil icon. The pencil turns into a tick. Using the simple editor, ensure your code is valid. Click the tick icon to return to preview mode to continue with these steps.
-
Select a JSON name-value pair.
The path to the selected name-value pair is displayed in the JSON Path field.
You may need to switch between Data and Meta to locate a specific name-value pair.
-
To edit the JSON path, select Editable JSON.
Following are some ways to use the editable JSON facility. For more information, see Editing the JSON Path.
Example
Description
response['0']['email'] The path refers to the first email record. response['*']['email'] Replace the number zero with an asterisk to refer to all the email records. response['{{index}}']['email'] Replace the number zero with a variable to iterate over all the email records. -
Give a name to the JSON name-value pair in the Assign path to variable field.
-
In the Default Value (optional) field, assign a default value to the variable.
The default value itself can be a variable. Type two curly brackets {{ and select from the available options.
-
Click Assign.
The JSON path and variable are added to the table of return values.
-
Repeat. Select another JSON name-value pair.
You can update the table of return values at any time by assigning different variables to the JSON name-value pairs and changing the default values.