Find answers from the community

Updated 8 months ago

how to make extractQuestionsFromNode not consider the metadata of the node

@kapa.ai how to make extractQuestionsFromNode not consider the metadata of the node
k
2 comments
Please stand by @shakedbuk as I search the knowledge base. I normally take about 20 seconds or so. :wave:
----------------------
To make the QuestionsAnsweredExtractor not consider the metadata of the node, you can modify the metadata_mode parameter of the node's get_content method. The metadata_mode parameter determines how the metadata is included when the content of the node is retrieved.

However, based on the provided knowledge sources, there is no direct way to exclude metadata during the extraction process using the QuestionsAnsweredExtractor. The QuestionsAnsweredExtractor does not have a parameter that allows you to exclude metadata during extraction.

If you want to exclude certain metadata keys from being considered by the LLM, you can use the excluded_llm_metadata_keys parameter as shown in the Sub Question Query Engine documentation (). This parameter accepts a list of metadata keys that are excluded from the text for the LLM.

Here is an example of how you might use it:

Plain Text
excluded_keys = ["metadata_key_1", "metadata_key_2"]
node.get_content(metadata_mode=MetadataMode.LLM, excluded_llm_metadata_keys=excluded_keys)


Please note that this is a hypothetical example and may not work as expected without further modifications. Always refer to the official LlamaIndex documentation and source code for accurate information.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord