chat2data

module
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2023 License: MIT

README

Go Report Card GitHub release (with filter) Docker Pulls

🗣 📊Chat2Data is tool for interacting with databases, supporting MySQL, PostgreSQL, SQLite3, and CSV files, HTML page.

Feature

  • 🗣 Easy Interaction: Chat2Data lets you chat with your databases, making it intuitive to use.
  • 🔗 Multiple Databases: It supports MySQL, PostgreSQL, SQLite3, and CSV files.
  • 🐳 Docker Support: It provides a Docker image for easy deployment.
  • 💻 CLI and Web UI: It offers both a command line and a web interface.
  • ⚙️ Simple Installation: It's easy to install with Go command.
  • 🧠 AI Integration: It leverages OpenAI API for advanced natural language processing.

Preview

CLI Web UI

Install

Download

Releases Page

Go install

go install github.com/byebyebruce/chat2data/cmd/chat2data@latest

Quick Run

  • Binary
OPENAI_API_KEY=xxx ./chat2data db -c ./testdata/world_happiness_2015.db

Ask: Which is the highest happiness country?

  • Docker
docker run --rm -it -e OPENAI_API_KEY=xxx -p 8088:8088 bailu1901/chat2data html 'https://github.com/byebyebruce/chat2data

Open http://localhost:8088 in browser, then ask: What is the feature of chat2data?

Config

  • Use local .env file ./cp .env.template .env then edit it.
  • You can also use export OPENAI_API_KEY=xxx to specify the environment variables.
  • Or run with env OPENAI_API_KEY=xxx OPENAI_BASE_URL=https://api.openai.com ./chat2data db root:pwd@tcp(localhost:3306)/mydb

Usage

  • help ./chat2data --help
    global flags
      --web  -w  web ui port
      --cli  -c  cli mode
  1. Run CLI(command line interface)
    • mysql ./chat2data db -c root:pwd@tcp(localhost:3306)/mydb
    • postgre ./chat2data db -c postgres://db_user:mysecretpassword@localhost:5438/test?sslmode=disable
    • sqlite3 ./chat2data db -c ./sqlite.db
    • csv ./chat2data csv -c ./csvfile.csv or ./chat2data csv ./csvdir
    • html ./chat2data html -c https://github.com/byebyebruce/chat2data
    • with env OPENAI_API_KEY=xxx chat2data db -c root:pwd@tcp(localhost:3306)/mydb
  2. Run Web UI
    • mysql ./chat2data db root:example@tcp(10.12.21.101:3306)/mydb
    • html ./chat2data html https://github.com/byebyebruce/chat2data
    • sqlite3 ./chat2data db -w=:0.0.0.0:8088 ./mytest.db

Build

git clone github.com/byebyebruce/chat2data

  • build binary
make build
  • build docker image
docker build -t chat2data .

TODO

  • Support Docker
  • Support Postgre Database
  • Support load csv
  • Add Web ui
  • Local vector database
  • Support load html
  • Doc QA
  • Beautiful CLI

Change Log

Special Thanks

Directories

Path Synopsis
cmd
chat2data command
qa
ui
cli
web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL