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.2.0.tar.gz
.
File metadata
- Download URL: llama_index_packs_vanna-0.2.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eba944e4f071cfed05c5151dc01946754088eae2b4a36f3fe8c90678399f8702 |
|
MD5 | 42582132245cbda4876f13c1c5429ba6 |
|
BLAKE2b-256 | a3ec6281da1660f7b324c32be7e2a9739dd90e5ba087281d1da57114e481914e |
File details
Details for the file llama_index_packs_vanna-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_packs_vanna-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89bd6542d27166a58ba3107cf5b70ba395f82e572b834d5cc63968ff94f823d6 |
|
MD5 | f0ab94986ed3320a1fd341c85aa14346 |
|
BLAKE2b-256 | 369e5905bf8d6097426b9eb0a68b5182b9b29f3da3dbe696f06b2e6c3770a08e |