Introducing the ChatGPT Weather Plugin: Bringing Real-Time Weather Data to Your Conversations! (2024)

Dustin Brown

Posted on

Introducing the ChatGPT Weather Plugin: Bringing Real-Time Weather Data to Your Conversations! (2) Introducing the ChatGPT Weather Plugin: Bringing Real-Time Weather Data to Your Conversations! (3) Introducing the ChatGPT Weather Plugin: Bringing Real-Time Weather Data to Your Conversations! (4) Introducing the ChatGPT Weather Plugin: Bringing Real-Time Weather Data to Your Conversations! (5) Introducing the ChatGPT Weather Plugin: Bringing Real-Time Weather Data to Your Conversations! (6)

#chatgpt #chatgptplugin #plugin #opensource

Are you tired of constantly switching between your chat application and weather websites just to check the forecast? We have the perfect solution for you! Introducing the ChatGPT Weather Plugin, a revolutionary addition to ChatGPT that seamlessly integrates real-time weather data into your conversations. With this plugin, you can now easily gather current weather conditions and forecasts for any location without leaving the chat interface.

All of the code for this working ChatGPT Plugin are available on GitHub

chatgpt-plugin-express-vue3-vite-starter
https://github.com/willCode2Surf/chatgpt-plugin-express-vue3-vite-starter

Endless Possibilities with ChatGPTPlugins

The ChatGPT Weather Plugin is a powerful tool that demonstrates the endless possibilities of what can be achieved with ChatGPT 4. By combining the capabilities of ChatGPT with real-world APIs, this plugin takes the basic TODO application to a whole new level
by providing it with real context.

Rapid Development withGithub

To bring this exciting plugin to life, we utilized the lightning-fast development capabilities of Vite, and Express.js from an existing repo template.

Getting Started with the ChatGPT WeatherPlugin

For this to work properly you will need the following:

  1. ChatGPT Plugin Developer Access; apply here if you do not have it yet: chatgpt-plugins
  2. OpenWeather API access for their Weather API. 1,000 FREE Calls a day is perfect. You will need an account and an API key. openweather
  3. Google Maps API access for their GeoLocation. You will need an account and an API key. Google Maps

This allowed us to quickly prototype a fully functional solution that can be easily customized and integrated with your existing ChatGPT application.

Once you have the prerequisites in place, follow these steps to set up the ChatGPT WeatherPlugin:

Clone the repo into your developemnt space

git clone git@github.com:willCode2Surf/chatgpt-plugin-express-vue3-vite-starter.git

Open the project with VS Code/Terminal and install dependencies

cd vue3-vite-express-js-boilerplatenpm install

Add .env file to the project

You will need to have a .env file that has 2 variables needed that are used in the application.

OPEN_WEATHER_KEY=YOUR_WEATHERKEYMAPS_KEY=YOUR_MAPS_KEY

Running the application stack

If you want to use the node application as a stand alone without Docker, we are ready. Running npm run start will do a couple things. It builds the SRC and PUBLIC directories into the DIST folder that is used for manifest validation.

npm run start

If you want to use Docker it is just as easy. There is a known issue with using Husky and Docker. Since Husky and Prettier are geared for developer experience we can remove it for when we need to build the docker image. Just remove this section from the package.json file (inside the scripts portion of package.json).

"prepare": "husky install"

Once that has been removed from the package.json file we can build the Docker image.

docker build -t chatgptweatherplugin:dev .

Once it is completed we can run the container image by executing the following docker command (the ENV variables that we have in our .env file will need to be passed to Docker at runtime as well):

docker run -d -p 6909:6909 chatgptweatherplugin:dev -e OPEN_WEATHER_KEY=YOUR_WEATHERKEY -e MAPS_KEY=YOUR_MAPS_KEY

Set up your GPT Plugin in the ChatGPT Plugin UI.
When prompted for Plugin that you created plug in:

http://localhost:6909

This application is intended to be headless as an API. We are using the existing boilerplate to place needed OpenAPI files and ChatGPT manifest.

