Skip to content

satyadevshetty/ChatGPT-SQLQueryGenerator

Repository files navigation

Generate SQL queries using Generative AI built with Python and Streamlit

Tech Stack 💻

  • Python
  • Streamlit
  • OpenAI GPT3

Demo 👇

v.0.0.1 - (Sample SQL Schema & Query : customers & orders)

Set-Up ⚒️

SetUp Icon

  • Ensure you have the latest stable version of Python in your system

  • Open your terminal / command prompt.

  • Clone the repository

    git clone https://github.com/satyadevshetty/ChatGPT-SQLQueryGenerator.git
    
  • Change the directory to the cloned project

    cd ChatGPT-SQLQueryGenerator
    
  • Create a virtual environment

    python -m venv env
    
  • Activate the virtual environment

    • Windows

       env/Scripts/Activate.ps1
      
    • Linux/Mac

      source env/bin/activate
      
  • Check if the virtual environment in the concerned repository is used for python shell

    which python
    
  • Upgrage pip package manager

    python -m pip install --upgrade pip
    
  • Install the dependencies

    pip install -r requirements.txt
    
  • Sign Up for OpenAI API, Go to Settings and Get the API Key

  • Load the application

    streamlit run ./Home.py
    
  • If the app does not load by itself in your default browser, open a browser of your choice and navigate to http://localhost:8501

  • To stop the application, press CTRL + C in your terminal

  • To deactive the python environment, type in your terminal

    deactivate
    

Acknowledgements 🙏

About

Use LLM (ChatGPT) to generate SQL queries - provide database schema to get more accurate queries

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published