GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jarvislin94/NaturalSQL: A demo to use natural language to query SQLite DB

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
db
db
 
 
docs
docs
 
 
src
src
 
 
utils
utils
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

NaturalSQL

A demo to using natural language to query SQLite DB

About

This repository contains code that combines SQLite querying with OpenAI's GPT-3.5-turbo language model. The code allows users to interact with a SQLite database using natural language queries through a chat-like interface.

Features

  • Connects to a SQLite database (chinook.db) using the sqlite3 library.
  • Utilizes OpenAI's GPT-3.5-turbo language model for natural language processing.
  • Supports querying the database by generating SQL queries based on natural language.
  • Retrieves table and column information from the database to assist with query generation.
  • Allows users to ask questions about the music database and receive SQL query responses.

Installation

  1. Clone this repository to your local machine:

    git clone [email protected]:JackZong/NaturalSQL.git
  2. Install the necessary dependencies:

    yarn install
  3. Configure the API key and base path by editing the config.json file:

    {
      "apiKey": "<your_open_ai_api_key>",
      "basePath": "<base_path>",
      // if you are using rapid open ai APIs, this demo based on Rapid API's open ai APIs
      "rapidApiKey": "<your_rapid_api_key>",
      "rapidHost": "<rapid_host>"
    }

Usage

  1. Ensure that the SQLite database (chinook.db) is located in the ./db directory.

  2. Start the application:

    yarn start
  3. The application will connect to the database and retrieve the table and column information.

  4. The application will use OpenAI's GPT-3.5-turbo language model to generate an SQL query based on the hard-code natural language.

  5. The SQL query will be executed against the SQLite database, and the results will be displayed in the console.

Example

example

TODO

  • Supports to send message based on user inputs.

License

This project is licensed under the MIT License.

Acknowledgments

  • OpenAI for providing the GPT-3.5-turbo language model.
  • The Chinook Sample Database for the music database used in this example.
  • SQLite Node SDK for using node sdk to connect with SQLite
  • How to use ChatGPT call functions
  • SQLite for the powerful and lightweight database engine.

About

A demo to use natural language to query SQLite DB

Topics

chatgptnlpsqlite3

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.