Module Values.CustomMetricDefinitionSource

The definition of a custom metric for use in an Amazon Bedrock evaluation job. A custom metric definition includes a metric name, prompt (instructions) and optionally, a rating scale. Your prompt must include a task description and input variables. The required input variables are different for model-as-a-judge and RAG evaluations. For more information about how to define a custom metric in Amazon Bedrock, see Create a prompt for a custom metrics (LLM-as-a-judge model evaluations) and Create a prompt for a custom metrics (RAG evaluations).

Sourcetype nonrec t = {
  1. name : MetricName.t;
    (*

    The name for a custom metric. Names must be unique in your Amazon Web Services region.

    *)
  2. instructions : CustomMetricInstructions.t;
    (*

    The prompt for a custom metric that instructs the evaluator model how to rate the model or RAG source under evaluation.

    *)
  3. ratingScale : RatingScale.t option;
    (*

    Defines the rating scale to be used for a custom metric. We recommend that you always define a ratings scale when creating a custom metric. If you don't define a scale, Amazon Bedrock won't be able to visually display the results of the evaluation in the console or calculate average values of numerical scores. For more information on specifying a rating scale, see Specifying an output schema (rating scale).

    *)
}
Sourceval context_ : string
Sourceval make : ?ratingScale:??? -> name:MetricName.t -> instructions:CustomMetricInstructions.t -> unit -> t
Sourceval to_value : t -> [> `Structure of (string * [> `List of [> `Structure of (string * [> `String of RatingScaleItemDefinition.t | `Structure of (string * [> `Float of Float_.t | `String of RatingScaleItemValueStringValueString.t ]) list ]) list ] list | `String of MetricName.t ]) list ]
Sourceval to_query : t -> Awso.Client.Query.t
Sourceval of_xml : Awso.Xml.t -> t
Sourceval of_string : string -> t
Sourceval of_json : Yojson.Safe.t -> t
Sourceval to_json : t -> Yojson.Safe.t