run-llama / llama_index

LlamaIndex is a data framework for your LLM applications
https://docs.llamaindex.ai
MIT License
33.75k stars 4.74k forks source link

[Bug]: The verbose parameter bug of KnowledgeGraphRAGRetriever #12904

Open codeinging opened 3 months ago

codeinging commented 3 months ago

Bug Description

According to the official documentation, I can not effectively set up the verbose parameter of KnowledgeGraphRAGRetriever, Reason may be that KnowledgeGraphRAGRetriever super () init () method (line 541) sets the verbose to False, whether the verbose is set be True or not before, I placed “self _verbose = verbose” after the super().init() method and the problem is solved!

Version

0.10.29

Steps to Reproduce

`from llama_index.core.query_engine import RetrieverQueryEngine from llama_index.core.retrievers import KnowledgeGraphRAGRetriever

graph_rag_retriever = KnowledgeGraphRAGRetriever( storage_context=storage_context, verbose=True, )

query_engine = RetrieverQueryEngine.from_args( graph_rag_retriever, )`

Relevant Logs/Tracbacks

No response

dosubot[bot] commented 3 months ago

It looks like you've pinpointed a specific issue with the verbose parameter not being respected in the KnowledgeGraphRAGRetriever due to its superclass's __init__ method overriding it. Your solution to explicitly set self._verbose = verbose after the superclass's initialization is a valid workaround. This ensures that the verbose parameter you pass is used correctly, enabling the expected verbose logging behavior.

For others facing the same issue, here's a quick summary of the solution:

This approach should help maintain the intended functionality of the verbose parameter, allowing for more detailed logging as needed. If there are further issues or questions, feel free to ask.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.