Many advanced Verbot capabilities can be achieved with the use of input and output conditionals. Each Input and Output that you write can have a little snippet of C# that is evaluated before that Input
Verbot Editor 87
or Output is used. If the code evaluates to true, then then it can be used. If it's false, then the Input or Output are ignored.
One may also use the conditionals box in the input and output windows like so:
vars["fruit"] == "apple"
By putting this in a conditionals text field, it will only allow the output if this condition is true. So in this case:
Output: An apple a day keeps the doctor away.
Condition: vars["fruit"] == "apple"
vars[] is necessary. The name of your variable is always in quotes. So if one has "I eat an [fruit] everyday" as an input, it will always be referenced in the conditions as vars["fruit"].
Contributed to Verbot Wiki by Randal
3.3
Advanced Features
The Verbot 4.0 Standard Edition includes advanced features which aid in the development of Verbot KnowledgeBases.
Use the links below to jump to areas of interest.
KnowledgeBase and CSV Files
· Creating a CSV File
· Creating a KnowledgeBase Template
· Expand or Compile
3.4
Variables
My name is [username], do you remember me?
Variables help the Verbot remember things about you. Some variables can even be setup to remember things like phone numbers, family members and more.
The easiest way to understand Variables is by looking at an example. Let's start by learning how a Verbot remembers your name.
Verbot Technology Manual 88
Note: (what is) <-- is a Synonym. Click Here to find out more about Synonyms
You might have noticed that before you tell the Verbot your name, it call you "Friend". The Verbot uses "Friend" because the Variable "name" is not set.
The following example shows a Variable with the default setting of "Friend". You can of course replace "Friend" with anything you like (or not use an alternate at all, which would return nothing).
Example:
Your name is [name:Friend].
My name is [name]
We now know that if a variable is not set it will use alternate text if available, but how do we set the Variable? It's actually rather simple. Let's look at the Rule "My name is [name]."
Rule Name: My name is [name] Input: My name is [name]. Output: Good to meet you [name]!
The Variable "[name]" that is found within the Input "My name is [name]," tells the Verbot to record whatever text the user types in the place of "[name]."
The [name] within the Output simply prints out the text that was captured in the Input. Having the Verbot repeat back what it has captured not only makes the conversation with the Verbot more realistic, but it also makes it more personal.
For example, if you type "My name is Mary." the Verbot will respond "Good to meet you Mary!" and the Variable [name] is stored with the value of "Mary." From that moment on, whenever the Verbot finds the variable [name], it will display "Mary" in the output.
Verbot Editor 89
Variables in Variables: "Joe's phone number is 555-5555"
There are times when you want to save information, such as recording your friend's telephone numbers. To do this, you need to use Variables inside other variables.
Saving Joe's Number, and Jenny's, and John's, and Juan's too!
In the Rules above, you learned how to save a single name (Mary) to a single Variable ([name]). However, to save multiple phone numbers we'll need multiple Variables. How do you that with a single Rule? Let's find out.
Rule Name: Save Phone Number
Input: [contactname]'s phone number is [[contactname]s_phone].
Verbot Technology Manual 90
Note that is you typed in the same sentence using a different friend' information, you would get another unique variable. For example, if you typed in "Jenny's phone number is 555-8888." The Variables would be as follows:
contactname = "Jenny" jennys_phone="555-8888"
Notice that contactname is always set to the last Input (Jenny) but a unique variable is created (jennys_phone).
Retrieving the Variable: "What is Joe's phone number?"
Using the example above - we have two Variables available: joes_phone and jennys_phone. To access the Variables we create the following Rule:
Rule Name: Get Phone Number
Input: What is [contactname]'s phone number?
Output: [contactname]'s phone number is [[contactname]s_phone].
That's it. Now to access Jenny's number you would type "What is Jenny's phone number?" Note: It would be a good idea to add other inputs so that it'll match to phrases such as "give me Jenny's number" or simply "Jenny's number."
Verbot Editor 91
3.4.1
Internal Variables
Internal Variables.
Assuming you've read the Variables section, you already know that Variables are used to capture information from within an Input as well as display that captured information later. Internal Variables are built in functions which can be used to prevent information within a response.
[_time] [_time24]
Verbot Technology Manual 92
Tag: (Used within Verbot Output) Output Format: Example Output: Example
Verbot Output:
[_time] h:mm tt The time is [_time] "The time is 4:20 PM" [_time24] HH:mm Wake up soldier it's [_time24] "Wake up
soldier it's 16:20" [_date] MMM. d, yyyy Today is [_date] "Today is
Jan. 3, 2010" [_month] MMMM Another beautiful [_month] "Another
beautiful January" [_dayofmonth] d Today is day [_dayofmonth] "Today is
day 3" [_year] yyyy The year is [_year] "The year is
2010" [_dayofweek] dddd Today is [_dayofweek] "Today is
Saturday"
What did I say? You said [_input]!
[_input]
Prints last User Input within the Verbot response. This tag can also be used to save User Input to other variables.
Ex.
Rule Name: What did I say? Input: What did I say? Output: You said: [_input] Sample Conversation
User Input: "What did I say?"
Verbot Output: "You said: What did I say?"
What did I say? You said [_lastinput].
[_lastinput]
Prints User's last input before the current input. Ex.
Rule Name: What did I say? Input: What did I say?
Output: You said: [_lastinput] Sample Conversation
User Input: "How old are you?"
Verbot Output: "I'm 5 years old."
Verbot Editor 93
Verbot Output: "You said: How old are you?"
What did you say? I said [_lastoutput]!
[_lastoutput]
Prints last Verbot response. Ex.
Rule Name: What did you say? Input: What did you say? Output: I said: [_lastoutput] Sample Conversation
User Input: "How old are you?"
Verbot Output: "I'm 5 years old."
User Input: "What did you say?"
Verbot Output: "I said: I'm 5 years old."
3.4.2
Variables with Alternate Text
I'm sorry I didn't catch that? (Alternate Text Variable)
The Alternate Text Variable allows you assign alternate text in case a variable has not yet been defined.
[name:alternate text] Example:
Rule Name: What is my name? Input: What is my name?
Output: As far as I know, your name is [name:Friend].
In the example above if the User asks "What is my name?", the Verbot will respond in one of two ways depending on if the Variable name is set.
If the Variable name has been set, the Verbot will respond with the set Variable. For example if name was previously set to "John", the Verbot will respond with "As far as I know, your name is John"
Verbot Technology Manual 94
Interface. Using the data from the CSV and Template Rules, a new KnowledgeBase can be created which include the CSV data which can then be accessed through conversational interactions with the Verbot.
The following sections cover the creation of KnowledgeBase Templates and CSV files:
· Creating a CSV file
· Creating a KnowledgeBase Template
· Expanding or Compiling
3.6.1
Creating a CSV File
What is a CSV file?
CSV also known as Comma Separated Value files are a standard export format for many applications, most notably is Microsoft Excel. Use the CSV format you can create data driven KnowledgeBase by entering your data by way of a spreadsheet program such as Excel or Open Office Spreadsheet. Using KnowledgeBase Template Rules you can access CSV data by Compiling or Expanding the
KnowledgeBase Template.
Note: If you don't have Microsoft Excel you may want to download Open Office which includes a spreadsheet application. Adding Data.
This section assumes you have Microsoft Excel. If you haven't done so already, open a blank Excel spreadsheet.
The first row is considered a heading. For this example you are going to make a Verbot phone book. So in row 1 column A enter "Name". Then in row 1 column B enter "Number". Your spreadsheet should look like the following:
Verbot Editor 95
Now that the spreadsheet has headings you can begin entering names and numbers for your friends and family. Your spreadsheet should end up looking something like this:
Verbot Technology Manual 96
>"Save As"
The following dialog box should appear. Click on the "Save as type" drop down and locate the file type: "CSV (Comma delimited)" format. Type in phone_book for the name of the file, and click the "Save" button.
Once your you've saved the file it's time to move on to the next section
Verbot Editor 97
3.6.2
Creating a KnowledgeBase Template
What is a KnowledgeBase Template?
A KnowledgeBase Template is used to create data driven KnowledgeBases. The first step is to
create a CSV file which contains the data you wish to access. Then create Template Rules to access the data.
What is a KnowledgeBase Template Rule?
A Template Rule is a Rule that has been setup to use CSV data to created new Rules. The new Rules are created when you click "Expand" or when the KnowledgeBase is compiled using "Compile
KnowledgeBase" The following section assumes you completed the Creating a CSV file section and are ready to create a KnowledgeBase Template.
Creating a KnowledgeBase Template.
To begin creating a KnowledgeBase Template, open the Verbot Scripting Editor. Once the Verbot Scripting Editor is loaded it's time to make your first Template Rule. If you're not familiar with Rule creation you may want to review the Creating your First Rule section.
Create a new Rule using the following information: Rule Name: Get Phone Number
Input: What is #Name's phone number? Output: #Name's phone number is #Number. You're screen should appear as shown below:
Verbot Technology Manual 98
Locate the phone_book.cvs file you created in the Creating a CSV file section and click "Open" to add it to the Resource Files Details field.
Note: Multiple CSV files can be used within one KnowledgeBase.
At this point it's a good idea to save your KnowledgeBase.
Now that you have a Template Rule and a loaded CSV file it's time to Expand or Compile the KnowledgeBase.
3.6.3
Expand or Compile
Expanding or Compiling
Once you have a KnowledgeBase Template with associated CSV file ready to go, it's time to Compile it, Expand it, or you can do both. The following information describes the difference between
Expanding and Compiling.
Why should a KnowledgeBase be Expanded?
When a KnowledgeBase Template is Expanded a new .vkb file is created based on the
KnowledgeBase Template Rules and the loaded CSV file. Once the KnowledgeBase is Expanded and the new .vkb file is created, the new .vkb file can be loaded within the Verbot Scripting Editor for tweaking or to view the results.
How to Expand a KnowledgeBase Template
Why should a KnowledgeBase be Compiled?
Compiling a KnowledgeBase Template creates a new .ckb file which created based on the
KnowledgeBase Template Rules and the loaded CSV file. Once the KnowledgeBase is compiled a new .vkb file is created which can be loaded into the Free Verbot Player or the Verbot Standard Edition Player for testing or use. It is important to note that the Free Verbot Player can only load Compiled KnowledgeBases (.ckb). To share your KnowledgeBase with friends you'll need to provide them with this link to the Free Verbot Player and supply them with your KnowledgeBase Compiled (.ckb).
How to Compile a KnowledgeBase Template
How to Expand a KnowledgeBase Template
To Expand a KnowledgeBase Template you can click on the Expand icon or click "Tools"-->"Expand Templates" on the menu.
Verbot Editor 99
Once you have clicked the "Expand", a dialog box will pop-up. Give the KnowledgeBase Template a new name. For example: phone_book_expanded.
Click the save button to begin the Expand process. Depending on the size of the CSV file and the amount of Template Rules it may be several seconds to Expand the KnowledgeBase Template. Once the Template is expanded you may load the resulting .vkb file into the Verbot Scripting Interface to see the results and tweak if needed.
How to Compile a KnowledgeBase Template
To compile a KnowledgeBase Template click on the Compile icon or click "Tools"-->"Compile KnowledgeBase" on the menu.
Verbot Technology Manual 100
3.7
Tags and Inputs
Verbot Standard Edition allows the use of Tags and built Inputs within KnowledgeBases.
· MS Agent Tags
These tags are used to interact with the MS Agent Character. Includes movement and animation tags.
· Special Inputs
This section covers special Inputs which can be used in KnowledgeBases
· Verbot Tags
Allow your Verbot to interact with Users in dynamic ways.
3.7.1
MS Agent Tags
Tags and Microsoft Agent
Verbot® 4.0 utilizes Microsoft Agent, because of this, not only will you be able to create your own characters for use with Verbot® 4.0 engine, but you'll also be able to utilize the animation features of MS Agent.
Note: All Verbot® animation is done with tags that are inserted into Output/Response fields. For example, to make a Verbot® character smile, simply insert the following: "Here is my smile <agent.play smile>"
Microsoft Agent Tags: <agent.play animation> <agent.gestureAt x y> <agent.moveTo x y speed> <agent.moveHome> <agent.pause ms> <agent.speak text>
Show a little emotion will ya?
<agent.play animation> Plays the agent animation.
Ex: I really like you.<agent.play quiz>
Animation Available:
Verbot® Character Sylvie® currently has the following animations:
angry lookaround quiz Sad smile stickit wow
Note: these animations are only valid for the character "Sylvie®" . Though you are able to download any MS Agent and use it with Verbot® 4.0, the animation commands will vary for every character.
This way! No, No. That way!
<agent.gestureAt x y>
Tells the agent to gesture at the given screen coordinates(?). Ex: Click the Start button.<agent.gestureAt 0 768>
Verbot Editor 101
*Verbot® Character Sylvie® does not currently support gestures. To use this feature try the MS Merlin character.
Move stage left!
<agent.moveTo x y speed>
Moves the agent to the given screen coordinates(?).
The moveto command allows you to set screen coordinates for the Verbot® character to move to. Like the Animation Tags, the moveto tag is inserted into Outputs.
To make the character move, you would insert "<agent.moveto x y s>" where "x" is the x screen coordinate, "y" is the y screen coordinate, and "s" is the speed in which to move.
Ex.
"I'm going to move up. <agent.moveto 800 600 1>"
or
"<agent.moveTo 0 0 1>Can't catch me!<agent.moveTo 500 400 10>"
Get back here!
<agent.moveHome>
Moves agent back to center of Verbot Player window.
The moveHome command should be used to reposition the agent to the center of Verbot Player window. The command is usually helpful after using the moveto command above.
How to make a Verbot® relax a little.
<agent.pause ms>
Pauses the agent for the given number of milliseconds. Ex: My name is<agent.pause 2000> Rex!
Say it, don't text it!
<agent.speak text>
Speaks the given text without displaying it. Example:
If you were to use the following text within an Output, "The secret word is:" would be displayed in the out put box.
Verbot Technology Manual 102
· _blank
3.7.2.1 _startup
_startup
The "_startup" tag is used within an Input. When Verbot 4.0 first loads it automatically checks to see if a Rule with the Input "_startup" exists. If so, the Rule is fired. The _startup Input tag is best used to fire a Rule with startup greetings.
3.7.2.2 _bored
_bored
When the Verbot character becomes idle for an extended period of time, Verbot 4.0 will attempt to fire the Input "_bored". You can set how long the Verbot must sit idle before the boredom response is activated from the Verbot 4.0 Interface.
3.7.2.3 _blank
_blank
The _blank Input is used to fire a rule based on an Input that contains no text. For example: if you were to submit an Input with no text (i.e. by pressing enter) when interacting with the Verbot, this would reply something like: "To talk to me, you need to type something in the Input box."
3.7.3
Verbot Tags
Read! Run! Send! Verbot Tags add functionality.
The Verbot engine utilizes custom tags used for interacting with the Verbot engine. Tags include reading text files, running programs, and adding dynamic Rule creation abilities.
Note: All Verbot® tags are inserted into Output/Response fields. For example, to make a Verbot® shut down the Verbot Interface, simply insert the following: "See ya later! <exit>"
Verbot 4.0 Tags: