code: def convert_rating_to_enum(rating: dict) -> SafetyRatingDict:
      return {
          "category": HarmCategory(rating["category"]),
          "probability": HarmProbability(rating["probability"]),
      }
  
imports: from __future__ import annotations
  from collections.abc import Mapping
  import typing
  from typing import Dict, Iterable, List, Union
  from typing_extensions import TypedDict
  from google.ai import generativelanguage
  from google.generativeai import string_utils
label_desc: Use image node_id 6 for calling a global function with example usage: convert_rating_to_enum(rating) and returns: dict