code: def _load_base_lcs(
      local_model_path,
      conf,
  ):
      lc_model_path = os.path.join(
          local_model_path,
          conf.get(_MODEL_DATA_KEY, _MODEL_DATA_YAML_FILE_NAME),
      )
  
      agent_path = _get_path_by_key(
          local_model_path, _AGENT_DATA_KEY, conf
      )
      tools_path = _get_path_by_key(
          local_model_path, _TOOLS_DATA_KEY, conf
      )
      agent_primitive_path = _get_path_by_key(
          local_model_path, _AGENT_PRIMITIVES_DATA_KEY, conf
      )
      loader_fn_path = _get_path_by_key(
          local_model_path, _LOADER_FN_KEY, conf
      )
      persist_dir = _get_path_by_key(
          local_model_path, _PERSIST_DIR_KEY, conf
      )
  
      model_type = conf.get(_MODEL_TYPE_KEY)
      loader_arg = conf.get(_LOADER_ARG_KEY)
  
      from langchain.chains.loading import load_chain
  
      from mlflow.langchain.retriever_chain import _RetrieverChain
  
      if loader_arg is not None:
          if loader_fn_path is None:
              raise mlflow.MlflowException.invalid_parameter_value(
                  "Missing file for loader_fn which is required to build the model."
              )
          loader_fn = _load_from_pickle(loader_fn_path)
          kwargs = {loader_arg: loader_fn(persist_dir)}
          if model_type == _RetrieverChain.__name__:
              model = _RetrieverChain.load(
                  lc_model_path, **kwargs
              ).retriever
          else:
              model = load_chain(lc_model_path, **kwargs)
      elif agent_path is None and tools_path is None:
          model = load_chain(lc_model_path)
      else:
          from langchain.agents import initialize_agent
  
          llm = load_chain(lc_model_path)
          tools = []
          kwargs = {}
  
          if os.path.exists(tools_path):
              tools = _load_from_pickle(tools_path)
          else:
              raise mlflow.MlflowException(
                  "Missing file for tools which is required to build the AgentExecutor object."
              )
  
          if os.path.exists(agent_primitive_path):
              kwargs = _load_from_json(agent_primitive_path)
  
          model = initialize_agent(
              tools=tools, llm=llm, agent_path=agent_path, **kwargs
          )
      return model
  
imports: import json
  import logging
  import os
  import shutil
  import types
  from functools import lru_cache
  from importlib.util import find_spec
  from typing import Any, List, NamedTuple, Optional
  import cloudpickle
  import yaml
  from packaging import version
  import mlflow
  from mlflow.utils.class_utils import _get_class_from_string
label_desc: Use image node_id 18 for calling a global function with example usage: _load_base_lcs(local_model_path, conf) and returns: model