π£ π Chat2Data is a tool for interacting with your data, including MySQL, PostgreSQL, SQLite3, CSV, Text, PDF, and HTML pages.
Feature
- π£ Easy Interaction: Chat2Data allows you to chat with your data, making it intuitive to use.
- π Multiple Databases: It supports MySQL, PostgreSQL, SQLite3, CSV, Text, PDF, and HTML pages.
- π³ 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 a Go command.
- π§ AI Integration: It leverages the OpenAI API for advanced natural language processing.
Preview
Install
Download
Releases Page
Go install
go install github.com/byebyebruce/chat2data/cmd/chat2data@latest
Quick Run
OPENAI_API_KEY=xxx chat2data db -c testdata/world_happiness_2015.db
Ask: Which is the highest happiness country?
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/v1 chat2data db root:pwd@tcp(localhost:3306)/mydb
Usage
- help
chat2data --help
global flags
--web -w web ui port
--cli -c cli mode
- 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
- text
chat2data txt -c textfile.txt
- with env
OPENAI_API_KEY=xxx chat2data db -c root:pwd@tcp(localhost:3306)/mydb
- Run Web UI
- mysql
chat2data db root:example@tcp(10.12.21.101:3306)/mydb
- html
chat2data html https://github.com/byebyebruce/chat2data
- pdf
chat2data pdf testdata/sample.pdf
- sqlite3
chat2data db -w=:0.0.0.0:8088 mytest.db
Build
git clone github.com/byebyebruce/chat2data
make build
docker build -t chat2data .
TODO
- Support Docker
- Support Postgre Database
- Support load csv
- Add Web ui
- Local vector database
- Support load html
- Support load pdf
- Doc QA
- Support word
- Beautiful CLI
Special Thanks