ChatGPT + Enterprise Data: The Next Generation of AI-Powered Customer Service

ChatGPT is an OpenAI large language model that may be used for generating text, translate languages, compose various types of creative material, and provide helpful answers to your questions. ChatGPT may be used to build a range of AI-powered customer service apps when combined with enterprise data.

ChatGPT + Enterprise data with Azure OpenAI and Cognitive Search

This sample shows how to use the Retrieval Augmented Generation pattern to create ChatGPT-like experiences over your own data. It makes use of Azure OpenAI Service to connect to the ChatGPT model (gpt-35-turbo) and Azure Cognitive Search to index and retrieve data.

The repo includes example data, so you may try it from beginning to end. We utilize a fictitious company named Contoso Electronics in our sample application, and the experience allows its workers to ask questions regarding benefits, internal policies, and job descriptions and positions.

Chatgpt
ChatGPT + Enterprise Data: The Next Generation of AI-Powered Customer Service 1

Features

  • Interactions for chat and Q&A
  • Investigates several possibilities for assisting users in determining the credibility of replies through citations, source material monitoring, and so on.
  • Shows methodologies for data preparation, quick creation, and orchestration of model (ChatGPT) and retriever (Cognitive Search) interaction.
  • To adjust the functionality and experiment with options, use the settings directly in the UX.
Chatgpt
ChatGPT + Enterprise Data: The Next Generation of AI-Powered Customer Service 2

Azure Resource Costs and Configuration

IMPORTANT: In order to deploy and run this example, you must have an Azure subscription with Azure OpenAI service access enabled. You can request access by clicking here. You may also obtain some free Azure credits here to get started.

COSTS OF AZURE RESOURCES By default, this example will establish Azure App Service and Azure Cognitive Search resources with monthly costs, as well as Form Recognizer resources with per-document-page costs. You can avoid this cost by changing the parameters file in the infra folder (though there are some limitations to consider; for example, you can only have one free Cognitive Search resource per subscription, and the free Form Recognizer resource only analyzes the first two pages of each document).

See also  Remini App – How It Works with Your Old Photos and Videos

Prerequisites for Local Deployment

To run the project locally, you will need the following prerequisites:

  1. Azure Developer CLI
  2. Python 3+
    • Important: Python and the pip package manager must be in the PATH environment variable in Windows for the setup scripts to work.
    • Important: Ensure you can run python -version from the console. On Ubuntu, you might need to run sudo apt install python-is-python3 to link python to python3.
  3. Node.js
  4. Git
  5. PowerShell 7+ (pwsh) – For Windows users only.
    • Important: Ensure you can run pwsh.exe from a PowerShell command. If this fails, you likely need to upgrade PowerShell.

Note: Your Azure account must have Microsoft.Authorization/roleAssignments/write permissions, such as User Access Administrator or Owner.

Installation and Project Initialization

  1. Create a new folder and switch to it in the terminal.
  2. Run the command azd auth login to authenticate with your Azure account.
  3. Run the command azd init -t azure-search-openai-demo to initialize the project using the provided template.
    • For the target location, the regions currently supporting the models used in this sample are East US or South-Central US. You can check for an up-to-date list of regions and models here.
  4. Starting from scratch:
    • If you don’t have any pre-existing Azure services and want to start from a fresh deployment, execute the following command:
      • Run azd up – This will provision Azure resources and deploy the sample application to those resources, including building the search index based on the files found in the ./data folder.
  5. After the application has been successfully deployed, you will see a URL printed to the console. Click on that URL to interact with the application in your browser.
See also  Top 100 AI Tools You Can’t Ignore (Ultimate list 2023)
Deploying Services
ChatGPT + Enterprise Data: The Next Generation of AI-Powered Customer Service 3

Note: It may take a minute for the application to be fully deployed. If you see a “Python Developer” welcome screen, wait a minute and refresh the page.

Using Existing Resources:

If you want to use existing resources instead of creating new ones, follow these steps:

  1. To change the name of an existing OpenAI service, use the command azd env set AZURE_OPENAI_SERVICE {Name of existing OpenAI service}.
  2. To set the name of the existing resource group where the OpenAI service is provisioned, use the command azd env set AZURE_OPENAI_RESOURCE_GROUP {Name of existing resource group}
  3. If your ChatGPT deployment is not the default ‘chat,’ use the command azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT {Name of existing ChatGPT deployment}.
  4. If your GPT deployment is not the default ‘davinci,’ use the command azd env set AZURE_OPENAI_GPT_DEPLOYMENT {Name of existing GPT deployment}
  5. Run the command azd up to deploy or re-deploy the repository’s local clone utilizing the existing resources.

Note: If you want to use existing Search and Storage Accounts, refer to the ./infra/main.parameters.json file for a list of environment variables to pass to azd env set in order to configure those existing resources.

Running Locally:

To run the project locally, follow these steps:

  1. Run the command azd login to authenticate with your Azure account.
  2. Change the directory to the app folder.
  3. Run ./start.ps1 or ./start.sh or use the “VS Code Task: Start App” command to start the project locally.

Sharing Environments:

If you want to share a completely deployed and existing environment with someone else, follow these steps:

  1. They must install the Azure CLI on their computer.
  2. To start the project on their system, use azd init -t azure-search-openai-demo
  3. Use the command azd env refresh -e {environment name} to refresh the environment. To run this command, they will need the azd environment name, subscription Id, and location. These values are contained in the./azure/{env name}/.env file. This script will populate the.env file in their azd environment with the settings required to execute the app locally.
  4. Execute pwsh ./scripts/roles.ps1. This will provide the user all of the required roles, allowing them to operate the app locally. You may need to execute this script for them if they do not have the appropriate rights to establish roles in the subscription. Set the AZURE_PRINCIPAL_ID environment variable in the azd.env file or in the current shell to their Azure ID, which they may acquire by running az account show.
See also  Threads NSFW Policy – Does Threads allow NSFW

Getting Started with the Application:

To get started with the application:

In Azure:

  1. Navigate to the Azure WebApp that azd has deployed. You may discover the URL written out after azd finishes (as “Endpoint”) or on the Azure portal.

Running locally:

  1. Navigate to 127.0.0.1:5000 in your web browser.

Once you’re in the web app:

  1. Experiment with different themes in the conversation or Q&A setting. Experiment with follow-up questions, clarification requests, and requests to simplify or expound on replies in chat.
  2. Investigate the citations and sources for the generated replies.
  3. Click “settings” to experiment with different choices, customize prompts, and discover new features.

Also Read: How to Upload a Document to ChatGPT

This article is to help you learn the ChatGPT + Enterprise Data. We trust that it has been helpful to you. Please feel free to share your thoughts and feedback in the comment section below.