I just checked the code for
QuestionsAnsweredExtractor
I think directly it will creates questions for all the nodes.
You'll have to directly interact with the
QuestionsAnsweredExtractor
class if you want specific nodes QnA.
# get the nodes
nodes = index.docstore.docs
# Fetch all the updated nodes to be sent to qna extractor using unique ID
updated_nodes_list = ...
# Intialize the QnA Exctractor class
question_answer_extractor = QuestionsAnsweredExtractor(llm=llm)
extracted_qna = question_answer_extractor.extract(updated_nodes_list)
More can be found here:
https://github.com/run-llama/llama_index/blob/main/llama_index/node_parser/extractors/metadata_extractors.py