# Vanna AI LLamaPack
Vanna AI is an open-source RAG framework for SQL generation. It works in two steps:
1. Train a RAG model on your data
2. Ask questions (use reference corpus to generate SQL queries that can run on your db).
Check out the [Github project](https://github.com/vanna-ai/vanna) and the [docs](https://vanna.ai/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:
```bash
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:
```python
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:
```python
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()`.
```python
response = pack.run("List some sample albums")
```
You can also use modules individually.
```python
query_engine = pack.get_modules()["vanna_query_engine"]
```
Raw data
{
"_id": null,
"home_page": "",
"name": "llama-index-packs-vanna",
"maintainer": "jerryjliu",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "ai,sql,text-to-sql,vanna",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/a6/9a/5baffb43f7180ef31f9a2f70fb3537455be2d4d4ea7b7d8f4e9e7e36c633/llama_index_packs_vanna-0.1.4.tar.gz",
"platform": null,
"description": "# Vanna AI LLamaPack\n\nVanna AI is an open-source RAG framework for SQL generation. It works in two steps:\n\n1. Train a RAG model on your data\n2. Ask questions (use reference corpus to generate SQL queries that can run on your db).\n\nCheck out the [Github project](https://github.com/vanna-ai/vanna) and the [docs](https://vanna.ai/docs/) for more details.\n\nThis LlamaPack creates a simple `VannaQueryEngine` with vanna, ChromaDB and OpenAI, and allows you to train and ask questions over a SQL database.\n\n## CLI Usage\n\nYou can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:\n\n```bash\nllamaindex-cli download-llamapack VannaPack --download-dir ./vanna_pack\n```\n\nYou can then inspect the files at `./vanna_pack` and use them as a template for your own project!\n\n## Code Usage\n\nYou can download the pack to a `./vanna_pack` directory:\n\n```python\nfrom llama_index.llama_pack import download_llama_pack\n\n# download and install dependencies\nVannaPack = download_llama_pack(\"VannaPack\", \"./vanna_pack\")\n```\n\nFrom here, you can use the pack, or inspect and modify the pack in `./vanna_pack`.\n\nThen, you can set up the pack like so:\n\n```python\npack = VannaPack(\n openai_api_key=\"<openai_api_key>\",\n sql_db_url=\"chinook.db\",\n openai_model=\"gpt-3.5-turbo\",\n)\n```\n\nThe `run()` function is a light wrapper around `llm.complete()`.\n\n```python\nresponse = pack.run(\"List some sample albums\")\n```\n\nYou can also use modules individually.\n\n```python\nquery_engine = pack.get_modules()[\"vanna_query_engine\"]\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index packs vanna integration",
"version": "0.1.4",
"project_urls": null,
"split_keywords": [
"ai",
"sql",
"text-to-sql",
"vanna"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "092cc8bcbdf644a86abfe56f7b41e27d617ec3eee84f0d59eb4343110a48113f",
"md5": "ef8140811edb62222ff743d3bd50e0a2",
"sha256": "c7f35b8f80e11d3b9ea930bf725a0296a5edfd6f0bb637942af94b7af9540d14"
},
"downloads": -1,
"filename": "llama_index_packs_vanna-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ef8140811edb62222ff743d3bd50e0a2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 3599,
"upload_time": "2024-02-22T03:21:54",
"upload_time_iso_8601": "2024-02-22T03:21:54.506593Z",
"url": "https://files.pythonhosted.org/packages/09/2c/c8bcbdf644a86abfe56f7b41e27d617ec3eee84f0d59eb4343110a48113f/llama_index_packs_vanna-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a69a5baffb43f7180ef31f9a2f70fb3537455be2d4d4ea7b7d8f4e9e7e36c633",
"md5": "b53faa0546a38f0ff7043e355c9557ee",
"sha256": "fccadeed1d0b4734db68c226b616efa8b1b44ed9d537f855d26aa2a27eda687d"
},
"downloads": -1,
"filename": "llama_index_packs_vanna-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "b53faa0546a38f0ff7043e355c9557ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 3357,
"upload_time": "2024-02-22T03:21:56",
"upload_time_iso_8601": "2024-02-22T03:21:56.111805Z",
"url": "https://files.pythonhosted.org/packages/a6/9a/5baffb43f7180ef31f9a2f70fb3537455be2d4d4ea7b7d8f4e9e7e36c633/llama_index_packs_vanna-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-22 03:21:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-packs-vanna"
}