Skip to main content

Gemini AI integration with Pega

What is Gemini AI?

Gemini AI, developed by Google, represents a family of large language models that currently stands as one of the most advanced AI models created by Google. Here's a brief overview:

Key Features:

1.MultiModal: Gemini seamlessly understands and responds across various formats such as text, code, images, and audio. This is a departure from most AI models that focus on a single modality.

2.Versatile: The Gemini AI family is available in three sizes - Ultra, Pro, and Nano - catering to a spectrum of tasks ranging from complex research to efficient on-device applications.

3.Safe: Gemini incorporates extensive safety checks to address concerns related to bias, toxicity, and other potential risks.

4.Accessible: Developers and businesses can access Gemini Pro through Google AI Studio (free) or Vertex AI (paid, offering more features).

Now, let's integrate this with Pega.

To integrate Gemini AI, access the developer console on the official Gemini AI website provided by Google.

The URL to access Google Gemini AI is Google Gemini AI

1.The following screen appears upon accessing the provided link.


2.Next, click on "Get API key" in Google AI Studio and proceed to accept all the terms and conditions.


3.Subsequently, click on "Continue," and then proceed to click on "Get API key."


4.Proceed by clicking on "Create API key" in the New Project.


5.After clicking on "Create API key" in the New Project, Google provides us with a new API key and a curl command. Now, let's test this curl command using Postman. (For those unfamiliar with Postman: Postman is an API platform for building and using APIs. It simplifies each step of the API lifecycle and streamlines collaboration, allowing you to create better APIs faster.)


5.1 Import the curl command into Postman, navigate to the "Params" tab, provide the API key given by Google, and then test the command using either your own parameters or those provided by Google to verify if the URL is functioning correctly or not.


6.Now, given that the response is successful, proceed to enter the Dev Studio and create a REST integration.

7.Now, create a REST integration in Connect REST using the provided URL as demonstrated below.


8.Click "Next" and choose POST as the method; by default, GET might be selected.


9.In the next tab, the data model tab, add the REST response using the JSON obtained in the initial step.


10.Click on "Create," and the Connect REST configuration is now created.

11.To utilize this Connect REST, create a section that includes three fields: one for the prompt, one button, and one text area.


12.Now, create an activity named "GetGemini10Response" and configure it on the button's on-click event.


13.Create an activity with the below steps as shown.




14.Now, let's create a case and observe the results.



Happy Learning :)

Comments

Popular posts from this blog

Understanding the Lock Mechanism in Pega

Now, let's delve into the Pega lock mechanism. To begin, Pega employs both database-level locks, which are of shorter durations (usually in milliseconds), and Pega-level locks, which extend over more extended periods (determined by user operations, often a few minutes). While you have the option to disable Pega-level locks using the Optimistic locking strategy (discussed later), database-level locks cannot be turned off; they are an integral part of the infrastructure layer. Moving forward, I'll elaborate on Pega-level locks. 1. Fundamentals of Pega-Level Locks When an individual initiates an assignment, the system transitions the state to "Perform" mode and acquires a lock. This lock data is then added to the "PR_SYS_LOCKS" table in the database, where it is systematically managed. Throughout this phase, no other user can access the same assignment. Upon the user's submission or cancellation of the assignment, the state shifts to "Review" mode...

Building a CSV File Download Function from a Page List

Consider a scenario where we want to download recently added table data from the screen into a CSV format for analysis. Today, we will explore how to accomplish this in Pega. An existing out-of-the-box activity named "pxConvertResultsToCSV" is available in the @baseclass, and you can utilize it without the need to create it from the ground up. The following example illustrates a sample screen: when the button is clicked, the Page List data on the screen is downloaded as a CSV file to the end user's local machine. 1.To begin, establish a Page List property. In this instance, I defined a Data class, "MyCo-Data-Item," and subsequently generated a Page List named "ItemList" in the Work class, referencing the Item class. 2.Position a table that references the Page List, and configure it to be inline-editable, allowing the addition of records directly from the screen. Additionally, position a button in close proximity to the table. 3.Configure the button by ...

How to set up JFrog Artifactory as a Repository in Pega.

Before delving into the topic, let's gain some understanding of what a repository is........... What is a repository? A repository is a centralized storage location where data, files, documents, or other digital assets are stored and managed. It serves as a single source of truth for organizing, versioning, and accessing these assets.  In the context of software development, a repository typically refers to a version control system, where developers store and manage source code, configuration files, documentation, and other project-related files. Version control systems like Git, Subversion (SVN), and Mercurial are commonly used repositories in software development. In addition to version control systems, repositories can also refer to databases, file systems, content management systems (CMS), or any other structured storage system used to manage digital assets. Overall, a repository provides a structured and organized way to store and manage digital assets, facilitating collaborat...