when using query engine with streaming = true and examining response.source_nodes.extra_info, all the values are None, although the text of the nodes contains extra_info at the top. what's the easiest way to retrieve extra_info of the nodes that were used to generate a response?
I am loading the index from storage like this:
load_index_from_storage(storage_context=self._get_storage_context(
collection_name=self.id, persist_dir=os.path.join(self.base_persist_dir, self.id)), service_context=self._get_service_context())
and these are the supporting methods:
def get_query_engine(self, prompt_template=None, refine_template=None) -> BaseQueryEngine:
return RetrieverQueryEngine(
retriever=VectorIndexRetriever(
index=self.index, similarity_top_k=math.floor((4097 - 300) / self.max_chunk_size)),
response_synthesizer=ResponseSynthesizer.from_args(
response_mode=ResponseMode.COMPACT,
service_context=self._get_service_context(),
streaming=self.streaming,
text_qa_template=QuestionAnswerPrompt(prompt_template),
refine_template=RefinePrompt(refine_template)))
def _get_storage_context(self, collection_name, persist_dir=None):
return StorageContext.from_defaults(
vector_store=MilvusVectorStore(
collection_name=collection_name, overwrite=self.overwrite),
docstore=MongoDocumentStore.from_uri(...),
persist_dir=persist_dir)
def _get_service_context(self):
llm_predictor = LLMPredictor(llm=ChatOpenAI(
temperature=0, model="gpt-3.5-turbo", streaming=self.streaming))
prompt_helper = PromptHelper()
service_context = ServiceContext.from_defaults(
chunk_size=self.max_chunk_size, llm_predictor=llm_predictor, prompt_helper=prompt_helper)
return service_context