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.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
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
Hashes for llama_index_packs_vanna-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | de17dc8fcc212fdba084ca9f8c95d2c6ac6a0bd7535e78a53c2fd054b7397181 |
|
MD5 | 8dad15497c34fe5e24cf7df3a0462fc2 |
|
BLAKE2b-256 | 40cba82f36827f6d82eb66c8a2e948f86e707329f1b21e2bf9a9bc4b6a66fb29 |
Hashes for llama_index_packs_vanna-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86c2897a088cad9bea1f64b831faa07e4edb45603a692f78e6db719421d35e8a |
|
MD5 | 64c0d6d80e901cceb3ef06d59b97a4f3 |
|
BLAKE2b-256 | f7624c0f01dd54a1822eb31a80cc66a57df5b069b78d8b6a27433cde335dedef |