Orbita introduces a Free Text input field in a Chatbot. You can type any text in this input field, which will not be processed by the natural language processor (NLP).
As an admin user, you You might want to take feedback or suggestion from the chatbot user. These responses from the user should skip the NLP and handled separately.
Sample flow:
...
Table of Contents | ||
---|---|---|
|
Function node
Place the following code in the function node as shown in the previous image.
Code Block |
---|
if(msg.payload.originalDetectIntentRequest && msg.payload.originalDetectIntentRequest.payload && msg.payload.originalDetectIntentRequest.payload.orbitaFreeText) {
msg.payload.request.intent.slots = {freeText: {value: msg.payload.originalDetectIntentRequest.payload && msg.payload.originalDetectIntentRequest.payload.orbitaFreeText}};
}
return msg; |
...
Directive
The Free Text input option is available in the Single Input control of Flow studio.
Open the Directive tab in Single Input control.
Select Textbox in the Input Type dropdown.
Click Save.
Choose the input type option: Hidden, Single Line, Multi Line
Warning |
---|
The Free Text input will not work in with Alexa, it will work with voice-based bots. It only works in phone applications and Chatbots. The same is displayed in the warning text. |
...
Changes in Dialogflow
The following event should be present in the OrbitaFlowMessages intent in Dialogflow.
FlowMessageFreeTextEvent
...
Changes in Orbita Intent
OrbitaFlowMessages intent in Orbita should also contain the same event.
...
In the Chatbot, you can view the Free Text input box as shown in the following image.
...
If you want to hide the Free Text input box and let users type in the text input area.
Place the following code in Bot out parser in the Bot provider V2 node.
Code Block |
---|
if(msg.payload.orbitaPayload.payload && msg.payload.orbitaPayload.payload.flowInfo && msg.payload.orbitaPayload.payload.directive && msg.payload.orbitaPayload.payload.directive[0].type ==='textbox')
{
msg.payload.orbitaPayload.payload.directive[0].hidden = true
} |
...
The Free Text Input box will not appear in the chatbot. You can type your free text directly in the text input area.
...
Input Options:
Keyboard checked and selecting hidden - bottom text entry
Keyboard un-checked, single line input
The bottom keyboard is hidden, and a small text field for typing something like a phone numberkeyboard un-checked, Multi-line input
The bottom keyboard is hidden and a Text Area is an input.
Intent FreeTextIntent
Note Events: needs to be set to FlowMessageFreeTextEvent
No utterance
...
Slot freeText value
...
The results can be found at
msg.payload.request.intent.slots.freeText.value
In this mode:
Previous
Code Block |
---|
['previous','previous question','go back', 'skip back', 'back up'] |
If the utterance matches one of these items the Flow manager will back up to the Previous question
Repeat
['repeat','repeat again','repeat the question','tell me again', 'say again', 'could you repeat that']
If the utterance matches one of these items the flow manager will repeat the question.
Related Articles
Filter by label (Content by label) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|