class_docstr: This component is used to paginate the results of a retriever.
  It is useful when the retriever returns a large number of documents, and we want to pass them to the LLM
  in batches.
  
  It is useful in cases where the LLM's context length is limited, and we want to avoid passing too many
  documents to it at once.
class_docstr_tok: ["This","component","is","used","to","paginate","the","results","of","a","retriever",".","It","is","useful","when","the","retriever","returns","a","large","number","of","documents",",","and","we","want","to","pass","them","to","the","LLM","in","batches",".","It","is","useful","in","cases","where","the","LLM","'s","context","length","is","limited",",","and","we","want","to","avoid","passing","too","many","documents","to","it","at","once","."]
code: def run(
      self,
      query: Variadic[str],
      top_k: Optional[int] = None,
      filters: Optional[Dict[str, Any]] = None,
      scale_score: Optional[bool] = None,
  ):
      if not top_k:
          top_k = self.top_k
  
      if self.retrieved_documents is None:
          self.retrieved_documents = self.retriever.run(
              query=query[0], filters=filters, top_k=top_k, scale_score=scale_score  # type: ignore
          )["documents"]
  
      if not self.retrieved_documents:
          raise ValueError("No more documents available :(")
  
      next_page = self.retrieved_documents[: self.page_size]
      self.retrieved_documents = self.retrieved_documents[
          self.page_size :
      ]
      return {"documents": next_page}
  
file_path: haystack/examples/rag/rag_self_correction.py
imports: from typing import List, Any, Optional, Dict
  import logging
  from pprint import pprint
  from haystack import Pipeline, Document, component, default_to_dict, default_from_dict, DeserializationError
  from haystack.document_stores.in_memory import InMemoryDocumentStore
  from haystack.components.retrievers.in_memory import InMemoryBM25Retriever
  from haystack.components.generators import OpenAIGenerator
  from haystack.components.builders.prompt_builder import PromptBuilder
  from haystack.components.others import Multiplexer
  from haystack.components.routers.conditional_router import ConditionalRouter
  from haystack.core.component.types import Variadic
label_desc: Use image node_id 4 for calling the PaginatedRetriever obj's underlying member method code with example usage: obj.run(query, top_k, filters, scale_score) and returns: dict