Textbox

Adding a textbox to your page layout for testing purposes

The speech interface is fitting to the context of a user in a kitchen, but not always feasible for testing. It may take additional time for the system to process speech input, you may be in a noisy environment and there may be speech recognition failures. Hereby a pointer to easily enable a textbox to be rendered for input.

In the ‘html.pl’ file, where you format the pages to render during the conversation, for each of the pages that you may display at any point in the conversation add the following code to the Template variable:

<div class="chatbox mt-3"</div>

For the Aglio example page, this would look as follows:

myStandardPage(Txt, Button, Html) :- Template='<div class="card mx-auto" style="width:67vw">~a</div><div class="chatbox mt-3"</div>', myStandardImgCard(I),myStandardTxtCard(Txt, T), atom_concat(I,T,IT), format(atom(Card), Template, [IT]), html(Card, Html). myStandardImgCard('<div class="card mx-auto"><img class ="img-fluid" src="https://images.happycow.net/venues/1024/21/79/hcmp217975_1197912.jpeg" style="max-height:25rem"></div>'). myStandardTxtCard('<div class="w-100 card"><p>~a</p></div>'). myStandardTxtCard(Txt, Html) :- myStandardTxtCard(T), format(atom(Html), T, [Txt]).

Note that the button for speaking has been removed in this example. Nothing breaks down if you keep it in, and it may actually be handy to keep both options open. It is just a matter of esthetics while you are using the textbox display.

Â