Render CEC Content Item with Images in Oracle Intelligent Bots

May 30, 2018 | 4 minute read
Derek Kam
Consulting Solutions Architect
Text Size 100%:

In one of the blog published by Dolf regarding Using CEC with Oracle Intelligent Bots, he demonstrated on how to use Oracle Intelligent Bots to retrieve the content items in CEC (Content and Experience Cloud Service) using the REST API. In this blog, I will extend this use case and provide a simple example of how to render the images and enable multilingual support in Oracle Intelligent Bots. For example, if you have some promotions or blogs stored in CEC as content items, instead of browsing a list of promotions, you can ask the bot to show you the “latest promotions” or search for a blog using the blog title.

The concepts, scripts, and information presented in this article are for educational purposes only. They are not supported by Oracle Development or Support and come with no guarantee or warrant for functionality in any environment other than the test system used to prepare this article. Before applying any changes presented in this article to your environment, you should thoroughly test to assess functionality and performance implications.

This blog also discusses the use of non-public Content SDK/API. The Content SDK/API might change without warning. The Content SDK/API might be published later as part of the Content & Experience Cloud.

In this demo, I will use the Oracle Intelligent Bots with Oracle ACCS (Application Container Cloud). However, you can use the custom components in AMCe (Oracle Autonomous Mobile Cloud Enterprise) to implement the custom code.

cecbot-1

We will use the System.CommonResponse components in Oracle Intelligent Bots to display content-rich messages/content from CEC.  With card type in common response component, you can display content item with images/video and provide a link to an external site.  The screenshots below demonstrate the chatbot flow logic and configuration to enable multilingual support and invoke an external component to search CEC using the REST API.

cecbot-2

To enable multilingual translation in Oracle Intelligent Bots, you need to select Google Translation Service.

cecbot-3

Next, you can move on to develop your custom component. You would need to include the SDK files from Oracle Intelligent Bots for this example, you can obtain SDK files from the sample in this link: http://www.oracle.com/technetwork/topics/cloud/downloads/mobile-suite-3636471.html

Before you invoke the CEC REST API, you need to retrieve the property value stored in Oracle Intelligent Bots by using the SDK.

cecbot-4

For this demo, we will use search the content item using the “type” field. So if you enter “Promotion”, it will invoke the CEC Content API using “field:type:equals:Promo” to retrieve all “Promo” content items.

cecbot-5

Below is the snippet of the custom NodeJS component to invoke CEC Content REST API to query the content items and item details.  Once we have the items details, we can format the message format required by the Oracle Intelligent Bots SDK.

cecbot-6

After you have deployed the custom component to either AMCe or ACCS, you need to configure the service URL in Oracle Intelligent Bots.

cecbot-7

 

Now, you can test your Oracle Intelligent Bots and CEC integration using the custom component deployed in ACCS.

cecbot-13cecbot-14cecbot-15

 

Few tips:

  • Build the output message format in your custom component code.

  • Limit the number of output characters per message. For example:

    • Facebook message text must be UTF-8 and has 2000 characters limit

    • Alexa Voice message must be less than 24576 bytes

  • Some bot clients will display the CEC content item rich text formatted field data with HTML tags, so you would need to store the text in a standard non-rich text format for the item to display properly in bot client.

  • Train and Test your intent confidence.

 

Derek Kam

Consulting Solutions Architect

Derek Kam is a Consulting Solutions Architect in the A-Team at Oracle Corporation. He works closely with customers and partners, worldwide, providing guidance on architecture, best practices, troubleshooting and how best to use Oracle Cloud Services and products to solve customer business needs. Derek is a multi-skilled IT professional with more than 26 years of experience, possessing a wide range of experience and expertise in the Oracle Fusion Middleware and Oracle Clouds (PaaS and IaaS) technical and architecture design, development, software testing and quality assurance, and project management. Prior to joining Oracle in 2012, Derek has worked in consulting, financial and retail industries.


Previous Post

Oracle Data Integrator Best Practices: Performing Incremental Updates in the Oracle Autonomous Data Warehouse Cloud

Benjamin Perez-Goytia | 5 min read

Next Post


Under the hood: Oracle Identity Cloud Service Audits

Tim Melander | 4 min read