class_docstr: WriterHandler is a MindsDB integration with Writer API LLMs that allows users to run question answering
  on their data by providing a question.
  
  The User is able to provide data that provides context for the questions, see create() method for more details.
class_docstr_tok: ["WriterHandler","is","a","MindsDB","integration","with","Writer","API","LLMs","that","allows","users","to","run","question","answering","on","their","data","by","providing","a","question",".","The","User","is","able","to","provide","data","that","provides","context","for","the","questions",",","see","create","(",")","method","for","more","details","."]
code: def evaluate(self, args: WriterHandlerParameters):
      if isinstance(args.evaluate_dataset, list):
          # if user provides a list of dicts, convert to dataframe and validate
          evaluate_df = validate_dataframe(
              pd.DataFrame(args.evaluate_dataset), EVAL_COLUMN_NAMES
          )
      else:
          evaluate_df = load_dataset(
              ml_task_type="question_answering",
              dataset_name=args.evaluate_dataset,
          )
          args.context_columns = "context"
  
      if args.n_rows_evaluation:
          # if user specifies n_rows_evaluation in create, only use that many rows
          evaluate_df = evaluate_df.head(args.n_rows_evaluation)
  
      ingestor = WriterIngestor(df=evaluate_df, args=args)
      ingestor.embeddings_to_vectordb()
  
      evaluator = WriterEvaluator(
          args=args, df=evaluate_df, rag=QuestionAnswerer
      )
      df = evaluator.evaluate()
  
      evaluation_metrics = dict(
          mean_evaluation_metrics=evaluator.mean_evaluation_metrics,
          evaluation_df=df.to_dict(orient="records"),
      )
  
      self.model_storage.json_set("evaluation", evaluation_metrics)
  
      return df
  
file_path: mindsdb/mindsdb/integrations/handlers/writer_handler/writer_handler.py
imports: from typing import Dict, Optional
  import pandas
  from mindsdb.integrations.handlers.writer_handler.evaluate import WriterEvaluator
  from mindsdb.integrations.handlers.writer_handler.ingest import WriterIngestor
  from mindsdb.integrations.handlers.writer_handler.rag import QuestionAnswerer
  from mindsdb.integrations.handlers.writer_handler.settings import DEFAULT_EMBEDDINGS_MODEL, EVAL_COLUMN_NAMES, WriterHandlerParameters, WriterLLMParameters
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.integrations.utilities.datasets.dataset import load_dataset, validate_dataframe
  from mindsdb.utilities import log
label_desc: Use image node_id 5 for calling the WriterHandler obj's underlying member method code with example usage: obj.evaluate(args) and returns: df