class_docstr: Represents a graph for training a model or making predictions.
class_docstr_tok: ["Represents","a","graph","for","training","a","model","or","making","predictions","."]
docstr: Returns graph schema in a serializable format.
  
  Returns:
      The graph schema in a format which can be dumped as JSON or other formats.
code: def as_dict(self) -> Dict[Text, Any]:
      """Returns graph schema in a serializable format.
  
      Returns:
          The graph schema in a format which can be dumped as JSON or other formats.
      """
      serializable_graph_schema: Dict[Text, Dict[Text, Any]] = {
          "nodes": {}
      }
      for node_name, node in self.nodes.items():
          serializable = dataclasses.asdict(node)
  
          # Classes are not JSON serializable (surprise)
          serializable[
              "uses"
          ] = f"{node.uses.__module__}.{node.uses.__name__}"
  
          serializable_graph_schema["nodes"][node_name] = serializable
  
      return serializable_graph_schema
  
imports: from __future__ import annotations
  import dataclasses
  from abc import ABC, abstractmethod
  from dataclasses import dataclass, field
  import logging
  from typing import Any, Callable, Dict, List, Optional, Text, Type, Tuple, Union
  from rasa.engine.exceptions import GraphComponentException, GraphRunError, GraphSchemaException
  import rasa.shared.utils.common
  import rasa.utils.common
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.shared.exceptions import InvalidConfigException, RasaException
  from rasa.shared.data import TrainingType
label_desc: Use image node_id 1 for calling the GraphSchema obj's underlying member method code with example usage: obj.as_dict() and returns: serializable_graph_schema