Name | llama-index-tools-vector-db JSON |
Version |
0.3.0
JSON |
| download |
home_page | None |
Summary | llama-index tools vector_db integration |
upload_time | 2024-11-17 23:06:25 |
maintainer | jerryjliu |
docs_url | None |
author | Your Name |
requires_python | <4.0,>=3.9 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# VectorDB Tool
This tool wraps a VectorStoreIndex and enables a agent to call it with queries and filters to retrieve data.
## Usage
```python
from llama_index.tools.vector_db import VectorDB
from llama_index.agent.openai import OpenAIAgent
from llama_index.core.vector_stores import VectorStoreInfo
from llama_index.core import VectorStoreIndex
index = VectorStoreIndex(nodes=nodes)
tool_spec = VectorDB(index=index)
vector_store_info = VectorStoreInfo(
content_info="brief biography of celebrities",
metadata_info=[
MetadataInfo(
name="category",
type="str",
description="Category of the celebrity, one of [Sports, Entertainment, Business, Music]",
),
MetadataInfo(
name="country",
type="str",
description="Country of the celebrity, one of [United States, Barbados, Portugal]",
),
],
)
agent = OpenAIAgent.from_tools(
tool_spec.to_tool_list(
func_to_metadata_mapping={
"auto_retrieve_fn": ToolMetadata(
name="celebrity_bios",
description=f"""\
Use this tool to look up biographical information about celebrities.
The vector database schema is given below:
{vector_store_info.json()}
{tool_spec.auto_retrieve_fn.__doc__}
""",
fn_schema=create_schema_from_function(
"celebrity_bios", tool_spec.auto_retrieve_fn
),
)
}
),
verbose=True,
)
agent.chat("Tell me about two celebrities from the United States. ")
```
`auto_retrieve_fn`: Retrieves data from the index
This loader is designed to be used as a way to load data as a Tool in a Agent.
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-tools-vector-db",
"maintainer": "jerryjliu",
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/06/35/14466b4c874fcba98db9e32c0b2ded44a048921c1bb636db63770d55c4b5/llama_index_tools_vector_db-0.3.0.tar.gz",
"platform": null,
"description": "# VectorDB Tool\n\nThis tool wraps a VectorStoreIndex and enables a agent to call it with queries and filters to retrieve data.\n\n## Usage\n\n```python\nfrom llama_index.tools.vector_db import VectorDB\nfrom llama_index.agent.openai import OpenAIAgent\nfrom llama_index.core.vector_stores import VectorStoreInfo\nfrom llama_index.core import VectorStoreIndex\n\nindex = VectorStoreIndex(nodes=nodes)\ntool_spec = VectorDB(index=index)\nvector_store_info = VectorStoreInfo(\n content_info=\"brief biography of celebrities\",\n metadata_info=[\n MetadataInfo(\n name=\"category\",\n type=\"str\",\n description=\"Category of the celebrity, one of [Sports, Entertainment, Business, Music]\",\n ),\n MetadataInfo(\n name=\"country\",\n type=\"str\",\n description=\"Country of the celebrity, one of [United States, Barbados, Portugal]\",\n ),\n ],\n)\n\nagent = OpenAIAgent.from_tools(\n tool_spec.to_tool_list(\n func_to_metadata_mapping={\n \"auto_retrieve_fn\": ToolMetadata(\n name=\"celebrity_bios\",\n description=f\"\"\"\\\n Use this tool to look up biographical information about celebrities.\n The vector database schema is given below:\n\n {vector_store_info.json()}\n\n {tool_spec.auto_retrieve_fn.__doc__}\n \"\"\",\n fn_schema=create_schema_from_function(\n \"celebrity_bios\", tool_spec.auto_retrieve_fn\n ),\n )\n }\n ),\n verbose=True,\n)\n\nagent.chat(\"Tell me about two celebrities from the United States. \")\n```\n\n`auto_retrieve_fn`: Retrieves data from the index\n\nThis loader is designed to be used as a way to load data as a Tool in a Agent.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index tools vector_db integration",
"version": "0.3.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1b046614482680ed986d101662ddf29ab186a1d7a64da7405a4e2ac12b811856",
"md5": "46d160eb7a9b692a00729ac20feec4d4",
"sha256": "66d9aaecc01c1792e18f441c67c3067a6c8efd304815f11a644da499b11a893c"
},
"downloads": -1,
"filename": "llama_index_tools_vector_db-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "46d160eb7a9b692a00729ac20feec4d4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 2919,
"upload_time": "2024-11-17T23:06:24",
"upload_time_iso_8601": "2024-11-17T23:06:24.900047Z",
"url": "https://files.pythonhosted.org/packages/1b/04/6614482680ed986d101662ddf29ab186a1d7a64da7405a4e2ac12b811856/llama_index_tools_vector_db-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "063514466b4c874fcba98db9e32c0b2ded44a048921c1bb636db63770d55c4b5",
"md5": "d0073ecccccabf913507d6570591eb11",
"sha256": "eb134bc94e50f7b4d916d2f1de4b4a8a974065cb75642479a8c0593628220617"
},
"downloads": -1,
"filename": "llama_index_tools_vector_db-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "d0073ecccccabf913507d6570591eb11",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 2667,
"upload_time": "2024-11-17T23:06:25",
"upload_time_iso_8601": "2024-11-17T23:06:25.712437Z",
"url": "https://files.pythonhosted.org/packages/06/35/14466b4c874fcba98db9e32c0b2ded44a048921c1bb636db63770d55c4b5/llama_index_tools_vector_db-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-17 23:06:25",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-tools-vector-db"
}