Open Aaronchangji opened 2 weeks ago
@Aaronchangji Hello! I'm here to help you with any bugs, questions, or contributions. Let's work together to resolve your issue.
To resolve the TypeError: KnowledgeGraphIndex._build_index_from_nodes() got an unexpected keyword argument 'space_name'
error, ensure that the space_name
argument is not passed to the _build_index_from_nodes
method. Instead, it should be used when instantiating the NebulaGraphStore
.
Here is the correct way to instantiate the NebulaGraphStore
and create the StorageContext
:
from llama_index.legacy.storage.storage_context import StorageContext
from llama_index.legacy.graph_stores.nebula import NebulaGraphStore
space_name = "llamaindex"
edge_types, rel_prop_names = ["relationship"], ["relationship"]
tags = ["entity"]
graph_store = NebulaGraphStore(
space_name=space_name,
edge_types=edge_types,
rel_prop_names=rel_prop_names,
tags=tags,
)
storage_context = StorageContext.from_defaults(graph_store=graph_store)
Ensure that you do not pass space_name
to the KnowledgeGraphIndex.from_documents
method. The KnowledgeGraphIndex
class does not accept space_name
as a parameter, and it should be configured within the NebulaGraphStore
and StorageContext
as shown above [1][2][3].
To continue talking to Dosu, mention @dosu.
Yep, same issue happening to us as well.
Bug Description
Try to create KG index via
It reports:
_build_index_from_nodes()
inKnowledgeGraphIndex
does not take any keyword arguments except fornodes
.I think it's a similar bug with https://github.com/run-llama/llama_index/issues/14398
Version
0.10.52
Steps to Reproduce
Follow the instructions of https://docs.llamaindex.ai/en/stable/examples/query_engine/knowledge_graph_query_engine/#optionalbuild-the-knowledge-graph-with-llamaindex to build KG.
Relevant Logs/Tracbacks