The Chatbot module adds a standard V3 chatbot implementation and test page to a project.
Table of Contents |
---|
Dependencies
The Chatbot module is dependent on the following modules:
Methods
render
Used to allow other modules to render the default chatbot test page.
...
Returns: Nothing, the response is handled directly by this method.
Implementation Notes
Translation
The Chatbot module translates input and output when the request language is something other than the default language of English. If a language is specified in session (msg.payload.session.language) it will use that, otherwise it will detect the appropriate language using the Translation module (detectLanguage).
Custom Data
The Chatbot module will automatically carry through any query string parameters as custom data and make it available in the original request data payload in Orbita.
Chat Transcript Capturing
Set chatbot.enableTranscripts in the settings content to enable chat transcript capturing.
Bot Provider Node
Anchor | ||||
---|---|---|---|---|
|
...
Code Block | ||
---|---|---|
| ||
{ "languageCode": "en-US", "ssmlGender": "FEMALE", "name": "en-US-Standard-C", "audioEncoding": "MP3" } |
Event Type Filtering
Only socket events of type “request” will be passed through to the Bot Provider node.
Error Logging
Any errors from the provider node will be logged as follows:
DEADLINE_EXCEEDED errors will be logged as an error of type “Timeout” with an indication as to what the user query was.
Queries that exceed the Dialogflow length limit will be recorded as an error of type “Invalid Query” with an indication of the user query that caused the issue.
Other errors will be recorded as an error of type “Dialogflow” with an indication of the user query and the error message returned (if any).
Anchor | ||||
---|---|---|---|---|
|
The Chatbot module establishes a simple test page using the default settings at:
...
If the environment is non-production, chat-core.js will be referenced directly by the test page. On production, chat.js will be referenced.
Cross Domain Testing Endpoints
The Chatbot module also establishes endpoints for easy testing via the Cross Domain Testing Page:
...
The bypassCdn parameter will automatically be set to true for non-production environments.
Included Example Chatbot Settings
Outreach
The Outreach chatbot settings presents a full page and centered view of the chatbot, as an example of an approach for presenting the chatbot to users being contacted as part of an Orbita Outreach campaign:
...