class_docstr: Integration with the Nixtla TimeGPT models for
  zero-shot time series forecasting.
class_docstr_tok: ["Integration","with","the","Nixtla","TimeGPT","models","for","zero-shot","time","series","forecasting","."]
docstr: Create the TimeGPT Handler.
  Requires specifying the target column and usual time series arguments. Saves model config for later usage.
docstr_tok: ["Create","the","TimeGPT","Handler",".","Requires","specifying","the","target","column","and","usual","time","series","arguments",".","Saves","model","config","for","later","usage","."]
code: def create(
      self,
      target: str,
      df: Optional[pd.DataFrame] = None,
      args: Optional[Dict] = None,
  ) -> None:
      """
      Create the TimeGPT Handler.
      Requires specifying the target column and usual time series arguments. Saves model config for later usage.
      """
      self.generative = True
      time_settings = args.get("timeseries_settings", {})
      using_args = args["using"]
  
      mode = "forecasting"
      if args.get("__mdb_sql_task", False) and args[
          "__mdb_sql_task"
      ].lower() in ("forecasting", "anomalydetection"):
          mode = args["__mdb_sql_task"].lower()
  
      if mode == "forecasting":
          assert time_settings[
              "is_timeseries"
          ], "Specify time series settings in your query"
  
      model_args = {
          "token": get_api_key(
              "TIMEGPT_TOKEN",
              using_args,
              self.engine_storage,
              strict=True,
          ),
          "target": target,
          "freq": using_args.get("frequency", None),
          "finetune_steps": using_args.get("finetune_steps", 0),
          "validate_token": using_args.get("validate_token", False),
          "date_features": using_args.get("date_features", False),
          "date_features_to_one_hot": using_args.get(
              "date_features_to_one_hot", True
          ),
          "clean_ex_first": using_args.get("clean_ex_first", True),
          "level": using_args.get("level", [90]),
          "add_history": using_args.get("add_history", False),
          "mode": mode,
      }
  
      if time_settings:
          model_args["horizon"] = time_settings["horizon"]
          model_args["order_by"] = time_settings["order_by"]
          model_args["group_by"] = time_settings.get("group_by", [])
  
      if mode == "anomalydetection":
          model_args["target"] = (
              using_args["target"] if target is None else target
          )
          model_args["horizon"] = using_args.get("horizon", 1)
          model_args["order_by"] = using_args["order_by"]
          model_args["group_by"] = using_args.get("group_by", [])
          model_args["add_history"] = True
  
      assert isinstance(
          model_args["level"], list
      ), "`level` must be a list of integers"
      assert all(
          [isinstance(l, int) for l in model_args["level"]]
      ), "`level` must be a list of integers"
  
      self.model_storage.json_set("model_args", model_args)
  
file_path: mindsdb/mindsdb/integrations/handlers/timegpt_handler/timegpt_handler.py
imports: from typing import Optional, Dict
  import pandas
  from nixtlats import TimeGPT
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.integrations.utilities.handler_utils import get_api_key
  from mindsdb.integrations.utilities.time_series_utils import get_results_from_nixtla_df
label_desc: Use image node_id 1 for calling the TimeGPTHandler obj's underlying member method code with example usage: obj.create(target, df, args) without return types