code: def _save_internal_runnables(runnable, path, loader_fn, persist_dir):
      conf = {}
      if isinstance(runnable, lc_runnables_types()):
          conf[_MODEL_TYPE_KEY] = runnable.__class__.__name__
          conf.update(
              _save_runnables(runnable, path, loader_fn, persist_dir)
          )
      elif isinstance(runnable, lc_runnable_branch_type()):
          conf[_MODEL_TYPE_KEY] = runnable.__class__.__name__
          conf.update(
              _save_runnable_branch(
                  runnable, path, loader_fn, persist_dir
              )
          )
      elif isinstance(runnable, base_lc_types()):
          lc_model = _validate_and_wrap_lc_model(runnable, loader_fn)
          conf[_MODEL_TYPE_KEY] = lc_model.__class__.__name__
          conf.update(
              _save_base_lcs(lc_model, path, loader_fn, persist_dir)
          )
      else:
          conf = {
              _MODEL_TYPE_KEY: runnable.__class__.__name__,
              _MODEL_DATA_KEY: _MODEL_DATA_YAML_FILE_NAME,
              _MODEL_LOAD_KEY: _CONFIG_LOAD_KEY,
          }
          path = path / _MODEL_DATA_YAML_FILE_NAME
          # Save some simple runnables that langchain natively supports.
          if hasattr(runnable, "save"):
              runnable.save(path)
          # TODO: check if `dict` is enough to load it back
          elif hasattr(runnable, "dict"):
              runnable_dict = runnable.dict()
              with open(path, "w") as f:
                  yaml.dump(runnable_dict, f, default_flow_style=False)
          else:
              return
      return conf
  
file_path: mlflow/mlflow/langchain/runnables.py
imports: import os
  from pathlib import Path
  from typing import Union
  import cloudpickle
  import yaml
  from mlflow.exceptions import MlflowException
  from mlflow.langchain.utils import _BASE_LOAD_KEY, _CONFIG_LOAD_KEY, _MODEL_DATA_FOLDER_NAME, _MODEL_DATA_KEY, _MODEL_DATA_PKL_FILE_NAME, _MODEL_DATA_YAML_FILE_NAME, _MODEL_LOAD_KEY, _MODEL_TYPE_KEY, _RUNNABLE_LOAD_KEY, _UNSUPPORTED_MODEL_ERROR_MESSAGE, _load_base_lcs, _load_from_json, _load_from_pickle, _load_from_yaml, _save_base_lcs, _validate_and_wrap_lc_model, base_lc_types, custom_type_to_loader_dict, lc_runnable_branch_type, lc_runnable_with_steps_types, lc_runnables_types, picklable_runnable_types
label_desc: Use image node_id 6 for calling a global function with example usage: _save_internal_runnables(runnable, path, loader_fn, persist_dir) and returns: conf