logo

NJP

How to build ServiceNow user interface (Virtual Agent) on the portal to chat with Chat GPT

Import · Sep 03, 2023 · article

The purpose of this blog is to show how to build the ChatGPT interface on ServiceNow Employee Center portal so the end user can directly chat with the ChatGPT from ServiceNow portal without going to the ChatGPT site.

Use Case: a user can ask any question in real time through ServiceNow ChatGPT portal interface and then ChatGPT shall provide its answer in real time.

High Level Design

JohnZhang1_0-1693589192125.png

Technical Approach 1 (See above design)

  • Create outbound REST integration with ChatGPT
  • Create the Virtual Agent flow with the Action script to perform REST integration
  • Configure the Virtual Agent in Employee Center Pro (ECP)

Technical Approach 2 (See above design)

  • Create outbound REST integration with ChatGPT
  • Create the Flow Action to perform REST integration in Action Designer
  • Create the Virtual Agent flow to call the Flow Action
  • Configure the Virtual Agent in Employee Center Pro (ECP)

Approach one Implementation Steps

Create REST message record by ChatGPT endpoint

  • JohnZhang1_0-1693659178831.png

Create POST REST method variables

JohnZhang1_1-1693659508867.png

HTTP configuration

JohnZhang1_2-1693659721415.png

  • Create the Virtual Agent Flow with the action script

Step 1 - create user input with the script for user prompt

  • JohnZhang1_3-1693660349375.png

Step 2 - create the action script to perform REST *integration

  • JohnZhang1_4-1693660940913.png

Step 3 - create the response to hold ChatGPT's answer

  • JohnZhang1_2-1693661928889.png

Approach two Implementation Steps

  • Collecting ChatGPT REST integration required information - Repeat step 1 in Approach one
  • Create ServiceNow outbound REST message - Repeat step 1 in Approach one.
  • Create the Flow Action to call REST message in Action Designer -you need to complete 4 steps blow

JohnZhang1_0-1693688714983.png

  • Create the Action in Virtual Agent to configure the Flow action created above steps

JohnZhang1_2-1693707769155.png

  • Configure the Virtual Agent in Employee Center Pro (ECP)
  • Demo

JohnZhang1_0-1693707630129.png

JohnZhang1_1-1693707702250.png

Summary

An end user can access ChatGPT from ServiceNow virtual agent on Employee Center Pro (ECP) in real time to ask any question and get its answer. ServiceNow REST integration; Flow designer, Virtual agent and User interface of ESP are ServiceNow features are used for this use case.

References:

Please mark my blog helpful if you lean something form this blog.

View original source

https://www.servicenow.com/community/in-other-news/how-to-build-servicenow-user-interface-virtual-agent-on-the/ba-p/2659063