class_docstr: A simple ready-made pipeline for RAG. It requires a populated document store.
docstr: Performs RAG using the given query.
  
  :param query: The query to ask.
  :return: An Answer object.
docstr_tok: ["Performs","RAG","using","the","given","query",".",":","param","query",":","The","query","to","ask",".",":","return",":","An","Answer","object","."]
code: def run(self, query: str) -> Answer:
      """
      Performs RAG using the given query.
  
      :param query: The query to ask.
      :return: An Answer object.
      """
      run_values = {
          "prompt_builder": {"question": query},
          "answer_builder": {"query": query},
          "text_embedder": {"text": query},
      }
      return self.pipeline.run(run_values)["answer_builder"]["answers"][
          0
      ]
  
imports: import re
  from abc import ABC, abstractmethod
  from typing import Optional, Any
  from huggingface_hub import HfApi
  from haystack import Pipeline
  from haystack.components.builders.answer_builder import AnswerBuilder
  from haystack.components.builders.prompt_builder import PromptBuilder
  from haystack.components.embedders import SentenceTransformersTextEmbedder
  from haystack.components.generators import OpenAIGenerator, HuggingFaceTGIGenerator
  from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever
  from haystack.dataclasses import Answer
  from haystack.document_stores.types import DocumentStore
  from haystack.document_stores.in_memory import InMemoryDocumentStore
label_desc: Use image node_id 2 for calling the _RAGPipeline obj's underlying member method code with example usage: obj.run(query) and returns: self