Returns

Returns a MetricType object for the given parameters, or None if an error occurs.

Example

metric = galtea.metrics.create(
    name="accuracy_v1",
    criteria="Determine whether the actual output is equivalent to the expected output.",
    evaluation_params=["input", "expected output", "actual output"],
)

Parameters

name
string
required

The name of the metric.

evaluation_params
list[string]

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)
criteria
string
required

The criteria for the metric.

evaluation_steps
list[string]
required

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.