This repository contains a collection of building blocks for generative AI use cases.
The first use case we are going to tackle is Text2SQL. We are going to build an application that can convert natural language questions into SQL queries using LlamaIndex and Claude 3 through AWS Bedrock.
- Text2SQL using LlamaIndex and Bedrock using Candle Glow dataset Text2SQL using LlamaIndex and Bedrock using Star Wars dataset
2 - TBC
pyenv install 3.12.0
pyenv local 3.12.0
python -m venv .venv
source .venv/bin/activate
docker run --name movies-db -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 -v $(pwd)/postgres:/var/lib/postgresql/postgres:rw postgres:alpine
docker run --name candle-glow-db -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 -v $(pwd)/postgres:/var/lib/postgresql/postgres:rw postgres:alpine
docker exec -it movies-db bash
docker exec -it candle-glow-db bash
psql -h localhost -p 5432 -U postgres
CREATE DATABASE star_wars;
CREATE DATABASE candle_glow;
\c star_wars
\c candle_glow
Once connected, open a new SQL script and run the following SQL (./llama-index/text-to-sql/star_wars_db/database.sql or ./llama-index/text-to-sql/candle-glow/database.sql) to create the tables and insert some data.