Skip to content

Web application interface for USGS water data access using OpenAI GPT-3.5

License

Notifications You must be signed in to change notification settings

pcoddo/ChatUSGS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Header

ChatUSGS

Web application interface for USGS water data access using OpenAI GPT-3.5

GitHub last commit


About

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.

Installation

OpenAI Setup:

  1. Sign up for an OpenAI account
  2. Create secret API Key and save to device

Code Installation

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

Dependencies

Python version 3.9+

Packages:

  • argparse
  • gradio
  • pandas
  • pickle
  • urllib
  • requests

Usage

Update code with OpenAI API Key

Insert your private key on Line 26 in backend.py

Running script

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

License

MIT License

Questions?

Contact: Perry Oddo

(Back to top)

About

Web application interface for USGS water data access using OpenAI GPT-3.5

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages