code: def _insert_model(self, query, request_env, mindsdb_env):
      predictors_columns = [
          "name",
          "status",
          "accuracy",
          "predict",
          "select_data_query",
          "training_options",
          "connection",
      ]
  
      if len(query["documents"]) != 1:
          raise Exception("Must be inserted just one predictor at time")
  
      for doc in query["documents"]:
          if "_id" in doc:
              del doc["_id"]
  
          action = doc.pop("action", "create").lower()
  
          bad_columns = [x for x in doc if x not in predictors_columns]
          if len(bad_columns) > 0:
              raise Exception(
                  f"Is no possible insert this columns to 'predictors' collection: {', '.join(bad_columns)}"
              )
  
          if "name" not in doc:
              raise Exception("Please, specify 'name' field")
  
          if "predict" not in doc:
              predict = None
              if action == "create":
                  raise Exception("Please, specify 'predict' field")
          else:
              predict = doc["predict"]
              if not isinstance(predict, list):
                  predict = [
                      Identifier(x.strip()) for x in predict.split(",")
                  ]
  
          order_by = None
          group_by = None
          ts_settings = {}
  
          kwargs = doc.get("training_options", {})
  
          if "timeseries_settings" in kwargs:
              ts_settings = kwargs.pop("timeseries_settings")
  
              # mongo shell client sends int as float. need to convert it to int
              for key in ("window", "horizon"):
                  val = ts_settings.get(key)
                  if val is not None:
                      ts_settings[key] = int(val)
  
              if "order_by" in ts_settings:
                  order_by = ts_settings["order_by"]
                  if not isinstance(order_by, list):
                      order_by = [order_by]
  
                  order_by = [OrderBy(Identifier(x)) for x in order_by]
              if "group_by" in ts_settings:
                  group_by = [
                      Identifier(x)
                      for x in ts_settings.get("group_by", [])
                  ]
  
          using = dict(kwargs)
  
          select_data_query = doc.get("select_data_query")
          integration_name = None
          if "connection" in doc:
              integration_name = Identifier(doc["connection"])
  
          Class = CreatePredictor
          if action == "retrain":
              Class = RetrainPredictor
          elif action == "finetune":
              Class = FinetunePredictor
  
          create_predictor_ast = Class(
              name=Identifier(
                  f"{request_env['database']}.{doc['name']}"
              ),
              integration_name=integration_name,
              query_str=select_data_query,
              targets=predict,
              order_by=order_by,
              group_by=group_by,
              window=ts_settings.get("window"),
              horizon=ts_settings.get("horizon"),
              using=using,
          )
  
          run_sql_command(request_env, create_predictor_ast)
  
file_path: mindsdb/mindsdb/api/mongo/responders/insert.py
imports: import pandas
  from mindsdb_sql.parser.ast import Constant, Identifier, Insert, OrderBy, TableColumn
  from mindsdb_sql.parser.dialects.mindsdb import CreateJob, CreateMLEngine, CreatePredictor, FinetunePredictor, RetrainPredictor
  import mindsdb.api.mongo.functions
  from mindsdb.api.mongo.classes import Responder
  from mindsdb.api.mongo.classes.query_sql import run_sql_command
  from mindsdb.api.mongo.responders.aggregate import aggregate_to_ast
  from mindsdb.api.mongo.responders.find import find_to_ast
  from mindsdb.api.mongo.utilities.mongodb_parser import MongodbParser
  from mindsdb.integrations.libs.response import HandlerStatusResponse
  from mindsdb.utilities import log
label_desc: Use image node_id 3 for calling the Responce obj's underlying member method code with example usage: obj._insert_model(query, request_env, mindsdb_env) without return types