Classes

In the folder /classes you will find a couple helpers to complete the requests in a clean, async manner.

Configuration

In the directory /config you will find the Configuration details that are binded to your environment variables for use throughout the application.

API Routes

In the directory /express-routes you will find the endpoints that ChatGPT will communicate with and that your OpenAPI file will define.

Public Resources

There are a couple very specific files in here that are necessary for the ChatGPT Plugin to work properly.

/public/.well-known/ai-plugin.json provides the manifest file for ChatGPT to understand the context it is working within. Referenced files in this manifest are also found here (logo, openapi.yaml)

{ "schema_version": "v1", "name_for_human": "WEATHER Plugin (no authorizations)", "name_for_model": "location", "description_for_human": "Plugin for gathering current weather conditions and forecasts for a given location.", "description_for_model": "Plugin for gathering current weather conditions and forecasts for a given location.", "auth": { "type": "none" }, "api": { "type": "openapi", "url": "http://localhost:6909/openapi.yaml", "is_user_authenticated": false }, "logo_url": "http://localhost:6909/logo.png", "contact_email": "support@example.com", "legal_info_url": "https://example.com/legal"}

/public/openapi.yaml defines the contraints around the API endpoints that ChatGPT can interact with.

openapi: 3.0.1info: title: Weather ChatGPT Plugin description: A plugin that allows the user to request current conditions and forecasts. version: "v1"servers: - url: http://localhost:6909paths: /routes/weather: post: operationId: getWeather summary: Get weather for a provided location requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/getWeatherRequest" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/getWeatherResponse" /routes/forecast: post: operationId: getForecast summary: Get forecast for a provided location requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/getForecastRequest" responses: "200": description: OK content: application/json: schema: $ref: "#/components/schemas/getForecastResponse"components: schemas: getWeatherRequest: type: object required: - 'location' properties: location: type: string description: The location's latitude and longitude to gather real time information for. required: true getForecastRequest: type: object required: - location properties: location: type: string description: The location's latitude and longitude to gather forecast information for. required: true getWeatherResponse: type: object properties: weather: type: array items: type: string description: The list of current weather statements. getForecastResponse: type: object properties: weather: type: array items: type: string description: The list of current forecast statements.

Let me know if there are any other neat ideas for starter kits around ChatGPT plugins that you would like top see.

Introducing the ChatGPT Weather Plugin: Bringing Real-Time Weather Data to Your Conversations! (2024)

FAQs

What is the weather plugin for ChatGPT? ›

WeatherGPT is a ChatGPT Plugin to get the weather of any given location. It can also make appropriate recommendations of what outfits to wear given the weather.

Can ChatGPT provide a weather forecast? ›

Yes, ChatGPT can create weather forecasts, but the real question will be their accuracy. People have started exploring how to use ChatGPT and other artificial intelligence methods to experiment with forecasts.

How do weather stations communicate weather data? ›

Overall, weather stations use a combination of advanced technology, such as AWS, weather balloons, radar, and satellites, along with traditional weather observations to communicate accurate and timely weather data for forecasting and monitoring purposes.

How do I fetch data from open weather? ›

Fetch the Weather with OpenWeatherMap API and JavaScript
  1. Create an OpenWeather account. To get started we need an account. ...
  2. Generate a Key. After sign up, a key automatically gets created for you. ...
  3. Endpoints. ...
  4. Fetch the Weather. ...
  5. Weather Markup. ...
  6. drawWeather. ...
  7. use drawWeather. ...
  8. <body> class swapping.

Where do I find the API key for weather? ›

Get a Weather API Key
  • Once you get confirmation that your account is active, log in.
  • After you log in to your OpenWeather account, click the API keys tab and copy your API key.
  • From Galaxy Watch Studio, click Edit > Preferences to open the Preferences window.
  • Click on APIs and paste in your API key. Tip :

How accurate is weather forecasting data? ›

The accuracy of weather predictions tends to decrease as the forecast period extends. The success rate for one-day forecasts is about 96-98%. It drops to about 90% for three-day forecasts. The more days in advance the forecast, the more likely it is that the weather will change.

How accurate is weather forecast temperature? ›

-Research has shown that a five-day forecast today is generally as accurate as a 24-hour forecast was in 1980. -We can usually forecast your next-day temperature within about 2 to 3 degrees of accuracy. For example, if your forecast high is 60 today, that means the high will usually land between 57 and 63 degrees.

What data goes into a weather forecast? ›

This is done by examining a large quantity of observation data including surface observations, satellite imagery, radar data, radiosonde data, upper-air data, wind profilers, aircraft observations, river gauges, and simply looking outside.

How to gather weather data? ›

Most weather data is collected by using thermometers to measure temperature, barometers to measure air pressure, radar to measure rain or snow locations and movements, wind vanes to measure wind directions, anemometers to measure wind speed, transmissometers to measure atmospheric visibility, and hygrometers to measure ...

What are the advantages and disadvantages of using automated weather stations? ›

Through their advanced sensors, data loggers, and communication systems, AWS provide accurate and real-time weather data. The benefits of using an Automated Weather Station include improved accuracy, cost-effectiveness, remote monitoring capabilities, and easy integration with other systems.

How does an automated weather station work? ›

An automated weather station is an integrated system of components that are used to measure, record, and often transmit weather parameters such as temperature, wind speed and direction, solar radiation, and precipitation. Weather stations are used on land and sea for a variety of operational and research purposes.

Is there any free API for weather? ›

Fortunately, there are many free weather APIs available and obtaining global weather data has become a rather easy task. These free weather APIs offer developers access to a lot of meteorological information. This allows them to integrate real-time and forecasted weather data into their applications with ease.

What is the best weather data API? ›

The top weather APIs in 2024 include Tomorrow.io, OpenWeatherMap, MeteoGroup, Weatherstack, Weatherbit, Weather2020, AerisWeather, Accuweather, and Visual Crossing. The all-around best Weather API for 2024 is Tomorrow. io's Weather API, offering 80+ data layers and a top-rated interface.

Where does Google pull weather data? ›

National Oceanic and Atmospheric Administration (NOAA) National Weather Service. Met Office.

What is the weather routing plugin? ›

Weather Routing plugin creates optimized weather routes using isochrone method and predictive grib data or averaged gridded climate data based upon constraint settings, start and finish information, and boat performance, calculated using boat specs or polar data.

How do I get a weather underground API key? ›

Getting a Weather Underground (WU) API Key Print
  1. Step 1: Create your WU account. Go to https://www.wunderground.com/signup and create a WU account.
  2. Step 2: Create a PWS station. ...
  3. Step 3: Create API key. ...
  4. Step 4: Finding PWS stations near you.
Jul 21, 2024

How do I set the weather command? ›

You can use the /weather command to change between weather cycles at any time (clear, rain, thunder or snow) for a Minecraft world.

How do I install a weather widget? ›

How to add the weather app to your Android home screen
  1. Access the Widget menu: Long press on an empty space on your home screen.
  2. Find the Weather widget: Scroll through the available widgets until you find one for your weather app.
  3. Add the widget to your home screen: ...
  4. Resize the widget:
Jun 1, 2024

Top Articles
Latest Posts
Article information

Author: Laurine Ryan

Last Updated:

Views: 6323

Rating: 4.7 / 5 (77 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Laurine Ryan

Birthday: 1994-12-23

Address: Suite 751 871 Lissette Throughway, West Kittie, NH 41603

Phone: +2366831109631

Job: Sales Producer

Hobby: Creative writing, Motor sports, Do it yourself, Skateboarding, Coffee roasting, Calligraphy, Stand-up comedy

Introduction: My name is Laurine Ryan, I am a adorable, fair, graceful, spotless, gorgeous, homely, cooperative person who loves writing and wants to share my knowledge and understanding with you.