Home Applications llama-iris

llama-iris

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
0
0 reviews
0
Awards
159
Views
0
IPM installs
1
1
Details
Releases
Reviews
Issues
Support for IRIS for Llama-index

What's new in this version

Initial Release

Llama-index with InterSystems IRIS

Llama-index with support for InterSystems IRIS

Install

pip install llama-iris

Example

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))

Donate
Made with
Version
0.2.016 Apr, 2024
Python package
llama-iris
Category
Frameworks
Works with
InterSystems IRIS
First published
16 Apr, 2024