class_docstr: OPT BB3 Agent.
class_docstr_tok: ["OPT","BB3","Agent","."]
docstr: Return the appropriate ORM observation.
  
  :param observation:
      raw observation
  :param opening_memories:
      memories seeded to the model
  
  :return observation:
      return the ORM observation
docstr_tok: ["Return","the","appropriate","ORM","observation",".",":","param","observation",":","raw","observation",":","param","opening_memories",":","memories","seeded","to","the","model",":","return","observation",":","return","the","ORM","observation"]
code: def get_orm_observation(
      self, observation: Message, opening_memories: Dict[str, int]
  ) -> Message:
      """
      Return the appropriate ORM observation.
  
      :param observation:
          raw observation
      :param opening_memories:
          memories seeded to the model
  
      :return observation:
          return the ORM observation
      """
      agent = self.agents[Module.OPENING_DIALOGUE]
      agent.reset()
      prefixed_memories = {}
      for mem, val in opening_memories.items():
          mem = self.memory_utils.maybe_add_memory_prefix(
              mem, "partner", self.MODEL_TYPE
          )
          prefixed_memories[mem] = val
  
      new_obs = copy.deepcopy(observation)
      memories_to_use = self.memory_utils.get_available_memories(
          "",
          prefixed_memories,
          set(),
          dictionary=self.dictionary,
          **self._get_memory_heuristic_values(),
      )
      if not memories_to_use:
          # we need at least one memory to open with...
          memories_to_use = random.sample(
              list(prefixed_memories.keys()), 1
          )
  
      new_obs.force_set(
          "text", self._check_and_limit_len("\n".join(memories_to_use))
      )
      new_obs.force_set("memories", prefixed_memories)
  
      return agent.observe(new_obs)
  
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 10 for calling the BlenderBot3Agent obj's underlying member method code with example usage: obj.get_orm_observation(observation, opening_memories) and returns: agent