class_docstr: Subclass BlenderBot2RagAgent to provide MemoryModel with appropriate inputs
  (specifically, memory vectors).
class_docstr_tok: ["Subclass","BlenderBot2RagAgent","to","provide","MemoryModel","with","appropriate","inputs","(","specifically",",","memory","vectors",")","."]
docstr: Override RAG.set_query_vec to optionally filter keys.
docstr_tok: ["Override","RAG.set_query_vec","to","optionally","filter","keys","."]
code: def _set_query_vec(self, observation: Message) -> Message:
      """
      Override RAG.set_query_vec to optionally filter keys.
      """
      query_str = observation[self._query_key]
      if self.opt["retriever_ignore_phrases"]:
          retriever_ignore_phrases = self.opt[
              "retriever_ignore_phrases"
          ].split(",")
          for retriever_ignore_phrase in retriever_ignore_phrases:
              query_str = self._filter_text(
                  query_str,
                  retriever_ignore_phrase,
                  delimiter=self.opt["retriever_delimiter"],
              )
      model = self.model
      if isinstance(model, torch.nn.parallel.DistributedDataParallel):
          model = self.model.module
      observation["query_vec"] = model.tokenize_query(query_str)  # type: ignore
      return observation
  
imports: from typing import Optional, Union
  from parlai.core.message import Message
  from parlai.core.opt import Opt
  from parlai.core.params import ParlaiParser
  from projects.blenderbot2.agents.sub_modules import KnowledgeAccessMethod
  from projects.blenderbot2.agents.modules import T5BlenderBot2RagModel, BlenderBot2RagModel, T5BlenderBot2FidModel, BlenderBot2FidModel, BlenderBot2FidModelMixin
  import torch
  from projects.blenderbot2.agents.blenderbot2 import BlenderBot2RagAgent
  from .long_rag import LongRagAgent, LongRagModel, LongFidAgent, LongFidModel
label_desc: Use image node_id 2 for calling the MemoryRagAgent obj's underlying member method code with example usage: obj._set_query_vec(observation) and returns: observation