Update rag_llamaindex.py
Browse files- rag_llamaindex.py +4 -4
rag_llamaindex.py
CHANGED
@@ -60,7 +60,7 @@ class LlamaIndexRAG:
|
|
60 |
|
61 |
def store_documents(self, config, docs):
|
62 |
storage_context = StorageContext.from_defaults(
|
63 |
-
vector_store = get_vector_store())
|
64 |
|
65 |
VectorStoreIndex.from_documents(
|
66 |
docs,
|
@@ -76,13 +76,13 @@ class LlamaIndexRAG:
|
|
76 |
)
|
77 |
|
78 |
def ingestion(self, config):
|
79 |
-
docs = load_documents()
|
80 |
|
81 |
-
store_documents(config, docs)
|
82 |
|
83 |
def retrieval(self, config, prompt):
|
84 |
index = VectorStoreIndex.from_vector_store(
|
85 |
-
vector_store = get_vector_store(
|
86 |
|
87 |
query_engine = index.as_query_engine(
|
88 |
similarity_top_k = config["k"]
|
|
|
60 |
|
61 |
def store_documents(self, config, docs):
|
62 |
storage_context = StorageContext.from_defaults(
|
63 |
+
vector_store = self.get_vector_store())
|
64 |
|
65 |
VectorStoreIndex.from_documents(
|
66 |
docs,
|
|
|
76 |
)
|
77 |
|
78 |
def ingestion(self, config):
|
79 |
+
docs = self.load_documents()
|
80 |
|
81 |
+
self.store_documents(config, docs)
|
82 |
|
83 |
def retrieval(self, config, prompt):
|
84 |
index = VectorStoreIndex.from_vector_store(
|
85 |
+
vector_store = self.get_vector_store())
|
86 |
|
87 |
query_engine = index.as_query_engine(
|
88 |
similarity_top_k = config["k"]
|