Value Creation with Custom GPTs - From Idea to Savings

Mike's Tech Deep Dive - 18th Edition

Hey all, it’s Mike from Artificial Antics! This week, I’m bringing you something special with Custom GPTs. Recently, I did a talk for a local meetup Detroit Tech Watch I co-host called: “Build Custom GPTs and Assistants with OpenAI”. I found there is a lot of interest in this subject.

If you’re unfamiliar, Custom GPTs allow users to discover and create custom versions of ChatGPT that combine instructions, extra knowledge, and any combination of skills (actions, instructions, capabilities).

Setting the Stage

During this post, we’ll walk through a contrived use case for a fictitious company (Half-Full Bottling, Inc.). Half-Full has been around since the earlier 1900s and is seeing a major influx in growth as craft breweries aim to extend their reach. Everyone at Half-Full Bottling, Inc. is excited about the growth it’s seeing. In turn, the company is scaling our their operations and support teams to support their wild growth and ensure that their customers still receive the same exceptional customer experience despite their teams having more to do.

The Problem

As Half-Full Bottling, Inc. grows it’s operations and support teams, the CX supervisors Zack and Linda are finding it nearly impossible to execute reliable QA for their agents. It was simple when they had 10 agents, they are now at nearly 30 agents and listening to every word on a phone call for every agent becomes tedious at scale; quality control slips.

The Solution

Half-Full Bottling, Inc. decides that they want to try augmenting their customer experience QA/QC workflows with AI/ML. Zack and Linda turn to their IT Director, McKay and ask if there’s anything he can do to automate parts of the QA cycle with ML? McKay, suggests creating a “Call Center Coach” of sorts to take some of them heavy lifting out of the work.

Some of the features McKay suggests utilizing are Speech-to-Text (transcription), Sentiment Analysis and OpenAI’s Custom GPTs to build the persona of a “Coach”.

IMPORTANT NOTES
1. Custom GPTs recently replaced ChatGPT "Plugins", plugins are no longer available.
2. A ChatGPT Plus, Team or Enterprise subscription is required to access Custom GPTs.

Getting Started

So with that, let’s start to walk through McKay’s solution. The first thing you’ll need to do is log into your ChatGPT account. Once you’ve done this, go to https://chat.openai.com/gpts to view all GPTs and click the “+ Create” button in the upper, right hand corner of the screen.

TIP
A shortcut is to go directly to https://chat.openai.com/gpts/editor which takes you right to the GPT creation/editor screen.

Once you’ve clicked “+ Create” you should see a screen like the one below. This is our starting point for the GPT.

To create a new GPT, you could simply enter prompts back and forth with the GPT Builder (see bottom, left of image above). However, for most use cases, I’ve found it more straight-forward to click the “Configure” button which then takes us to the view below.

Instructions

Instructions are used to customize how the GPT behaves and executes its tasks. Here's an example of the custom GPT instructions McKay used in the Half-Full CX Coach:

You are a helpful Call Center Coach that has 30 years of experience.

You are assessing calls for Half-Full Bottling, Inc. Customer Experience Team.

You have a very high level of emotional intelligence.

Your job is to read a transcript of a support call and fill in the "HF - Quality Assurance Template" and generate a CSV file for me to download.

IMPORTANT:
1. Always double check your work. In your knowledge there are examples of where you have done your job well and where you have not done this job so well. Use those knowledge examples as a guiding light.
2. Always use a temperature setting of 0.0

Your standard input:
- A URL, if a URL is input in the chat, go ahead and use Deepgram to transcribe the audio URL. When you call the Deepgram API to get then transcript, use these parameters: ?redact=pci&redact=ssn&redact=numbers&language=en&model=nova-2

Your output should ALWAYS be the following:
1. The names of the speakers
2. The sentiment of all parties
3. What the agent did great! 
4. A list of 3 examples where the AGENT demonstrated the "Half-Full Bottling, Inc. - Core Values", make sure to name the value the agent demonstrated in each of the 3 examples.
5. Define areas for improvement and set goals for future calls


