Monday, December 10, 2018

APEX plugin for Digital Assistant

In one of my first posts about chatbots with Oracle Digital Assistant i managed to get the assistant embedded in my APEX application, using the OMCe Bots Client SDK for JavaScript. But the first step is to configure the javascript SDK for your environment. I finally managed to configure this in a more flexible way, and now it can be used with my region plugin for Oracle Application Express.


The Digital Assistant plugin for APEX


Above a screenshot of the plugin from my plugin demo application. In the lower right corner the widget for communicating with your digital assistant is displayed. The plugin will load all the additional javascript and css files of the javascript client sdk and initializes the widget. For setup some additional custom attributes are defined for the plugin, allowing you to set the web channel app-id for example.

Users can interact with your digital assistant by clicking the widget-button in the lower right corner and a chat window will open, like shown below



How to setup the Digital Assistant Plugin?


The plugin offers some custom attributes to configure the widget. The image on the right shows the region attributes settings of this region plugin. Required settings are the attributes appId and name. The name is to display your assistants name in the widget,like above example 'APEX Digital Assistant'. The appId is the unique reference to your Oracle Digital Assistant web channel configuration.

Further are some optional configuration attributes, like showing a logo or avatar image, change the buttonIcon of the widget. A reference to the apex item containing the username can be given in attribute user, so the digital assistant can use this for a little personal touch.

There are three attributes with a JSON string as format, userProperties, customText and customColors. These are used by the javascript client SDK to setup system messages and colors to use in the chat window.

The last three attributes are simply Yes or No setting to enableSound notifications from the chat window, playing a sound when a new message is received. Also you can choose to clear the local cache with chat history on every page load. and there is a setting to enable image and document upload feature for the chat window, which will allow the user to upload documents to Oracle Digital Assistant for further processing.

The list of attributes are described in more detail in my plugin demo application, together with some example json strings for customText and customColors. I also added this in the plugin as help and example text but somehow i can't find out when this is being displayed by the apex builder.

An additional note about the appId, this can be found in Oracle Digital Assistant web channel configuration, like shown below:


The plugin is available in my github repository and i will also make this available on apex.world.

No comments:

Post a Comment