class_docstr: OPT BB3 Agent.
class_docstr_tok: ["OPT","BB3","Agent","."]
code: def __init__(self, opt, shared=None):
      opt["model_file"] = "zoo:"
      super().__init__(opt, shared)
      self.self_prefix = opt.get("self_prefix", PROMPT.SELF_PREFIX)
      self.partner_prefix = opt.get(
          "partner_prefix", PROMPT.PARTNER_PREFIX
      )
      self.self_memory_prefix = opt.get(
          "self_memory_prefix", PROMPT.SELF_MEMORY_PREFIX
      )
      self.partner_memory_prefix = opt.get(
          "partner_memory_prefix", PROMPT.PARTNER_MEMORY_PREFIX
      )
      self.memory_utils.self_prefix = self.self_prefix
      self.memory_utils.partner_prefix = self.partner_prefix
      self.memory_utils.self_memory_prefix = self.self_memory_prefix
      self.memory_utils.partner_memory_prefix = (
          self.partner_memory_prefix
      )
      # Always init search agent
      if not shared:
          agent_opts = self.opts[Module.SEARCH_KNOWLEDGE]
          top_agent = self._init_top_agent(agent_opts)
          # two mappings; one for code access, one for debug access.
          self.agents[Module.SEARCH_KNOWLEDGE.agent_name()] = top_agent
          self.agents[Module.SEARCH_KNOWLEDGE] = top_agent
      else:
          top_agent = shared["top_agent"].clone()
          self.agents[Module.SEARCH_KNOWLEDGE.agent_name()] = top_agent
          self.agents[Module.SEARCH_KNOWLEDGE] = top_agent
  
      # continue
      self.max_prompt_len = opt.get(
          "max_prompt_len", PROMPT.MAX_PROMPT_LEN
      )
      self.search_agent = SearchAgent(
          {
              "server": self.opt.get("search_server", "default"),
              "raw_server": self.opt.get("raw_search_server", None),
              "intra_doc_delimiter": " ",
              "n_docs": 5,
              "search_server_timeout": opt.get(
                  "search_server_timeout", 0
              ),
          }
      )
      self.vanilla = all(
          decision is Decision.NEVER
          for decision in [
              self.contextual_knowledge_decision,
              self.search_decision,
              self.memory_decision,
          ]
      )
      self.batch_agents = {m: self.agents[m].clone() for m in Module}
      top_batch_agent = self.batch_agents[Module.SEARCH_KNOWLEDGE]
      for key in BB3_OPT_GEN_KEYS:
          for agent in self.batch_agents.values():
              if key not in agent.opt:
                  logging.debug(
                      f"Overriding {key} to {top_batch_agent.opt[key]}"
                  )
                  agent.opt[key] = top_batch_agent.opt[key]
  
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 4 to create a new BlenderBot3Agent object from inherited base classes: R2C2Agent with example: obj = BlenderBot3Agent(opt, shared)