Professional Documents
Culture Documents
Pega Integration With Chatgpt
Pega Integration With Chatgpt
Implementation
Requirement:
Steps:
Step 1: Sign up on to Open Ai and go to Documentation
Link: https://openai.com/api/
Step 2: Select a model and Endpoint URL
Here we are Selecting the below end point URL
Url: POST https://api.openai.com/v1/completions
Model: Completion
Documentation Url:
https://platform.openai.com/docs/api-reference/completions
Step 3: Open postman paste the below URL
https://api.openai.com/v1/completions
Select Post Method
Step 5: Click on the Send button in postman if all the steps are good
We get a 200 status with Response as below
Response:
{
"id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
"object": "text_completion",
"created": 1589478378,
"model": "text-davinci-003",
"choices": [
{
"text": "\n\nThis is indeed a test",
"index": 0,
"logprobs": null,
"finish_reason": "length"
}
],
"usage": {
"prompt_tokens": 5,
"completion_tokens": 7,
"total_tokens": 12
}
}
Now We Have to Integrate the Api with Pega Using Connect Rest:
Steps
Step 1: log into Pega and go to Dev portal
Step 2: Open the Connector Rest integration wizard
By clicking on Configure—integration—connectors—Create Rest integration
Step 3: Add Name of the Connector and Endpoint URL and the Two Headers
Step 6: Click next and in the 3rd, screen Click on Add Rest Response and test the
connection
By providing the Request payload and check the response try to get
Status: 200
Request:
Response:
Step 7: Click on next and Create the Connector by click Create on the Next Screen.
Step 8: Now We need to Create the Ui screens and Add the Connector logic to the Ui
Using an activity.
Step 9: Create a case type and add a Stage (Any name) and add a step to configure the
view using a Section
Step 10: Create a Section with the Request and Response and a Button
Step 11: All set now the joining link is the activity.
------------------------------Integration
complete----------------------------------------
Important Note:
------------------------------End-----------------------------
https://www.linkedin.com/in/bibhash-kalita-b477aa9b/