Run Dialogflow
Runs a series of questions and answers based on an end user's intentions, according to the configuration of a specific project, via Google Dialogflow 🡥.
Starting from IBM RPA 23.0.3, support for Interactive Voice Response (IVR) is removed from this command due to the removal of IVR. For more information, see Removed.
Command availability: IBM RPA SaaS and IBM RPA on premises
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
botDialogflow --googleCredential(String) --projectId(String) [--intentsToComplete(List<String>)] [--totalTimeout(TimeSpan)] [--recognitionTimeout(TimeSpan)] [--speechCompleteTimeout(TimeSpan)] [--noInputTimeout(TimeSpan)] [--speechIncompleteTimeout(TimeSpan)] [--confidenceThreshold(Numeric)] [--beep(Boolean)] [--language(Language)] --text(String) [--timeout(TimeSpan)] (StringDictionary<DialogflowIntention>)=intents (DataTable)=interactions
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Google credential | googleCredential |
Required |
Text |
Credential for the service account created for the Dialogflow Project, in JSON format, available through Google Cloud Platform (GPC). |
Project Id | projectId |
Required |
Text |
Project ID created in Google Dialogflow 🡥, which contains the intents registered for the context. |
Intents to Complete | intentsToComplete |
Optional |
List<Text> |
List with the intentions 🡥 expected for the context. 1. While all the listed intentions are not satisfied, the command continues to execute. 2. If no intention is given, the command executes all intentions of the specified project. |
Total timeout | totalTimeout |
Optional |
Time Span , Number , Text |
Total time to run the command. |
Recognition timeout | recognitionTimeout |
Optional |
Time Span |
Timeout to acknowledge the user's response. |
Speech complete timeout | speechCompleteTimeout |
Optional |
Time Span |
Maximum time limit allowed without interaction with the robot after its speech. Starting from IBM RPA 23.0.3, this parameter is removed. |
No input timeout | noInputTimeout |
Optional |
Time Span |
Time limit for the user to start the conversation. Starting from IBM RPA 23.0.3, this parameter is removed. |
Speech incomplete timeout | speechIncompleteTimeout |
Optional |
Time Span |
Maximum time limit to wait for a user speech that has not ended yet. Starting from IBM RPA 23.0.3, this parameter is removed. |
Confidence threshold | confidenceThreshold |
Optional |
Number |
Numeric expression that indicates the confidence level for recognizing user's response. Confidence rate is from 1 to 100. If recognition has a lower rate than specified, the return is null. Starting from IBM RPA 23.0.3, this parameter is removed. |
Beep | beep |
Optional |
Boolean |
Beep to be emitted on each robot speech. Starting from IBM RPA 23.0.3, this parameter is removed. |
Language | language |
Optional |
Language |
Language to be used in robot conversation. The variable of type "Language" is obtained using the Create a Language command. |
Text | text |
Required |
Text |
Initial message to send to user. |
Timeout | timeout |
Optional |
Time Span , Number , Text |
Timeout for each interaction to be made by the command according to the specified intentions. If no value is defined in this parameters, the execution uses the context time defined by the command Set Timeout. If the script does not use this command, the default time is 5 seconds. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Intentions | intents |
String Dictionary<Dialogflow Intention> |
Returns the recognized intentions and their corresponding parameters, as it was previously configured at Google Dialogflow 🡥. |
Interactions | interactions |
Data Table |
Returns all interactions with the Dialogflow agent, such as: intention performed, agent's response, and action performed during the interaction. |
Example
After setting up a project in Google Dialogflow 🡥, in this example context of a cafeteria, the Run Dialogflow command runs while the intentions order.drink and order.snak are not answered. When answering them, it returns: the interactions between robot and user that were performed; the intentions met and their respective parameters.
defVar --name language --type Language
defVar --name intentionsToVerify --type List --innertype String --value "[order.drink,order.snak]"
defVar --name identifiedIntentions --type StringDictionary --innertype DialogflowIntention
defVar --name totalInteractions --type DataTable
createLanguage --culture "en-US" language=value
botConnect --type "Chat" --language ${language} --autoanswer --timeout "00:05:00"
// The required credential below is made available after setting up your project in Google Dialogflow.
botDialogflow --googleCredential "Path to JSON file" --projectId "Project Identifier Name" --intentsToComplete ${intentionsToVerify} --totalTimeout "00:08:20" --text "Welcome to the Coffee Shop! How can we help you?" --textformat "0" --timeout "00:08:20" identifiedIntentions=intents totalInteractions=interactions
botDisconnect
Limitations
The Recognition timeout, No input timeout, Speech complete timeout, Speech incomplete timeout, and Beep parameters are specific to IVR communication.