code: def test_make_genai_metric_correct_response():
      custom_metric = make_genai_metric(
          name="correctness",
          version="v1",
          definition=example_definition,
          grading_prompt=example_grading_prompt,
          examples=[mlflow_example],
          model="gateway:/gpt-3.5-turbo",
          grading_context_columns=["targets"],
          parameters={"temperature": 0.0},
          greater_is_better=True,
          aggregations=["mean", "variance", "p90"],
      )
  
      assert [
          param.name
          for param in inspect.signature(
              custom_metric.eval_fn
          ).parameters.values()
      ] == ["predictions", "metrics", "inputs", "targets"]
  
      with mock.patch.object(
          model_utils,
          "score_model_on_payload",
          return_value=properly_formatted_openai_response1,
      ):
          metric_value = custom_metric.eval_fn(
              pd.Series([mlflow_prediction]),
              {},
              pd.Series(["What is MLflow?"]),
              pd.Series([mlflow_ground_truth]),
          )
  
      assert metric_value.scores == [3]
      assert metric_value.justifications == [openai_justification1]
  
      assert metric_value.aggregate_results == {
          "mean": 3,
          "variance": 0,
          "p90": 3,
      }
  
      custom_metric = make_genai_metric(
          name="fake_metric",
          version="v1",
          definition="Fake metric definition",
          grading_prompt="Fake metric grading prompt",
          examples=[
              EvaluationExample(
                  input="example-input",
                  output="example-output",
                  score=4,
                  justification="example-justification",
                  grading_context={"targets": "example-ground_truth"},
              )
          ],
          model="openai:/gpt-3.5-turbo",
          grading_context_columns=["targets"],
          greater_is_better=True,
      )
      with mock.patch.object(
          model_utils,
          "score_model_on_payload",
          return_value=properly_formatted_openai_response1,
      ) as mock_predict_function:
          metric_value = custom_metric.eval_fn(
              pd.Series(["prediction"]),
              {},
              pd.Series(["input"]),
              pd.Series(["ground_truth"]),
          )
          assert mock_predict_function.call_count == 1
          assert (
              mock_predict_function.call_args[0][0]
              == "openai:/gpt-3.5-turbo"
          )
          assert mock_predict_function.call_args[0][1] == (
              "\nTask:\nYou must return the following fields in your response in two "
              "lines, one below the other:\nscore: Your numerical score for the model's "
              "fake_metric "
              "based on the rubric\njustification: Your reasoning about the model's "
              "fake_metric "
              "score\n\nYou are an impartial judge. You will be given an input that was "
              "sent to a machine\nlearning model, and you will be given an output that the model "
              "produced. You\nmay also be given additional information that was used by the model "
              "to generate the output.\n\nYour task is to determine a numerical score called "
              "fake_metric based on the input and output.\nA definition of "
              "fake_metric and a grading rubric are provided below.\nYou must use the "
              "grading rubric to determine your score. You must also justify your score."
              "\n\nExamples could be included below for reference. Make sure to use them as "
              "references and to\nunderstand them before completing the task.\n"
              "\nInput:\ninput\n\nOutput:\nprediction\n\nAdditional information used by the model:\n"
              "key: targets\nvalue:\nground_truth\n\nMetric definition:\nFake metric definition\n\n"
              "Grading rubric:\nFake metric grading prompt\n\nExamples:\n\nExample Input:\n"
              "example-input\n\nExample Output:\nexample-output\n\nAdditional information used "
              "by the model:\nkey: targets\n"
              "value:\nexample-ground_truth\n\nExample score: 4\nExample justification: "
              "example-justification\n        \n\nYou must return the "
              "following fields in your response in two lines, one below the other:\nscore: Your "
              "numerical score for the model's fake_metric based on the rubric\njustification: "
              "Your "
              "reasoning about the model's fake_metric score\n\nDo not add additional new "
              "lines. Do "
              "not add any other fields.\n    "
          )
          assert mock_predict_function.call_args[0][2] == {
              "temperature": 0.0,
              "max_tokens": 200,
              "top_p": 1.0,
          }
          assert metric_value.scores == [3]
          assert metric_value.justifications == [openai_justification1]
          assert metric_value.aggregate_results == {
              "mean": 3.0,
              "p90": 3.0,
              "variance": 0.0,
          }
  
imports: import inspect
  import re
  from unittest import mock
  import numpy
  import pandas
  import pytest
  from mlflow.exceptions import MlflowException
  from mlflow.metrics.genai import EvaluationExample, model_utils
  from mlflow.metrics.genai.genai_metric import _extract_score_and_justification, _format_args_string, make_genai_metric
  from mlflow.metrics.genai.metric_definitions import answer_correctness, answer_relevance, answer_similarity, faithfulness, relevance
  from mlflow.metrics.genai.prompts.v1 import AnswerCorrectnessMetric, AnswerRelevanceMetric, AnswerSimilarityMetric, FaithfulnessMetric, RelevanceMetric
label_desc: Use image node_id 1 for calling a global function with example usage: test_make_genai_metric_correct_response() without return types