App Connect

 View Only

Using IBM® App Connect to interact with IBM watsonx.ai

By Deepak Ayilliath posted Tue August 27, 2024 03:11 AM

  

IBM watsonx.ai is part of IBM's AI and data platform. It allows you to work with generative AI and traditional machine learning models, providing tools to build and refine models for your specific needs. It offers various models, including options from IBM, open-source models, and the ability to use your own.

Building a flow in IBM App Connect with IBM watsonx.ai

Use App Connect to build flows that integrate with IBM watsonx.ai and other applications. The connector is displayed as IBM watsonx.ai on the IBM App Connect User Interface (UI) and the IBM Automation Explorer UI. 

To allow App Connect to connect to your IBM watsonx.ai account, you need to fill in the connection fields that you see in the App Connect Designer Catalog page or flow editor.

Supported authorization types:

  • API KEY

For detailed information about different authorization types, a list of supported actions and events, how to generate connection field values, and how to use the Templates gallery, see How to use IBM App Connect with IBM watsonx.ai on the IBM Documentation webpage.

Supported objects in IBM watsonx.ai

Object Description
Email The Email object in IBM Watsonx.ai is a data structure used to represent an email message. You can use it to generate text content for email drafting.
Foundation models The Foundation models object in IBM Watsonx.ai is a pre-trained artificial intelligence (AI) model that serves as a foundation for building custom AI models. You can use the actions to retrieve a list of foundation models and the tasks supported by the models.
Sentiment analysis The Sentiment analysis object in IBM Watsonx.ai is a natural language processing (NLP) model that analyzes text to determine the sentiment or emotional tone behind it. It can identify whether the sentiment is positive, negative, or neutral, and provide a confidence score for the analysis.
Summary The Summary object in IBM Watsonx.ai is a natural language processing (NLP) model that condenses large amounts of text into a concise and meaningful summary. It uses advanced algorithms to identify the most important information and key points in the text and generates a summary that captures the main ideas and concepts
Text embeddings The Text embedding object in IBM Watsonx.ai is a natural language processing (NLP) model that converts text into a numerical representation, known as an embedding, that captures the semantic meaning and context of the text. This allows for efficient and effective comparison, clustering, and analysis of text data.
Text generation The Text generation object in IBM Watsonx.ai is a natural language processing (NLP) model that generates human-like text based on a given prompt, topic, or style. It uses advanced algorithms to predict and generate text that is coherent, contextually relevant, and engaging.
Tokenization

The Tokenization object in IBM Watsonx.ai is a natural language processing (NLP) model that breaks down text into individual words or tokens, such as words, phrases, or symbols. This process, known as tokenization, is a fundamental step in text analysis and is used to prepare text data for further processing and analysis.

 

Scenario 1: Summarize the open leads from Salesforce using IBM watsonx.ai and send an email 

Consider this scenario: When the flow is triggered, it detects new users in Salesforce, retrieves a list of leads based on certain criteria, and then sends the information to IBM watsonx.ai to be summarized. Finally, the user is notified through an email.

IBM watsonx.ai flow 1
The following steps are involved in the flow:
  1. The Scheduler node is customized to run the flow at a particular time daily.
  2. The Salesforce Retrieve users node retrieves a list of all new users added to Salesforce.
  3. The retrieved users are then iterated to check if the response status equals 200 (successful request).
  4. The Retrieve leads node in Salesforce is customized for the user to get leads with the following conditions.
    Filtering applied in Salesforce Retrieve leads node
  5. The retrieved leads are again iterated to check if the response status equals 200 (successful request).
  6. The IBM watsonx.ai Generate text node contains a custom prompt to generate a summary of the lead information that is retrieved from Salesforce.
    Note: You can choose to perform additional customizations in the IBM watsonx.ai node such as Minimum response tokens, Maximum response tokens, Time limit, and Return options using the Advanced mode setting of App Connect.
    IBM watsonx.ai Generate text node
  7. The generated summary is then shared over to a user using the Send email node in Gmail.
    Email sent to a user containing the summarized information of the leads

Scenario 2: Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx.ai

Consider this scenario: When the flow is triggered, it detects customers in Shopify from which contacts are created in the ClickSend contact list, and IBM watsonx.ai generates text for SMS campaigns targeting these contacts.

IBM watsonx.ai flow 2
The following steps are involved in the flow:
  1. The Scheduler node is customized to run the flow at particular time intervals based on seasonal offers or other reasons.
  2. The Shopify Retrieve customers node is used to retrieve the customer data, including the contact information of the customers.
  3. The Create contact list node in ClickSend is used to create a contact list with a suitable name.
  4. The Create contact in contact list node iterates through each of the customer data obtained from Shopify (name, email, and phone number) to create a contact in the contact list.
  5. The Generate text node in IBM watsonx.ai is used to generate meaningful and attractive campaign messages.
    For example:
    Campaign message generated by IBM watsonx.ai
  6. The ClickSend Create SMS campaign node is used to send out the generated campaign messages to all the contacts in the ClickSend contact list.

Useful resources

If you already have an App Connect designer instance ID, use the following URL to directly access the template or search for the template using its name in the templates gallery.

  • Summarize the open leads from Salesforce using IBM watsonx ai and send an email: https://<your-instance-id>/templates/Summarize%20the%20open%20leads%20from%20Salesforce%20using%20IBM%20watsonx%20ai%20and%20send%20an%20email
  • Send an SMS notification about upcoming offers for Shopify customers using text from IBM watsonx ai: https://<your-instance-id>/templates/Send%20an%20SMS%20notification%20about%20upcoming%20offers%20for%20Shopify%20customers%20using%20text%20from%20IBM%20watsonx%20ai

           Note: Replace <your-instance-id> in the URL with your custom instance ID.

You also have the option to import the .yaml file for this template directly into your App Connect Designer instance. These templates are available in a public GitHub repository.

#AppConnect#IBMwatsonx

0 comments
22 views

Permalink