Here’s an example of what McKay’s custom GPT would look like at this point, here we have the Name, Description and Instructions filled in:

IMPORTANT

Now is probably great time for McKay to save the first version of his GPT. If you’re following along, click that “+ Create” button again and you should be able to save your GPT.

Initial save point for the Custom GPT

Notice Access is Invite-Only, as you are working on your GPT, you likely don’t want to publish it to the world right away and may never want to publish it to everyone. OpenAI has some good settings for allowing access to only whom you choose.

Knowledge

Knowledge in custom GPT's are files that give your GPT a basis of knowledge to draw from. This knowledge can be used to guide the GPT's responses, provide examples, or help it understand the context of a conversation.

Some examples of knowledge in the Half-Full Bottling Company GPT:

IMPORTANT
Code Interpreter (explained below in Capabilities) should be enabled to analyze some types of files. For the sake of simplification, I suggest always turning this capability on.

Knowledge files can be very helpful in giving your GPT extra context. McKay uses these files to expand the knowledge for the Half-Full Bottling CX Coach and allow the coach to better to process the data and provide great outputs!

Capabilities

Capabilities add additional abilities to your GPT, at the moment, ChatGPT allows for Web Browsing, DALL-E Image Generation and Code Interpreter to be enabled.

Let’s take a quick look at these, one by one:

Web Browsing

Allows your GPT to browse the web. This allows the GPT data to transcend the knowledge it's been trained on and the knowledge it's been given via "Knowledge" uploads.

DALL-E Image Generation

Allows your GPT to generate images. This can be handy if you want the final output to include an image.

Code Interpreter

Allows your GPT to run code. When enabled, this GPT can analyze data, work with files you've uploaded, do math, and more.

Actions

OpenAI’s Capabilities are fantastic, but they don’t cover McKay’s requirement to transcribe an audio file. As a matter of fact, even if you add an audio file to a ChatGPT chat, it won’t transcribe it.

It’s not that OpenAI can’t transcribe the file, it’s that it’s programmed not to. Why you say? OpenAI and other services charge money to transcribe audio, and I believe this is one of the reasons it’s locked down in the ChatGPT interface (for now).

That’s cool though, McKay knows that he can use Actions to extend the Capabilities of the Custom GPT!

Spoiler Alert: It never does transcribe the file. It’s not that it can’t it’s that it’s programmed not to.

Actions allow GPTs to integrate external data or interact with the real-world, such as connecting GPTs to databases, plugging them into your emails, or making them your shopping assistant, all through APIs.

In this example app, McKay is going to use the Deepgram (deepgram.com) Speech-to-Text API to transcribe audio files. Later in the process, we’ll use ChatGPT directly to add some sentiment analysis and coaching.

Building Actions

Actions are defined using the OpenAPI specification (version 3), which is a standard for describing APIs.

QUICK NOTE

The OpenAPI specification is different than the company OpenAI even though they looks similar. To learn more about the OpenAPI specification, check out this site: https://swagger.io/specification/v3/

To get started, McKay click’s on the Create new Action button near the bottom of the Configure screen.

McKay knows he needs an OpenAPI spec here in the schema field. To generate, the schema, McKay uses a little trick…

McKay uses ChatGPT to take use API request and turn it into an OpenAPI 3.0 spec! Here's an example of what McKay entered into ChatGPT:

ChatGPT Prompt:
Build an OpenAPI 3.0 spec from this curl request. Make the output JSON

curl --location --request POST 'https://api.deepgram.com/v1/listen'
--header 'Authorization: Token <TOKEN_PLACEHOLDER>'
--header 'Content-Type: application/json'
--data-raw '{"url":"https://static.deepgram.com/examples/>en_NatGen_CallCenter_BethTom_CancelPhonePlan.wav"}'

Ensure the components / schemas exists

"components": { "schemas": {

The output should contain no comment blocks
ChatGPT Output:
{
  "openapi": "3.0.0",
  "info": {
    "title": "Deepgram API",
    "version": "1.0.0",
    "description": "API for processing audio transcription requests."
  },
  "servers": [
    {
      "url": "https://api.deepgram.com/v1"
    }
  ],
  "paths": {
    "/listen": {
      "post": {
        "summary": "Transcribe audio from a provided URL",
        "operationId": "transcribeAudio",
        "tags": ["Transcription"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudioTranscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful transcription",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AudioTranscriptionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AudioTranscriptionRequest": {
        "type": "object",
        "required": ["url"],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "URL of the audio file to transcribe."
          }
        }
      },
      "AudioTranscriptionResponse": {
        "type": "object",
        "properties": {
          "transcription": {
            "type": "string",
            "description": "Transcribed text from the audio file."
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization"
      }
    }
  }
}

Next, McKay is going to need to setup Authentication. McKay clicks on the “Authentication” field (anywhere on it) to open the configuration dialog.

For the Deepgram API, McKay needs to choose "API Key” as the Authentication Type, the Auth Type is “Custom” and the API Key is “Token <TOKEN_PLACEHOLDER>”.

Once McKay is finished, he clicks Save.

Lastly, for public GPTs (anything that will be used by anyone other than the author), a privacy policy is required to be linked. Here we link to Deepgram’s privacy policy with is accessible on the web: https://deepgram.com/privacy

The fully configured Action looks like this:

At this point, McKay has a fully configured custom GPT, let’s test it out!

Here’s the example audio call we’re testing with in the video.

The Half-Full CX Coach Output for the call above (also shown in the video):

Based on the transcription of the support call between Beth and Tom regarding the cancellation of a phone plan, here's the assessment using the HF - Quality Assurance Template:

### Names of the Speakers
- **Agent**: Tom
- **Customer**: Beth

### Sentiment of All Parties
- **Agent (Tom)**: Professional, patient
- **Customer (Beth)**: Initially frustrated, but becomes more understanding and appreciative towards the end

### What the Agent Did Great!
Tom did an excellent job in handling the call by maintaining a calm and professional demeanor throughout the interaction. He actively listened to Beth's concerns, provided clear information regarding the cancellation policy and fees, and empathetically addressed her situation by offering a solution that aligned with her needs. 

### Examples Demonstrating the "Half-Full Bottling, Inc. - Core Values"
1. **Empathy and Understanding**: Tom demonstrated empathy by acknowledging Beth's frustration with the cancellation fee and offering a solution that would benefit her, reflecting the core value of "Customer Centricity".
   
2. **Effective Communication**: By clearly explaining the reason behind the cancellation fee and the steps Beth could take to minimize her expenses, Tom showcased "Transparency", another core value.

3. **Problem-Solving**: Tom's initiative to offer a discounted service plan as an alternative to outright cancellation demonstrated "Innovation", as he found a creative solution to meet the customer's needs and retain her business.

### Areas for Improvement and Goals for Future Calls
- **Offer Options Sooner**: Tom could improve by offering alternative solutions or options earlier in the conversation. This proactive approach could help in alleviating customer concerns more quickly.
  
- **Enhance Personalization**: While Tom was empathetic, further personalizing the conversation by using the customer's name more frequently and relating more personally to her situation could enhance the customer experience.

- **Clarify Next Steps**: Ensuring that the customer is clear on the next steps and what is expected from them after the call could be emphasized more. This includes confirming understanding and agreement on the proposed solution.

This assessment highlights Tom's strong points in handling difficult customer interactions and provides constructive feedback aimed at enhancing the overall customer experience in future calls.

I want to sincerely thank folks for checking out my deep dive this week, I hope it helped you in some way. If you have questions, feel free to hit me up directly at [email protected] and with that, I’m looking forward to seeing you back in the lab soon!