class_docstr: Modular agent mixin.
  
  Provides shared functionality across modular agents (seeker, BB3)
docstr: Initialize a shared version of a top-level agent.
  
  This just makes sure that each "agent" has the same params, but different
  history objects.
  
  :param opt_key:
      which sub agent to create with the shared model.
docstr_tok: ["Initialize","a","shared","version","of","a","top-level","agent",".","This","just","makes","sure","that","each","``","agent","''","has","the","same","params",",","but","different","history","objects",".",":","param","opt_key",":","which","sub","agent","to","create","with","the","shared","model","."]
code: def init_shared_model(self, opt: Opt, top_agent: Agent):
      """
      Initialize a shared version of a top-level agent.
  
      This just makes sure that each "agent" has the same params, but different
      history objects.
  
      :param opt_key:
          which sub agent to create with the shared model.
      """
      opt.update(opt["override"])
      if "model" in opt["override"]:
          model_class = load_agent_module(opt["override"]["model"])
      else:
          model_class = type(top_agent)
      shared = top_agent.share()
      shared["opt"] = opt
      return model_class(opt, shared)
  
file_path: ParlAI/projects/seeker/agents/modular_agent.py
imports: from abc import ABC
  from typing import Dict, Any, List
  from parlai.core.agents import Agent
  from parlai.core.build_data import modelzoo_path
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.loader import load_agent_module
  import parlai.utils.logging
label_desc: Use image node_id 1 for calling the ModularAgentMixin obj's underlying member method code with example usage: obj.init_shared_model(opt, top_agent) and returns: model_class