class_docstr: A class for using a RAG model for question answering
class_docstr_tok: ["A","class","for","using","a","RAG","model","for","question","answering"]
docstr: Post process LLM response
docstr_tok: ["Post","process","LLM","response"]
code: def query(self, question: str) -> defaultdict:
      """Post process LLM response"""
      llm_response, vector_store_response = self._query(question)
  
      result = defaultdict(list)
      extracted_text = self.extract_generated_text(llm_response)
      result["answer"].append(extracted_text)
  
      sources = defaultdict(list)
  
      for idx, document in enumerate(vector_store_response):
          sources["sources_content"].append(document.page_content)
          sources["sources_document"].append(
              document.metadata.get("source", None)
          )
          sources["column"].append(
              document.metadata.get("column", None)
          )
          sources["sources_row"].append(
              document.metadata.get("row", None)
          )
  
      result["source_documents"].append(dict(sources))
  
      return result
  
file_path: mindsdb/mindsdb/integrations/handlers/rag_handler/rag.py
imports: import json
  from collections import defaultdict
  from typing import List
  from mindsdb.integrations.handlers.rag_handler.settings import LLMLoader, PersistedVectorStoreLoader, PersistedVectorStoreLoaderConfig, RAGBaseParameters, RAGHandlerParameters, load_embeddings_model
  from mindsdb.utilities import log
label_desc: Use image node_id 7 for calling the RAGQuestionAnswerer obj's underlying member method code with example usage: obj.query(question) and returns: result