Code Monkey home page Code Monkey logo

chatusgs's Introduction

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)

chatusgs's People

Contributors

pcoddo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.