class_docstr: Uses the gold retrieved docs (documents shown to crowdsourcing agents).
  
  This FiD agents has a mock retriever that picks the retrieved docs from the observed
  example.
class_docstr_tok: ["Uses","the","gold","retrieved","docs","(","documents","shown","to","crowdsourcing","agents",")",".","This","FiD","agents","has","a","mock","retriever","that","picks","the","retrieved","docs","from","the","observed","example","."]
code: def __init__(self, opt: Opt, shared: TShared = None):
      opt = deepcopy(opt)
      opt[
          "rag_retriever_type"
      ] = RetrieverType.OBSERVATION_ECHO_RETRIEVER.value
      self._n_docs = opt["n_docs"]
      if opt["rag_retriever_query"] != "full_history":
          prev_sel = opt["rag_retriever_query"]
          opt["rag_retriever_query"] = "full_history"
          logging.warning(
              'GoldDocRetrieverFiDAgent only works with `rag_retriever_query` being `"full_history"`. '
              f'Changing opt value for `rag_retriever_query`: `"{prev_sel}"` -> `"full_history"`'
          )
      if not (
          opt["dynamic_batching"] in [None, "off"]
          and opt.get("eval_dynamic_batching") in [None, "off"]
      ):
          raise RuntimeError(
              "For now dynamic batching doesn't work with ObservationEchoRetriever as it cleans up _saved_docs mapping after each batch act."
          )
      super().__init__(opt, shared=shared)
  
imports: from abc import abstractmethod
  from copy import deepcopy
  import torch
  import random
  from typing import Tuple, Union, Optional, List, Dict, Any
  from parlai.core.dict import DictionaryAgent
  from parlai.core.opt import Opt
  from parlai.core.message import Message
  from parlai.agents.transformer.transformer import TransformerGeneratorModel
  from parlai.agents.rag.args import RetrieverType
  from parlai.agents.rag.modules import RagModel, Document, T5RagModel
  from parlai.agents.rag.rag import RagAgent
  from parlai.agents.rag.model_types import RagToken, get_forced_decoder_inputs, fix_incremental_state
  from parlai.utils.typing import TShared
  import parlai.utils.logging
  from parlai.tasks.wizard_of_internet import constants
label_desc: Use image node_id 1 to create a new GoldDocRetrieverFiDAgent object from inherited base classes: SearchQueryFiDAgent with example: obj = GoldDocRetrieverFiDAgent(opt, shared)