class_docstr: This class was reporting a few too many metrics, but is useful for test purposes, so
  we're keeping it around.
  
  `AllGoalApiCallSuccessMetricsHandler` is the streamlined, less spammy version of
  this class.
code: def get_episode_metrics(self) -> Optional[Dict[str, Metric]]:
      (
          all_goals_hit,
          all_goals_hit_turn_count,
          all_part_hit,
      ) = goals_hit_helper(self.goals, self.api_turns)
      all_precision, all_recall = goals_slots_helper(
          self.goals, self.api_turns
      )
      (
          req_goals_hit,
          req_goals_hit_turn_count,
          req_part_hit,
      ) = goals_hit_helper(
          self.required_goals, self.api_turns, permissive=True
      )
      req_precision, req_recall = goals_slots_helper(
          self.required_goals, self.api_turns
      )
      call_attempts = len(self.api_turns)
      return {
          "all_goals_hit": all_goals_hit,
          "all_goals_hit_turn_count": all_goals_hit_turn_count,
          "all_goals_fractional_hit": all_part_hit,
          "all_goals_slot_precision": all_precision,
          "all_goals_slot_recall": all_recall,
          "req_goals_hit": req_goals_hit,
          "req_goals_hit_turn_count": req_goals_hit_turn_count,
          "req_goals_fractional_hit": req_part_hit,
          "req_goals_slot_precision": req_precision,
          "req_goals_slot_recall": req_recall,
          "call_attempts": AverageMetric(call_attempts),
      }
  
imports: from parlai.core.message import Message
  from parlai.core.metrics import Metric, AverageMetric, normalize_answer, BleuMetric, SumMetric
  from parlai.core.tod.tod_core import STANDARD_API_NAME_SLOT, STANDARD_REQUIRED_KEY, STANDARD_OPTIONAL_KEY, STANDARD_API_SCHEMAS
  from typing import Dict, List, Optional, Tuple
  from parlai.core.tod.world_metrics_handlers import TodMetricsHandler, register_metrics_handler, _ApiCallGoalInteractionHelper, goals_hit_helper
label_desc: Use image node_id 2 for calling the LegacyGoalApiCallInteractionsMetricsHandler obj's underlying member method code with example usage: obj.get_episode_metrics() and returns: dict