class_docstr: Integration with the Cohere Python Library
class_docstr_tok: ["Integration","with","the","Cohere","Python","Library"]
code: def predict(
      self,
      df: Optional[pd.DataFrame] = None,
      args: Optional[Dict] = None,
  ) -> None:
      args = self.model_storage.json_get("args")
  
      input_keys = list(args.keys())
  
      logger.info(f"Input keys: {input_keys}!")
  
      input_column = args["using"]["column"]
  
      if input_column not in df.columns:
          raise RuntimeError(
              f'Column "{input_column}" not found in input data'
          )
  
      result_df = pd.DataFrame()
  
      if args["using"]["task"] == "text-summarization":
          result_df["predictions"] = df[input_column].apply(
              self.predict_text_summary
          )
  
      elif args["using"]["task"] == "text-generation":
          result_df["predictions"] = df[input_column].apply(
              self.predict_text_generation
          )
  
      elif args["using"]["task"] == "language-detection":
          result_df["predictions"] = df[input_column].apply(
              self.predict_language
          )
  
      else:
          raise Exception(
              f"Task {args['using']['task']} is not supported!"
          )
  
      result_df = result_df.rename(
          columns={"predictions": args["target"]}
      )
  
      return result_df
  
file_path: mindsdb/mindsdb/integrations/handlers/cohere_handler/cohere_handler.py
imports: import os
  from typing import Optional, Dict
  import cohere
  import pandas
  from mindsdb.utilities.config import Config
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.utilities import log
label_desc: Use image node_id 2 for calling the CohereHandler obj's underlying member method code with example usage: obj.predict(df, args) and returns: result_df