class_docstr: Checks that the Knowledge Retriever module returns the correct results.
class_docstr_tok: ["Checks","that","the","Knowledge","Retriever","module","returns","the","correct","results","."]
code: def test_knowledge_retriever(self):
      from parlai.core.params import ParlaiParser
  
      parser = ParlaiParser(False, False)
      KnowledgeRetrieverAgent.add_cmdline_args(parser, partial_opt=None)
      parser.set_params(
          model="projects:wizard_of_wikipedia:knowledge_retriever",
          add_token_knowledge=True,
      )
      knowledge_opt = parser.parse_args([])
      knowledge_agent = create_agent(knowledge_opt)
  
      knowledge_agent.observe(
          {
              "text": "what do you think of mountain dew?",
              "chosen_topic": "Mountain Dew",
              "episode_done": False,
          }
      )
  
      knowledge_act = knowledge_agent.act()
  
      title = knowledge_act["title"]
      self.assertEqual(
          title, "Mountain Dew", "Did not save chosen topic correctly"
      )
  
      knowledge = knowledge_act["text"]
      self.assertIn(
          TOKEN_KNOWLEDGE,
          knowledge,
          "Knowledge token was not inserted correctly",
      )
  
      checked_sentence = knowledge_act["checked_sentence"]
      self.assertEqual(
          checked_sentence,
          "Mountain Dew (stylized as Mtn Dew) is a carbonated soft drink brand produced and owned by PepsiCo.",
          "Did not correctly choose the checked sentence",
      )
  
file_path: ParlAI/tests/nightly/gpu/test_wizard.py
imports: from parlai.core.agents import create_agent
  import unittest
  import parlai.scripts.display_data
  from parlai.tasks.wizard_of_wikipedia.agents import TOKEN_KNOWLEDGE
  import parlai.utils.testing
  from projects.wizard_of_wikipedia.knowledge_retriever.knowledge_retriever import KnowledgeRetrieverAgent
label_desc: Use image node_id 1 for calling the TestKnowledgeRetriever obj's underlying member method code with example usage: obj.test_knowledge_retriever() without return types