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"]
code: def __init__(self, args: RAGBaseParameters):
      self.output_data = defaultdict(list)
  
      self.args = args
  
      self.embeddings_model = args.embeddings_model
      if self.embeddings_model is None:
          self.embeddings_model = load_embeddings_model(
              args.embeddings_model_name
          )
  
      self.persist_directory = args.vector_store_storage_path
  
      self.collection_name = args.collection_name
  
      vector_store_config = PersistedVectorStoreLoaderConfig(
          vector_store_name=args.vector_store_name,
          embeddings_model=self.embeddings_model,
          persist_directory=self.persist_directory,
          collection_name=self.collection_name,
      )
  
      self.vector_store_loader = PersistedVectorStoreLoader(
          vector_store_config
      )
  
      self.persisted_vector_store = (
          self.vector_store_loader.load_vector_store()
      )
  
      self.prompt_template = args.prompt_template
  
      if isinstance(args, RAGHandlerParameters):
          llm_config = {"llm_config": args.llm_params.dict()}
  
          llm_loader = LLMLoader(**llm_config)
  
          self.llm = llm_loader.load_llm()
  
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 1 to create a new RAGQuestionAnswerer object  with example: obj = RAGQuestionAnswerer(args)