llama-index packs vanna integration
Project description
Vanna AI LLamaPack
Vanna AI is an open-source RAG framework for SQL generation. It works in two steps:
- Train a RAG model on your data
- Ask questions (use reference corpus to generate SQL queries that can run on your db).
Check out the Github project and the docs for more details.
This LlamaPack creates a simple VannaQueryEngine
with vanna, ChromaDB and OpenAI, and allows you to train and ask questions over a SQL database.
CLI Usage
You can download llamapacks directly using llamaindex-cli
, which comes installed with the llama-index
python package:
llamaindex-cli download-llamapack VannaPack --download-dir ./vanna_pack
You can then inspect the files at ./vanna_pack
and use them as a template for your own project!
Code Usage
You can download the pack to a ./vanna_pack
directory:
from llama_index.core.llama_pack import download_llama_pack
# download and install dependencies
VannaPack = download_llama_pack("VannaPack", "./vanna_pack")
From here, you can use the pack, or inspect and modify the pack in ./vanna_pack
.
Then, you can set up the pack like so:
pack = VannaPack(
openai_api_key="<openai_api_key>",
sql_db_url="chinook.db",
openai_model="gpt-3.5-turbo",
)
The run()
function is a light wrapper around llm.complete()
.
response = pack.run("List some sample albums")
You can also use modules individually.
query_engine = pack.get_modules()["vanna_query_engine"]
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
Built Distribution
File details
Details for the file llama_index_packs_vanna-0.3.0.tar.gz
.
File metadata
- Download URL: llama_index_packs_vanna-0.3.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef1d14c527ad7cf7423817c09ad336e0cbb8f174e056a72337f08ac2e5fa1995 |
|
MD5 | b2faaad0d057f27b1985bf62a9a501b1 |
|
BLAKE2b-256 | 22f106637545908fa7f45756b9987a75c45929bf5b755c1ff1bfbd64fc645a8c |
File details
Details for the file llama_index_packs_vanna-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_packs_vanna-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 316ffe9e3b0223d398d7f06c4e1893c0076eb2ad3c48ec7fe271998e79b94c0f |
|
MD5 | f4e88a7b073f89e69340c713df22f0d2 |
|
BLAKE2b-256 | a84d00065668758f02beb53b932a02e63d43284a76b9385a95d8cb5d007c97cc |