docstr: Observe a dialogue act.
  
  Use `actor_id` to indicate whether dialogue acts are from the 'apprentice' or
  the 'wizard' agent.
docstr_tok: ["Observe","a","dialogue","act",".","Use","`","actor_id","`","to","indicate","whether","dialogue","acts","are","from","the","'apprentice","'","or","the","'wizard","'","agent","."]
code: def observe(self, observation, actor_id="apprentice"):
      """
      Observe a dialogue act.
  
      Use `actor_id` to indicate whether dialogue acts are from the 'apprentice' or
      the 'wizard' agent.
      """
      if actor_id == "apprentice":
          self.observation = observation
      self.maintain_retriever_history(observation, actor_id=actor_id)
      if "labels" in observation or "eval_labels" in observation:
          labels = (
              "labels" if "labels" in observation else "eval_labels"
          )
          self.next_wizard = observation[labels][0]
      else:
          # NOTE: if we are in interactive mode, we need to make sure
          # to call observe again on the wizard's act
          self.next_wizard = None
  
imports: from typing import Optional
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.agents import Agent, create_agent, create_agent_from_shared
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  from parlai.tasks.wizard_of_wikipedia.agents import TOKEN_KNOWLEDGE
  from parlai.zoo.wizard_of_wikipedia.knowledge_retriever import download
  import json
  import os
label_desc: Use image node_id 13 for calling the KnowledgeRetrieverAgent obj's underlying member method code with example usage: obj.observe(observation, actor_id) without return types