Metric
Create Metric
Create a metric type for evaluating your products.
Returns
Returns a MetricType object for the given parameters, or None
if an error occurs.
Example
Parameters
The name of the metric.
A list of strings indicating which parameters are relevant for this metric’s evaluation criteria or steps. If not provided, the metric will apply to tasks without specific parameter matching. Allowed values are:
"input"
(The prompt or query sent to the model)"actual output"
(The actual output generated by the model)"expected output"
(The ideal answer for the given input)"context"
(Additional background information provided to the model)"retrieval context"
(The context retrieved by your RAG system)
The criteria for the metric.
The evaluation steps for the metric.
You need to provide either Criteria or Evaluation Steps, but not both. Your choice depends on your preferred evaluation approach.