This plugin requires EZ-Builder for Microsoft Windows PC.
Get EZ-Builder for Windows
Google's API.AI is a free chatbot service which this plugin will use. Either manually enter conversational phrases into the input field, or send phrases programmatically using the provided ControlCommand(). This plugin requires an internet connection, which means your computer must be connected to both the robot and internet at the same time. Please consult the appropriate lessons in the learn section to configure your EZ-B to WiFi client mode or add a second USB WiFi adapter from here: http://www.ez-robot.com/Tutorials/Course/5
Here is an example of a conversational ChatBot that you can configure with API.AI and incorporate other EZ-Builder plugins, such as cognitive services for Vision and Emotion detection...
Programmatically send phrases using the following ControlCommand
ControlCommand("API.AI", Send, "Hello There")
The response from the server is stored in EZ-Script variables. Additionally, a script can be configured to execute when the server responds.
Some API.AI agents will return a list of parameters. The API.AI plugin implements 3 custom functions into the EZ-Script engine for obtaining parameters. The functions are...
Returns the number of parameters in the last response.
Usage: $x = APIGetParamCount()
APIGetParamByIndex( index )
Returns the parameter value at the specified index in the last response.
Usage: $Value = APIGetParamByIndex(2)
APIGetParamByKey( keyName )
Returns the parameter value by the key name. Look at the Agent or Variable Watcher to see what parameter key names are included in the response. The key names are case sensitive.
Usage: $Value = APIGetParamByKey("unit-to")
Here is an example of using the custom ez-script functions from the API.AI's Unit-Convert agent. If the input string is "What is 5mm into inches?", this ez-script code will show what the user is asking...
print("There are " + apigetparamcount() + " parameters in the response")
print("User is asking to convert " + APIGetParamByIndex(0) + APIGetParamByIndex(1) + " into " + APIGetParamByIndex(2))
1) Register with API.AI by visiting: https://api.ai/
2) Paste your Client ID in this plugin's configuration window
*Note: Please consult API.AI's website for information on setting up a personal chatbot.