Web application interface for USGS water data access using OpenAI GPT-3.5
Chat interface featuring Gradio front-end that allows users to request real-time hydrometeorological condtions through the USGS Water Data for the Nation platform. Designed to allow plain language requests for water conditions (water levels, discharge, water quality), air temperature, precipitation, and windspeed. Requests are parsed using the OpenAI GPT-3.5 Language Model and return results based on specified location and time frame.
- Sign up for an OpenAI account
- Create secret API Key and save to device
Clone repository to your device:
git clone https://github.com/pcoddo/ChatUSGS.git
Install required packages using pip or environment manager:
pip install gradio
conda install -c conda-forge gradio
Python version 3.9+
Packages:
- argparse
- gradio
- pandas
- pickle
- urllib
- requests
Insert your private key on Line 26 in backend.py
Navigate to ChatUSGS directory:
cd path\to\ChatUSGS
Run app.py
script using command line or Python IDE:
Click local URL to open app in browser:
In chat window, enter your prompt. GPT-3.5 will attempt to parse requests for observation of interest (e.g. flooding, water quality, weather), location, and time period. Example prompts and outputs are as follows:
Outputs are passed to the USGS Graph Image API. Requests for data are currently limited to the following USGS parameters:
Parameter | Unit | Code |
---|---|---|
Gage Height | Feet | 00065 |
Air Temperature | Degree Fahrenheit | 00021 |
Dissolved Oxygen | Milligrams per Liter | 00030 |
Wind Speed | Miles per Hour | 00035 |
Precipitation | Inches | 00045 |
Streamflow | Cubic Feet per Second | 00060 |
Contact: Perry Oddo