Find answers from the community

Home
Members
VishalKorakar
V
VishalKorakar
Offline, last seen 6 months ago
Joined September 25, 2024
just needed to ask a question on the below error:
TypeError: KVDocumentStore.init() got an unexpected keyword argument 'node_collection_suffix'

the code is :
from llama_index.core import SimpleDirectoryReader, StorageContext
from llama_index.core import VectorStoreIndex, SimpleKeywordTableIndex
from llama_index.core import SummaryIndex
from llama_index.core import ComposableGraph
from llama_index.llms.openai import OpenAI
from llama_index.core import Settings
import os
from dotenv import load_dotenv

load_dotenv()
reader = SimpleDirectoryReader("./Data_1/")
documents = reader.load_data()

from llama_index.core.node_parser import SentenceSplitter

nodes = SentenceSplitter().get_nodes_from_documents(documents)

mongo_uri = os.getenv("MONGO_URI")

from llama_index.storage.docstore.mongodb import MongoDocumentStore
from llama_index.storage.index_store.mongodb import MongoIndexStore

storage_context = StorageContext.from_defaults(
docstore=MongoDocumentStore.from_uri(uri=mongo_uri),
index_store=MongoIndexStore.from_uri(uri=mongo_uri),
)
storage_context.docstore.add_documents(nodes)
4 comments
L
V