class_docstr: Generate bot utterances based on a dialogue state.
class_docstr_tok: ["Generate","bot","utterances","based","on","a","dialogue","state","."]
docstr: Factory to create a generator.
docstr_tok: ["Factory","to","create","a","generator","."]
code: def create(
      obj: Union["NaturalLanguageGenerator", EndpointConfig, None],
      domain: Optional[Domain],
  ) -> "NaturalLanguageGenerator":
      """Factory to create a generator."""
      if isinstance(obj, NaturalLanguageGenerator):
          return obj
      else:
          return _create_from_endpoint_config(obj, domain)
  
file_path: rasa/rasa/core/nlg/generator.py
imports: import logging
  from typing import List, Optional, Union, Text, Any, Dict
  import rasa.shared.utils.common
  import rasa.shared.utils.io
  from rasa.shared.constants import CHANNEL, RESPONSE_CONDITION
  from rasa.shared.core.domain import Domain
  from rasa.utils.endpoints import EndpointConfig
  from rasa.shared.core.trackers import DialogueStateTracker
label_desc: Use image node_id 1 for calling the NaturalLanguageGenerator obj's underlying member method code with example usage: obj.create(obj, domain) and returns: obj, _create_from_endpoint_config