Gratis demo

Streamlining Social Media with OpenAI & SAPUI5

Ian van Eenennaam, 01 maart 2023

tech title

In today’s world, social media platforms have become an essential communication tool for businesses to engage with their customers and promote their products and services. However, managing the overwhelming influx of messages and comments can be a major challenge for companies of all sizes.

One of our customers faced this exact problem: they were struggling to keep up with the flood of social media messages and were finding it difficult to filter out those that required immediate attention to ensure customer satisfaction.

To address this issue, we developed a solution that combined the power of OpenAI’s text-davinci-003 language model with the SAP Cloud for Customer Social Media Activity API and SAPUI5. By leveraging these technologies, we were able to analyse incoming social media messages and generate a prioritized list of tasks for our customer. This list could then be used to manage their workflow, ensuring that the most important messages were addressed first, and nothing fell through the cracks.

In this blog post, I will share the details of how we built this solution, including the benefits gained by our customer through increased efficiency, improved response times, and better overall customer satisfaction.

Solution Flow

logic flow.drawio (2)
Figure 1: High level Solution Flow

As depicted above, the application flow starts with a call to the SAP Cloud for Customer API to retrieve the social media messages posted on the customer’s social media page. We then apply customer-defined conditions to filter the incoming message collection and narrow down the set of messages to be analysed.

Next, we send the filtered messages to the text-davinci-003 language model for analysis. The model assesses each message to determine if immediate action is required and suggests a course of action accordingly. Additionally, the text-davinci-003 model performs sentiment analysis on each message to inform task prioritization. The results of the AI model are then used to generate a prioritized task list.

Finally, the task list is displayed in the user interface of the application, which was built using the SAPUI5 framework. The user can interact with the task list and perform actions such as marking tasks as completed or dismissing them. The application periodically refreshes the task list based on new incoming messages, ensuring that the user always has an up-to-date view of the most important tasks to be addressed.

Overall, the application flow was designed to be simple, efficient, and effective. By leveraging the power of the SAP Cloud for Customer API, the text-davinci-003 language model, and the SAPUI5 framework, we were able to automate the process of social media management and help users prioritize their tasks more effectively.

Prompt Engineering

The OpenAI Playground provides an excellent interface for exploring the various models offered by OpenAI, and was a natural starting point to discover the capabilities of the text-davinci-003 model. The OpenAI playground allows for rapid testing of model prompts, and it quickly became clear that prompt engineering plays a crucial role in obtaining accurate and meaningful responses from the model.

Through our experimentation, we learned that the quality of the prompt can greatly influence the quality of the model’s response. Well-designed prompts can reduce the need for cumbersome string analysis logic as part of the application code, which in turn makes the application more efficient and easier to maintain. This highlights the importance of prompt engineering in building robust and effective applications using AI models.

Overall, the OpenAI Playground provided us with a powerful tool for testing and refining our use of the text-davinci-003 model and demonstrated the importance of prompt engineering in achieving the best possible results.

The image below gives an impression of the OpenAI playground interface and how it can be leveraged in designing prompts.

exploration openai text davinci 003 model
Figure 2: OpenAI Playground

SAP API Business Hub

During this project, the SAP API Business Hub proved to be an invaluable resource. This online platform, provided us with a wealth of information that made it easier to develop and integrate with SAP’s cloud-based solutions.

One of the key benefits of the SAP API Business Hub is the ability to easily find and access available APIs and related documentation. The platform provides a comprehensive list of APIs that are available from SAP, along with detailed documentation and examples of how to use each API.

In addition to the documentation, the SAP API Business Hub also provides a sandbox environment that allows developers to test the APIs in a safe and controlled manner. This is particularly useful during the early stages of development, when testing and validation are critical.

Another benefit of the SAP API Business Hub is the ability to generate code snippets that can be used as part of development efforts. These snippets provide a head start on the integration process and can save a significant amount of time and effort.

Sap api business hub
Figure 3: SAP API Business Hub

SAPUI5 Demo Apps

SAPUI5 demo apps are an excellent resource for developers looking to build prototypes and explore the capabilities of the SAPUI5 framework.

During our project, we found that the Bulletin Board demo app was particularly useful for early-stage prototyping. This app allowed us to quickly build a working prototype that showcased the capabilities of our solution, using data and APIs from the SAP API Business Hub.

By leveraging the Bulletin Board demo app as a starting point, we were able to save time and effort that would have otherwise been spent building the app from scratch. We were also able to get early feedback from our customer, who was able to see the direction of the solution and provide valuable input that helped us refine our approach.

The Solution

Below are some initial screens that were created based on the Bulletin Board demo app during the prototyping stage of our application. These screens provided a starting point for our development efforts and allowed us to quickly iterate and refine our approach based on customer feedback.

Figure 4: Prioritised Task List (Prototype)


task detail
Figure 5: Task detail page (prototype)

In conclusion, the application we developed using the text-davinci-3 model combined with the SAP Cloud for Customer social media activity API, SAP API Business Hub, and SAPUI5 has shown the tremendous benefits that can be gained from utilising advanced technologies to improve customer service processes.

By automating the filtering and prioritisation of customer messages using AI, the application allowed for more timely and efficient responses to customer complaints. This new level of focus and efficiency not only resulted in significant time savings for the company, but also improved customer satisfaction by ensuring that complaints were addressed more quickly and effectively.

Overall, the success of this project highlights the importance of leveraging cutting-edge technologies to better serve customers and drive business success. By continuing to explore new ways of incorporating AI and API technologies into customer service processes, we at Acorel can help ensure that companies stay ahead of the curve and deliver the best possible experiences for their customers.

Ian van Eenennaam

Read all my blogs

Receive our weekly blog by email?
Subscribe here: