🎥 Create a low-code weather GPT

AI Training Tuesday is back with another video! In this article and video, I share how to create a low-code custom GPT.

🎥 Create a low-code weather GPT

As part of my ongoing series showing you how to create custom GPTs, I started with an article that describes the various types of customGPTs. In that article, I share that there are three primary types of custom GPTs: no-code, low-code, and full-code.

I also created a companion article and video that walks you through creating a custom GPT. In this article, I walk you through the steps to create a low-code GPT.

Video: Create a low-code weather GPT

A companion video that shows you how to create a low-code GPT on ChatGPT (or Microsoft Copilot)

Currently, ChatGPT does not know the weather; however, it can browse the web and get a weather report, but it may not be as consistent as you would prefer. In the U.S., there is a service by NOAA (the National Oceanic and Atmospheric Administration) called weather.gov.

That service provides the capability to access the weather using an API (or Application Programming Interface.) Nearly any app, website, or service you use today probably uses APIs, but unless you are a developer, you probably do not know about them.

Have you ever booked a restaurant reservation using an app but received a notice from OpenTable? That is because the app used OpenTable's APIs. Have you ever checked your email and witnessed a new one pop into your inbox? That is because your mail provider uses an API to get your email.

We will use the weather service to create our custom low-code GPT that accesses weather.gov's APIs. In the following video, I provide more descriptions and details about how the low-code solution works.


Dr. Deborah Chen provided editing services for this article.


📝 Transcription

Create a low-code GPT

Introduction to No-Code and Low-Code GPTs

[00:00:00] Bill Raymond: Hi, this is Bill Raymond. I showed you how to create a no-code GPT in a previous video. It's essentially a chatbot that allows you to converse with a document.

[00:00:11] In my example, I used a corporate leave policy document where an employee could come in and ask questions like how much time do I have off? And what are my vacation days?

[00:00:22] When you just upload a document for your GPT and allow people to have a discussion with that, that's called a no-code GPT because you're just uploading a document. You can also create a low-code GPT that accesses external websites to get more information.

[00:00:40] In our case, we're going to create a brand new low-code GPT that helps us with our travel planning, by getting the latest weather forecast, something that ChatGPT does not have all by itself. We have to go out to an external source to do that. And that's where the low-code part comes in. Let's get started!

[00:00:59] Just so you're aware I'm actually following along with some open AI documentation that's already provided on the website. I'm just creating it in video format so you can see what it looks like. Now I provide the link here on the screen. And of course it's down in the description as well.

Understanding APIs and Weather Data

[00:01:16] Bill Raymond: What our GPT is going to do is it's going to go out to an application programming interface or API.

[00:01:25] In this case, we're going to get the weather from this NOAA weather service that's that weather.gov. Now I want to point something out here while all of this website looks really fancy and you see all these images on the page, really what's happening in the background is all of this information is being collected out of a database.

[00:01:48] And that database access is through an application programming interface. So let's go to weather.gov here slash documentation, and then there's a Services Web API, and you can see that there's actually a whole lot of information that's provided here so you can create your own custom app that uses uses this information, nearly every app that you use today has an API.

[00:02:16] So, for example, let's say that you're using Salesforce. Maybe you want to get the list of your current customers. There's an API for that. Let's say you're using Trello and you want to get the list of your incomplete tasks. There's an API for that. So these are just examples, but we're going to get this from the weather service, because we don't need to do that much special in order to get the information.

[00:02:41] Let's think about how you and I communicate. I'm talking to you in U. S. English, which presumes that you will talk to me in U. S. English. By both of us doing that, we'll be able to understand each other. Now computers need a way to talk to each other as well. And there are many standards for how they do that depending on what you're trying to do. In the case of an API there is the OpenAPI schema. Now the weather. gov site has information related to that but ChatGPT does not know anything about it. So the nice people at OpenAI that created ChatGPT created a GPT to help us get that schema so that ChatGPT can talk to weather.gov.

Creating Actions in GPT

[00:03:27] Bill Raymond: So I'm going to come to the sidebar and choose, explore GPTs. And then I'm going to type ActionsGPT, one word. And press return. You'll see that that's probably going to be the first or very close to the first and it's ByChatGPT. So I'm going to go ahead and open this. And start a communication. You can see it, provides some examples here, but I'm going to copy some text and paste that into the prompt.

[00:03:59] What this is going to do is have ChatGPT go out to the weather.gov site and create a properly formatted OpenAPI schema that we can then use for an action in our GPT. If this isn't making a lot of sense yet, don't worry. You'll start to understand it as we continue down the creation of our GPT.

[00:04:24] There it's done! Now to see the whole thing, you can investigate this a little bit yourself and to make sure that it is done, you just come to the bottom and make sure that the code is separated with some descriptive text as to what happened. So let's scroll up to the top and I'll choose copy code. That will copy that into my clipboard. This is all we need to do with this ActionsGPT at this point in time. Now it's time to create our GPT.

Configuring and Testing the GPT

[00:04:53] Bill Raymond: So I'm going to go ahead and go to my icon at the top right of the screen, go to MyGPTs and Create a GPT.

[00:05:04] Before we chose the create option, and then we configured it. I'm going to do it the opposite way this time I'm going to configure it. I'm going to give it a name and call it Bill's Travel Planning GPT.

[00:05:19] And then for the description, I'll type A GPT that helps me plan for my trips. We're going to get to the instructions in just a little bit. What we really want to do is get that low-code custom GPT set up with the actions. So there's two things I'm going to do. One, I'm going to turn on the code interpreter and data analysis, which I don't know that I have to turn on, but I do turn that on. And then I choose create new action. The first thing that you'll notice here is the authentication option.

[00:05:53] And if I select that. You can see that there's ways to get this app to authenticate with the API. Now, in this case the weather.gov site is open. Anyone can send a request and get it back. You don't need to enter a username and password or anything along those lines. If you do need to set up security, then this is where you configure that. Now I'm going to go ahead and paste that schema, that open API schema and you'll see down here, there's two actions get point and then get grid point forecast. Again, these are things that the API requires.

[00:06:33] All we need to know really is that this get point is the latitude and longitude of where we want to get weather. And then get grid point forecast is sort of the general vicinity of that area so that we know what the weather looks like. Okay. So that's all we need right now. I'm going to scroll up to the top of this. And notice that there's two arrows I screw up sometimes.

[00:07:00] Then I choose the arrow at the top left. You want to scroll up and choose the second arrow that points left. So that we leave the actions, but stay in the configuration of our GPT. Now, what we need to do is give the instructions for what our GPT should do. So I'm going to go ahead and paste this in, but I'll walk you through it. Here's what we're doing is we're defining the instructions for how this GPT is going to work with some context, a user needs information related to a weather forecast or specific location. The instructions are to provide the latitude and longitude point for a general location such as New York city, the White House. And then provides the user the ability to get that information, use that API, and then respond. And then it's going over here and saying, here are some additional notes. So for example, it assumes that we're going to be using this in the U.S. So use Fahrenheit over Celsius, unless otherwise described and so on and so forth. Okay, but we don't have any conversation starters nor do we have a logo for our GPT.

Final Touches and Demonstration

[00:08:07] Bill Raymond: So let's go ahead and create the logo first. Create a logo for this GPT. There we go, it created a logo.

[00:08:15] Now as you can see on the left-hand side, I cleared the screen, but we have the logo, but no conversation starters underneath it to help get started. So let's go ahead and fix that right now. I'll say. Create some conversation starters that recommend some cities to visit so I can see the forecast. This looks good.

[00:08:47] Yeah. Yes. And then it's asking me if I want to update the behavior of this particular GPT. I'm going to say No.

[00:08:57] There! And now I have these conversations starters. How's the weather in New York city? What's the forecast for San Francisco? And so on. If I come over here to configure. I just want to make sure that my instructions are still as they were and they are, and we have the conversation starters. At this point, we're ready to go. So we'll either press the create or update icon at the top right. And then we'll go view the GPT.

[00:09:24] At this point, I can go ahead and try one of these conversation starters or type one out myself. I'm going to choose what's the forecast for San Francisco next week.

[00:09:34] Now you can see it starting our action. And the first thing it says is, is it okay that ChatGPT goes out to the weather.gov site and asks the question. So I'm going to allow that I could always allow it or I could decline access. So this is a security protection feature for us. I'm going to allow this. There there's our forecast. And as you can see, it says, expect mild and consistent temperatures with a mix of sunny and partly cloudy. Now, this is ChatGPT so anytime you ask it a question, you will usually get a slightly different response. So let's go ahead and ask the question again with another city. I'm going to come over here to the Bill's Travel Planning GPT over here on the left sidebar to start a brand new conversation. This time, I'm going to ask how the weather is in New York city. This time, it's asking about the weekend forecast.

[00:10:36] So notice that it's only going to provide me with probably Saturday and Sunday. Yes, Saturday and Sunday. There it is. But since ChatGPT went to the weather.org site and got the full forecast, I can still ask it what's the weather for Thursday and it won't have to go back out to the site. What is the weather for Thursday? Okay. Notice it.

[00:11:01] Didn't ask me to allow it access because it already has this information.

[00:11:07] Now let's do something fun. This is ChatGPT so I'm not limited to just doing what this action's asking me to do. Let's say that I also want to write a travel blog about this particular location on that day. So I can prepare by saying, create and image based on Thursday's report, but do not include text or numbers.

[00:11:41] Cool. I could also ask. What should I wear? This week. And now it's giving me information on what exactly to wear during each one of these days. Of course, I can make that decision myself as well, but this is giving me some good clues.

Conclusion and Call to Action

[00:12:02] Bill Raymond: I hope you found this video helpful. If you want to sign up for my newsletter, please use that QR code or go down to the description below to do that now. And of course it helps a lot for people to find this video if you press that Like and Subscribe button, and maybe even Comment on the video, if you have any other thoughts. Thank you so much for watching this video.

[00:12:25]