class_docstr: A simple ready-made pipeline for RAG. It requires a populated document store.
docstr: Initializes the pipeline.
  :param retriever: The retriever to use.
  :param embedder: The embedder to use.
  :param generator: The generator to use.
  :param prompt_template: The template to use for the prompt.
docstr_tok: ["Initializes","the","pipeline",".",":","param","retriever",":","The","retriever","to","use",".",":","param","embedder",":","The","embedder","to","use",".",":","param","generator",":","The","generator","to","use",".",":","param","prompt_template",":","The","template","to","use","for","the","prompt","."]
code: def __init__(
      self,
      retriever: Any,
      embedder: Any,
      generator: Any,
      prompt_template: str,
  ):
      """
      Initializes the pipeline.
      :param retriever: The retriever to use.
      :param embedder: The embedder to use.
      :param generator: The generator to use.
      :param prompt_template: The template to use for the prompt.
      """
      self.pipeline = Pipeline()
      self.pipeline.add_component(
          instance=embedder, name="text_embedder"
      )
      self.pipeline.add_component(instance=retriever, name="retriever")
      self.pipeline.add_component(
          instance=PromptBuilder(template=prompt_template),
          name="prompt_builder",
      )
      self.pipeline.add_component(instance=generator, name="llm")
      self.pipeline.add_component(
          instance=AnswerBuilder(), name="answer_builder"
      )
      self.pipeline.connect("text_embedder", "retriever")
      self.pipeline.connect("retriever", "prompt_builder.documents")
      self.pipeline.connect("prompt_builder.prompt", "llm.prompt")
      self.pipeline.connect("llm.replies", "answer_builder.replies")
      self.pipeline.connect("llm.meta", "answer_builder.meta")
      self.pipeline.connect("retriever", "answer_builder.documents")
  
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 1 to create a new _RAGPipeline object  with example: obj = _RAGPipeline(retriever, embedder, generator, prompt_template)