Name | llama-index-readers-astra-db JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | llama-index readers astra_db integration |
upload_time | 2024-08-22 05:48:06 |
maintainer | erichare |
docs_url | None |
author | Your Name |
requires_python | <4.0,>=3.8.1 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Astra DB Loader
```bash
pip install llama-index-readers-astra-db
```
The Astra DB Loader returns a set of documents retrieved from Astra DB.
The user initializes the loader with an Astra DB index. They then pass in a vector.
## Usage
Here's an example usage of the AstraDBReader.
```python
from openai import OpenAI
# Get the credentials for Astra DB
api_endpoint = "https://324<...>f1c.astra.datastax.com"
token = "AstraCS:<...>"
# EXAMPLE: OpenAI embeddings
client = OpenAI(api_key="sk-<...>")
# Call OpenAI (or generate embeddings another way)
response = client.embeddings.create(
input="Your text string goes here", model="text-embedding-ada-002"
)
# Get the embedding
query_vector = response.data[0].embedding
# Initialize the Reader object
from llama_index.readers.astra_db import AstraDBReader
# Your Astra DB Account will provide you with the endpoint URL and Token
reader = AstraDBReader(
collection_name="astra_v_table",
token=token,
api_endpoint=api_endpoint,
embedding_dimension=len(query_vector),
)
# Fetch data from the reader
documents = reader.load_data(vector=query_vector, limit=5)
```
This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).
> **Note**: Please see the AstraDB documentation [here](https://docs.datastax.com/en/astra/astra-db-vector/clients/python.html).
Raw data
{
"_id": null,
"home_page": null,
"name": "llama-index-readers-astra-db",
"maintainer": "erichare",
"docs_url": null,
"requires_python": "<4.0,>=3.8.1",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/4c/63/ac727c0f662de26d32d0246b3910068ce53e02e1f20291cb1857127ef3c3/llama_index_readers_astra_db-0.2.0.tar.gz",
"platform": null,
"description": "# Astra DB Loader\n\n```bash\npip install llama-index-readers-astra-db\n```\n\nThe Astra DB Loader returns a set of documents retrieved from Astra DB.\nThe user initializes the loader with an Astra DB index. They then pass in a vector.\n\n## Usage\n\nHere's an example usage of the AstraDBReader.\n\n```python\nfrom openai import OpenAI\n\n\n# Get the credentials for Astra DB\napi_endpoint = \"https://324<...>f1c.astra.datastax.com\"\ntoken = \"AstraCS:<...>\"\n\n# EXAMPLE: OpenAI embeddings\nclient = OpenAI(api_key=\"sk-<...>\")\n\n# Call OpenAI (or generate embeddings another way)\nresponse = client.embeddings.create(\n input=\"Your text string goes here\", model=\"text-embedding-ada-002\"\n)\n\n# Get the embedding\nquery_vector = response.data[0].embedding\n\n# Initialize the Reader object\nfrom llama_index.readers.astra_db import AstraDBReader\n\n# Your Astra DB Account will provide you with the endpoint URL and Token\nreader = AstraDBReader(\n collection_name=\"astra_v_table\",\n token=token,\n api_endpoint=api_endpoint,\n embedding_dimension=len(query_vector),\n)\n\n# Fetch data from the reader\ndocuments = reader.load_data(vector=query_vector, limit=5)\n```\n\nThis loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).\n\n> **Note**: Please see the AstraDB documentation [here](https://docs.datastax.com/en/astra/astra-db-vector/clients/python.html).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index readers astra_db integration",
"version": "0.2.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d7cc64997f32aa8ce9f24881ec92edf639e01a283448b353a1030d32ae63f531",
"md5": "7019b9bd2d2d690b78f8ed3b56c548a3",
"sha256": "f2502c504fc85ed896c700d43c0a210432f08d6d883a6b9db54aa6ebab47019e"
},
"downloads": -1,
"filename": "llama_index_readers_astra_db-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7019b9bd2d2d690b78f8ed3b56c548a3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8.1",
"size": 3317,
"upload_time": "2024-08-22T05:48:05",
"upload_time_iso_8601": "2024-08-22T05:48:05.023470Z",
"url": "https://files.pythonhosted.org/packages/d7/cc/64997f32aa8ce9f24881ec92edf639e01a283448b353a1030d32ae63f531/llama_index_readers_astra_db-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4c63ac727c0f662de26d32d0246b3910068ce53e02e1f20291cb1857127ef3c3",
"md5": "70824e8526738dd875297865d3f26310",
"sha256": "658641e7e3b6c2d10247b65f69ffbec10a85bc7274c2b66f61ef86705b0680ad"
},
"downloads": -1,
"filename": "llama_index_readers_astra_db-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "70824e8526738dd875297865d3f26310",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8.1",
"size": 3051,
"upload_time": "2024-08-22T05:48:06",
"upload_time_iso_8601": "2024-08-22T05:48:06.252034Z",
"url": "https://files.pythonhosted.org/packages/4c/63/ac727c0f662de26d32d0246b3910068ce53e02e1f20291cb1857127ef3c3/llama_index_readers_astra_db-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-22 05:48:06",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-readers-astra-db"
}