Find answers from the community

s
F
Y
a
P
Updated 2 months ago

I am facing an issue with

I am facing an issue with KnowledgeGraphIndex.from_documents
Can anyone please help me?
W
J
4 comments
Can you share the issue that you are facing, would help to debug!
documents = SimpleDirectoryReader("./english/").load_data()
graph_store = NeptuneDatabaseGraphStore(
host="mic-research-bjbdja.cluster-cxcoeabdgsjdh45.ap-south-1.neptune.amazonaws.com", port=8182, region_name="ap-south-1"
)
storage_context = StorageContext.from_defaults(graph_store=graph_store)
index = KnowledgeGraphIndex.from_documents( documents=documents,
max_triplets_per_chunk=2,
storage_context=storage_context,
# embed_model=embed_model,
# include_embeddings=True
)
This is the code
File "C:\Users\54978\coding_projects\RAG_AWS_Neptune\main.py", line 43, in <module>
index = KnowledgeGraphIndex.from_documents( documents=documents,

^^^^^^
File "C:\Users\54978\OneDrive - ITC INFOTECH INDIA LIMITED\coding_projects\RAG_AWS_Neptune\venv\Lib\site-packages\llama_index\llms\bedrock\utils.py", line 157, in get_request_body
if len(prompt) > 0 and prompt[0]["role"] == "system":
~~~~~^^^^^^^^
TypeError: string indices must be integers, not 'str'


This is the error
Add a reply
Sign up and join the conversation on Discord