class_docstr: OPT BB3 Agent.
class_docstr_tok: ["OPT","BB3","Agent","."]
docstr: Retrieve search results; return documents as well.
  
  :param batch_reply_sgm:
      batch reply with the search queries
  :param search_indices:
      indices into batch in which we search.
  
  :return results, docs:
      return the search results in raw string form
      return the top documents as Documents
docstr_tok: ["Retrieve","search","results",";","return","documents","as","well",".",":","param","batch_reply_sgm",":","batch","reply","with","the","search","queries",":","param","search_indices",":","indices","into","batch","in","which","we","search",".",":","return","results",",","docs",":","return","the","search","results","in","raw","string","form","return","the","top","documents","as","Documents"]
code: def get_search_results(
      self, batch_reply_sgm: List[Message], search_indices: List[int]
  ) -> Tuple[List[List[str]], List[List[Document]]]:
      """
      Retrieve search results; return documents as well.
  
      :param batch_reply_sgm:
          batch reply with the search queries
      :param search_indices:
          indices into batch in which we search.
  
      :return results, docs:
          return the search results in raw string form
          return the top documents as Documents
      """
      search_queries: List[str] = [
          o["text"] if i in search_indices else ""
          for i, o in enumerate(batch_reply_sgm)
      ]
      search_results: List[List[str]] = []
      top_docs: List[List[Document]] = []
      for q in search_queries:
          if q:
              search_results.append(
                  self.search_agent.respond({"text": q}).split("\n")
              )
              top_docs.append(self.search_agent.top_docs)
              # clear the top_docs on search agent side
              self.search_agent.top_docs = []
          else:
              search_results.append([])
              top_docs.append([])
  
      for i, results_i in enumerate(search_results):
          # chunk docs; save only first 500 chars of each document
          for j, d in enumerate(results_i):
              results_i[j] = " ".join(
                  d.split(" ")[: self.opt["knowledge_chunk_size"]]
              )
          print_results = "\t\n\n".join(
              [
                  f"Document {j}:" + " ".join(r.split()[:50])
                  for j, r in enumerate(results_i)
              ]
          )
          logging.debug(
              f"Search Results (50 toks each) for {i}:\n {print_results}"
          )
  
      return search_results, top_docs
  
imports: import copy
  import random
  from typing import List, Optional, Dict, Any, Union, Tuple
  from parlai.agents.rag.retrievers import Document
  from parlai.core.agents import Agent, create_agent
  from parlai.core.message import Message
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  import parlai.utils.logging
  from projects.bb3.agents.module import Module
  from projects.bb3.agents.r2c2_bb3_agent import BlenderBot3Agent
  from projects.bb3.agents.opt_api_agent import BB3OPTAgent
  from projects.bb3.agents.search_agent import SearchAgent
  from projects.bb3.agents.utils import Decision, APIUtils, is_opener, DisplayUtils, set_failed_reply
  import projects.bb3.prompts
label_desc: Use image node_id 14 for calling the BlenderBot3Agent obj's underlying member method code with example usage: obj.get_search_results(batch_reply_sgm, search_indices) and returns: search_results,  top_docs