# Llama-index with InterSystems IRIS
[Llama-index](https://github.com/run-llama/llama_index) with support for InterSystems IRIS
## Install
```shell
pip install llama-iris
```
## Example
```python
import os
from dotenv import load_dotenv
from llama_index import SimpleDirectoryReader, StorageContext, ServiceContext
from llama_index.indices.vector_store import VectorStoreIndex
import openai
from llama_iris import IRISVectorStore
load_dotenv(override=True)
documents = SimpleDirectoryReader("./data/paul_graham").load_data()
print("Document ID:", documents[0].doc_id)
vector_store = IRISVectorStore.from_params(
connection_string=CONNECTION_STRING,
table_name="paul_graham_essay",
embed_dim=1536, # openai embedding dimension
)
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(
documents,
storage_context=storage_context,
show_progress=True,
)
query_engine = index.as_query_engine()
response = query_engine.query("What did the author do?")
import textwrap
print(textwrap.fill(str(response), 100))
```
Raw data
{
"_id": null,
"home_page": "https://github.com/caretdev/llama-iris",
"name": "llama-iris",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "LLM, NLP, RAG, data, devtools, index, retrieval, iris",
"author": "Dmitry Maslennikov",
"author_email": "dmitry@caretdev.com",
"download_url": "https://files.pythonhosted.org/packages/82/87/52ab1a46bc3a306cc45a748e88584d3e2d9e2b14883a56db3eca4cbee443/llama_iris-0.5.0.tar.gz",
"platform": null,
"description": "# Llama-index with InterSystems IRIS\n\n[Llama-index](https://github.com/run-llama/llama_index) with support for InterSystems IRIS\n\n## Install\n\n```shell\npip install llama-iris\n```\n\n## Example\n\n```python\nimport os\nfrom dotenv import load_dotenv\n\nfrom llama_index import SimpleDirectoryReader, StorageContext, ServiceContext\nfrom llama_index.indices.vector_store import VectorStoreIndex\nimport openai\n\nfrom llama_iris import IRISVectorStore\n\n\nload_dotenv(override=True)\n\ndocuments = SimpleDirectoryReader(\"./data/paul_graham\").load_data()\nprint(\"Document ID:\", documents[0].doc_id)\n\nvector_store = IRISVectorStore.from_params(\n connection_string=CONNECTION_STRING,\n table_name=\"paul_graham_essay\",\n embed_dim=1536, # openai embedding dimension\n)\n\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\n\nindex = VectorStoreIndex.from_documents(\n documents, \n storage_context=storage_context, \n show_progress=True, \n)\nquery_engine = index.as_query_engine()\n\nresponse = query_engine.query(\"What did the author do?\")\n\nimport textwrap\nprint(textwrap.fill(str(response), 100))\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Interface between LLMs and your data",
"version": "0.5.0",
"project_urls": {
"Homepage": "https://github.com/caretdev/llama-iris",
"Repository": "https://github.com/caretdev/llama-iris"
},
"split_keywords": [
"llm",
" nlp",
" rag",
" data",
" devtools",
" index",
" retrieval",
" iris"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "46c15b7eca5788e850727737446f651f91383b28c13844458c345c1e78b95b63",
"md5": "db73ba20307b105f766309595e7388cb",
"sha256": "40d9e28e24301e433d0777426c909be05cd271d20e72700826284db33a028686"
},
"downloads": -1,
"filename": "llama_iris-0.5.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "db73ba20307b105f766309595e7388cb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 5650,
"upload_time": "2024-06-09T19:03:13",
"upload_time_iso_8601": "2024-06-09T19:03:13.188099Z",
"url": "https://files.pythonhosted.org/packages/46/c1/5b7eca5788e850727737446f651f91383b28c13844458c345c1e78b95b63/llama_iris-0.5.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "828752ab1a46bc3a306cc45a748e88584d3e2d9e2b14883a56db3eca4cbee443",
"md5": "1d7236f8fd2e142bb6cab6985955e59f",
"sha256": "f0898205dcaa24800cde45cdb64ad457633c636367c2d6558035d7d748356e34"
},
"downloads": -1,
"filename": "llama_iris-0.5.0.tar.gz",
"has_sig": false,
"md5_digest": "1d7236f8fd2e142bb6cab6985955e59f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 5039,
"upload_time": "2024-06-09T19:03:14",
"upload_time_iso_8601": "2024-06-09T19:03:14.635404Z",
"url": "https://files.pythonhosted.org/packages/82/87/52ab1a46bc3a306cc45a748e88584d3e2d9e2b14883a56db3eca4cbee443/llama_iris-0.5.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-09 19:03:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "caretdev",
"github_project": "llama-iris",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "llama-iris"
}