Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
isChatRequest
isChatRequest
The bot provider stores the socket ID at msg.payload.originalRequest.socketId:

...

Code Block
languagejson
{
    "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
test-page
test-page
Test Page

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:

...