class_docstr: Helper container which encapsulates TOD metrics and does some basic prepocessing to
  handlers to calculate said metrics.
  
  This class should generally not need to be changed; add new metrics handlers to
  `WORLD_METRIC_HANDLERS` (or otherwise override `self.handlers` of this class) to
  change metrics actively being used.
class_docstr_tok: ["Helper","container","which","encapsulates","TOD","metrics","and","does","some","basic","prepocessing","to","handlers","to","calculate","said","metrics",".","This","class","should","generally","not","need","to","be","changed",";","add","new","metrics","handlers","to","`","WORLD_METRIC_HANDLERS","`","(","or","otherwise","override","`","self.handlers","`","of","this","class",")","to","change","metrics","actively","being","used","."]
code: def _handle_message_impl(
      self,
      message: Message,
      agent_type: TodAgentType,
      handler: world_metrics_handlers.TodMetricsHandler,
  ):
      prefix_stripped_text = message["text"].replace(
          TOD_AGENT_TYPE_TO_PREFIX[agent_type], ""
      )
      if agent_type is TodAgentType.API_SCHEMA_GROUNDING_AGENT:
          return handler.handle_api_schemas(
              message,
              SerializationHelpers.str_to_api_schemas(
                  prefix_stripped_text
              ),
          )
      if agent_type is TodAgentType.GOAL_GROUNDING_AGENT:
          return handler.handle_goals(
              message,
              SerializationHelpers.str_to_goals(prefix_stripped_text),
          )
      if agent_type is TodAgentType.USER_UTT_AGENT:
          return handler.handle_user_utt(message, prefix_stripped_text)
      if agent_type is TodAgentType.API_CALL_AGENT:
          return handler.handle_api_call(
              message,
              SerializationHelpers.str_to_api_dict(
                  prefix_stripped_text
              ),
          )
      if agent_type is TodAgentType.API_RESP_AGENT:
          return handler.handle_api_resp(
              message,
              SerializationHelpers.str_to_api_dict(
                  prefix_stripped_text
              ),
          )
      if agent_type is TodAgentType.SYSTEM_UTT_AGENT:
          return handler.handle_sys_utt(message, prefix_stripped_text)
  
file_path: ParlAI/parlai/core/tod/world_metrics.py
imports: from parlai.core.message import Message
  from parlai.core.metrics import Metrics
  from parlai.core.tod.tod_core import TodAgentType, TOD_AGENT_TYPE_TO_PREFIX, SerializationHelpers, STANDARD_GOAL
  from typing import Any, Dict
  import parlai.core.tod.world_metrics_handlers
label_desc: Use image node_id 3 for calling the TodMetrics obj's underlying member method code with example usage: obj._handle_message_impl(message, agent_type, handler) and returns: handler, handler, handler, handler, handler, handler