Persona Form Sets for chatbots

Allow a single file to retain all the forms for a persona in one place, making them easy to save, modify and reload.

Role is added to each form to direct what it is doing in the persona, by default all are load unless the form type is action. Not all forms need to be used in the persona.

<form role=”main/background/action/load”

Once loaded you can see all the forms in the Web GUI. Change the role, view or remove them as needed to test.

Loading a form set

Select add form on a persona, select type=set, cut and paste the content in the window OR add a url to the location. Click ‘Add’ to load them and update the view.

Form Set Example

This example contains multiple types of bots and the can be found at:

 <!-- http://localhost:8081/forms/formset_weather.xml -->
 <!-- The DATA we get --> 
 <form name='location weather' data-type='dataform' data-link='location=possesses'>
 <input name="location" data-type="input" data-thought="no"/>
 <input name="sunrise" data-type="input" data-alias='sunrise time'/>
 <input name="sunset" data-type="input" data-alias='sunset time'/>
 <input name="precipitation" data-type="input"/>
 <input name="aqi" data-type="input" data-alias='Air Quality Index'/>
 <input name="temperature" data-type="input"/>
 <input name="visibility" data-type="input"/>
 <input name="wind" data-type="input"/>
 <input name="conditions" data-type="input"/> 
 <!-- input -->
 <form name='location' data-type='dataform'>
 <input name="latitude" data-type="input" value="%caller/latitude%"/>
 <input name="longitude" data-type="input" value="%caller/longitude%"/>
 <!-- FORM to show the weather -->
 <form name='_show_weather_' data-type='form' >
 <input name="weather sum" data-type="content" />
 <label for="weather sum" state='wake'>Currently it is %current:location weather/conditions% %current:location weather/temperature% and in %current:location weather/location%</label> 
 <input name="weather sum1" data-type="content" />
 <label for="weather sum1" state='wake'>Sunrise is at %current:location weather/sunrise%</label> 
 <!-- Explicit get and show -->
 <form name='_getweather_' data-type='form'>
 <!-- for location weather a request form OR here with longitude/latitued could be added -->
 <input name="get_weather" data-type="post" data-req-formname='location' data-resp-formname='location weather' data-posturl='http://localhost:8080/api/1.0/test/weather'/> 
 <input name="show report" data-type="form" data-formname="_show_weather_" data-task='weather report'/> 

 <!-- ACTION -->
 <form name='weather' role='action' data-type='action' data-object-type='thing' data-ref="caller's weather">
 <input name="status" data-type="input"/> 
 <input name="read" data-type="post"
 data-req-formname='location' data-resp-formname='location weather' 
 data-task='show weather' data-task-post='weather report'
 data-ability='is, get, tell' 
 <!-- Wake from background to tell the weather -->
 <form name='_weather_invoke_' data-type='form' >
 <input name="listen" data-type="invoke" data-seq="the/my:% X:weather:%"/> 
 <input name="intro" data-type="content" />
 <label for="intro" state='wake'>Getting the current weather</label> 
 <input name="weather report" data-type="form" data-formname="_getweather_"/>
 <input name="background" data-type="event" data-event='background_reset' />
 <!-- Bot (or sub element) that just gets the weather -->
 <form name='_weather_bot_' data-type='form'>
 <input name="intro" data-type="intro"/>
 <label for="intro" state='wake'>Getting the current weather</label> 
 <input name="weather report" data-type="form" data-formname="_getweather_"/>
 <input name="outro" data-type="outro" />
 <label for="outro" state='wake' data-pre-wait='10' data-post-wait='10'>Good bye</label>
 <input name="bye" data-type="event" data-event='bye'/>

 <!-- Bot: Could do more but mostly is weather -->
 <form name='_weather_taskbot_' role='main' data-type='form'>
 <input name="intro" data-type="intro"/>
 <label for="intro" state='wake'>Good %_time_period_of_day% how can I help you?</label>

 <input name="taskset" data-type="tasks" data-task-show='weather report' /> 
 <label for="taskset" state='wake' data-pre-wait='10'>What can I help you with this %_time_period_of_day%?</label>
 <label for="taskset" state='wake' data-channel='sms'>What do you want this time?</label>
 <label for="taskset" state='verify' data-pre-wait='10'>Now that %_last_task% is %_last_outcome%, is there anything else I can help you with?</label>
 <label for="taskset" state='canceled' data-pre-wait='6'>Is there anything else I can help you with?</label>

 <input name="outro" data-type="outro"/>
 <label for="outro" state='wake' data-pre-wait='10'>Thank you, hope you have a great %_time_period_of_day%</label> 
 <input name="bye" data-type="event" data-event='bye' />

In this Form Set _weather_taskbot_ acts as a conversational bot if set to main (the default), _weather_bot_ is a structured chatbot when set to main and weather if left as an action will automatically interact even with no main to get the weather. And lastly _weather_invoke_ if set to background will act as an element of a Digital Assistant to wake and get the weather.

With all of these in an enabled there will be conflicts though!

Our Next Posting

Our next posting will cover some of the information in this formset in more detail to help you build Conversation AI’s with The Sedro Project.