Oracle has come up with a very powerful bots platform ready to serve the enterprises. It’s already very mature and serving 100s of customers. Today, I am going to walk you through how to create a simple bot. Which would be the first step to later connect with AMCe (Autonomous Mobile Core Enterprise) to pull some serious data from Oracle Engagement Cloud.
1. Go to your Oracle Bots instance and hit create to create a new bot.
2. Fill in the details and hit create
3. This will bring you to the intent screens. Lets create two simple intents. Called Get Opty and Get Service Requests. For each of the intent I am adding few occurrences as shown in below screen shots
4. At this point you need to train the bot by clicking the train on top right corner and picking first option.
5. Go to dialog flow and it will show a sample dialog BotML as below
#metadata: information about the flow
# platformVersion: the version of the bots platform that this flow was written to work with
metadata:
platformVersion: 1.0
main: true
name: OECBot
#context: Define the variables which will used throughout the dialog flow here.
context:
variables:
#The syntax for defining the variables is variablename: "variableType".
# The "variableType" can be defined as a primitive type ("int", "string", "boolean"), "list", or an entity name. A variable can also hold the results returned by the Intent Engine. For these variables, the "variableType" must be "nlpresult" (for example, iResult: "nlpresult").
greeting: "string"
name: "string"
#states is where you can define the various states within your flow.
# The syntax for defining a state is
# statename:
# component:Specify the component you want to use. This can be either a Built-In or custom component.
# properties:
# property1: "value" (These are the properties to the specified component
# transitions: You can specify one of the following four
# next: Specify the state you want to execute next after this state. By default it will execute the state specified after this
# error: Specify the state you want to execute in case the component encounters any error in execution.
# actions: You can handle various actions returned by the components here the syntax is actionName: "statename"
# action1: state1
# return: "done" You can exit the flow using the return statement
states:
askGreeting:
component: "System.List"
properties:
options: "Hello!, Ola!, Vannakam!, Namaste!"
prompt: "Hi there! What would you like me to echo back?"
variable: "greeting"
askName:
component: "System.Text"
properties:
prompt: "What is your name?"
variable: "name"
start:
component: "System.Output"
properties:
text: "${greeting.value} ${name.value}"
transitions:
return: "done"
6. You can delete it and start with below sample code as a starting point
#metadata: information about the flow
# platformVersion: the version of the bots platform that this flow was written to work with
metadata:
platformVersion: 1.0
main: true
name: OECBot
#context: Define the variables which will used throughout the dialog flow here.
context:
variables:
iResult: "nlpresult"
states:
intent:
component: "System.Intent"
properties:
variable: "iResult"
confidenceThreshold: 0.50
transitions:
actions:
unresolvedIntent: "unresolved"
unresolved:
component: "System.Output"
properties:
text: "Sorry I do not understand this"
transitions:
return: "Done"
The above BotML is a very simple dialog flow with just one unresolved intent if bot fails to resolve to an intent with 50% or more confidence (confidenceThrashold parameter indicates that).
7. Let’s start with our first intent with the goal to respond it a text indicating it works. The newly added intent would look like below
states:
intent:
component: "System.Intent"
properties:
variable: "iResult"
confidenceThreshold: 0.50
transitions:
actions:
GetOpty: "GetOpty"
unresolvedIntent: "unresolved"
GetOpty:
component: "System.Output"
properties:
text: "geting opportunities"
transitions:
return: "done"
unresolved:
component: "System.Output"
properties:
text: "Sorry I do not understand this"
transitions:
return: "Done"
The GetOpty is the name of the action which is mapped to a system component called System.Output. The job of this component is to simply output a text. The text property indicates that. The transition property drives the next step after this component is executed. In this case, it is simply exiting the flow. The word done means nothing special here. It can be any word. All that matters is the return statement.
8. Time to test it. The bot platform comes with a built in tester. To do the hit the small right arrow on top right corner and it will expand like below
9. Type your sentence and you can see it works as expected
Same way, you can add another intent and try out. Going deeper would come in future posts. This post should serve a good starting point.