Step-by-step process for integrating ChatGPT with ServiceNow virtual agent

Step-by-step process for integrating ChatGPT with ServiceNow virtual agent

1. ChatGPT API Configuration:

  1. Log in to the “OpenAI” platform to get the secret key. login using a mail ID that is never used in the ChatGPT (it should be a new mail ID to the ChatGPT).

2. This is the home page after logging in, and on the left side, there is a lock symbol that is used to create a secret API key.

3. Navigate to the “API Keys” option create a key using the “Create new secret key” button.

4. Click the “Create new secret key” button, A popup will be displayed with Name and project fields. Fill in the necessary information (name and project) and submit the form using “Create secret key” button

5. Copy the key and save it somewhere because the key won't be visible to us later, click the “Done” button to save.

6. Navigate to the “Docs” options and see the API Reference for a chat

7. The left-side top corner has the option to “API reference.” Click and review the API.

8. Select Chat option to get the endpoint and other required parameters for chatintegration

2. Create a Rest Message (ServiceNow Instance Configuration)

1. Create a new rest message with the endpoints taken from the chatGPT portal.

Endpoint for chat integration: (https://api.openai.com/v1/completions)

2. Create a new HTTP POST method for creating the chat with ChatGPT, by clicking the “New” button in the HTTP method-related list.

In the field, Name should give the name of the http method, and the http method should be "POST”. Paste the endpoint of the ChatGPT in the endpoint field. Don’t do anything in the Authentication tab, The Authentication type should remain the “Inherit from parent” option.

3. Navigate to the HTTP Request tab, and in the Http headers section add the two things,

?????? ???? 1. Authorization: Bearer <OpenAI Secret Key>

? ???? ??????(For example - Bearer 2vs9IXHIJ17PVDKT3B1bkFJfffcXsnf6swkRjqnaRKc).

?????? ???? 2. Content-Type: application/json.

4. Add content as defined below under the “HTTP Query Parameter” section

Content : {

?????? "model":"gpt-3.5-turbo-instruct",

?????? "prompt":"What is ServiceNow?",

?????? "temperature":0.7,

?????? "max_tokens":1024

?????? }

5. By clicking the “Test” related link, you can see the result of the integration.

?? (If the HTTP status code is 200 means successful, and if the HTTP status code is other than 200, it is considered as error).

12. You can see the result after clicking the “Test” related link and also you can see the result whenever you want by clicking the “Test Runs” related list.

13. Copy the script from the related link by clicking the “Preview Script Usage” option.

3. Create a Virtual Agent Topic for integration with ChatGPT

1. Create a new topic for integration using "designer"

2. Under the “User Input” section, choose the “Text” option to get the question or query from the user.

3. Under the “Bot Response” section, click and drag the “Script Response” option into the designer and paste the script, which was copied from "rest message".

4. While pasting the script here, give the user input into the question parameter.

(By using – vaInputs.enter_the_query) to pass the question.

5. Ask if the user that received the information is useful or needs to transfer it to a live agent. Under “user input", choose the “Static choice input” option.

6. Add the decision option to the designer to check whether the user needs to transfer the live agent or not.

7. Add the choice option again to check if the user has any other queries (if the user clicks “no” in the above option).

8. If the user selects “no," end the conversation, and “yes” means again looping to the “Enter the query” field.

9. If the user selects yes, there is a need to add the “Topic Block” option under the utilities section. (Choose the topics block – Transfer to Live Agent.).

10. After completing the flow, save and publish the topic.

11. Test the topic by clicking the “Test” button, or it can be tested directly in the portal.

4. Testing

  1. Navigate to the Service portal and go to the Chat and it will list down the list of topics that are published


2. You can enter your question or query in the text area.

3. It will return the answer and also ask the user whether the received information is useful or not and needs to transfer to the live agent.

4. If the user clicks “Yes”, it will navigate to the live agent.

5. If the user selects “No”. it will again ask that another choice.

6. It shows the “Any other queries to proceed?” choice when the user selects “No”.

7. If the user selects “No” the conversation ends and the user selects “Yes” then again to “Enter the query”.

(Here, select the “Yes” option, so it will again ask the “Enter your query)”

8. If the user selects, “No” for any other query choice then it will end the conversation.


Content credits go to Sanjeev M S

要查看或添加评论,请登录

NATLEX Technologies | ServiceNow Partner的更多文章

社区洞察

其他会员也浏览了