No project description provided
Project description
qabot
Query local csv files or databases with natural language queries powered by
langchain
and openai
.
Quickstart
You need to set the OPENAI_API_KEY
environment variable to your OpenAI API key,
which you can get from here.
Install the qabot
command line tool using poetry:
$ poetry install
$ qabot -q "how many passengers survived by gender?" -f data/titanic.csv
🦆 Loading data from files...
Loading data/titanic.csv into table titanic...
Query: how many passengers survived by gender?
Result:
There were 233 female passengers and 109 male passengers who survived.
🚀 any further questions? [y/n] (y): y
🚀 Query: what was the largest family who did not survive?
Query: what was the largest family who did not survive?
Result:
The largest family who did not survive was the Sage family, with 8 members.
🚀 any further questions? [y/n] (y): n
Connect to a live database:
Install any required drivers for your database, e.g. pip install psycopg2-binary
for postgres.
For example to connect and query directly from the trains database in the relational dataset repository:
$ pip install mysqlclient
$ qabot -d mysql+mysqldb://guest:relational@relational.fit.cvut.cz:3306/trains -q "what are the unique load shapes of cars, what are the maximum number of cars per train?"
Query: what are the unique load shapes of cars, what are the maximum number of cars per train?
Result:
The unique load shapes of cars are circle, diamond, hexagon, rectangle, and triangle, and the maximum number of cars per train is 3.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qabot-0.1.0.tar.gz
(5.9 kB
view hashes)
Built Distribution
qabot-0.1.0-py3-none-any.whl
(6.9 kB
view hashes)