Returns
Returns a Metric object for the given parameters, orNone if an error occurs.
Examples
- AI Evaluation
- Human Evaluation
- Self-Hosted
Parameters
The name of the metric.
The name of the model used to evaluate the metric. Required for metrics using
judge_prompt.Available models:"Claude-Sonnet-4.0""Claude-Sonnet-3.7""GPT-4.1-mini""Gemini-2.5-Flash-Lite""Gemini-2.5-Flash""Gemini-2.0-flash""GPT-4o""GPT-4.1"
It should not be provided if the metric is “self hosted” (has no
judge_prompt) since it does not require a model for evaluation.A custom prompt that defines the evaluation logic for the metric. For AI Evaluation metrics, write the evaluation criteria and scoring rubric — Galtea will prepend the selected
evaluation_params automatically. For Human Evaluation metrics, this serves as the annotation rubric. If omitted, the metric is considered a deterministic “Custom Score” metric.The evaluation method for the metric. Possible values:
"partial_prompt"— AI Evaluation: You provide the core evaluation criteria and rubric. Galtea dynamically constructs the final prompt by prepending selected evaluation parameters to your criteria."human_evaluation"— Human Evaluation: Human annotators manually review and score evaluations using the annotation criteria you define. Evaluations enter aPENDING_HUMANstatus and are completed when an annotator submits a score."self_hosted"— Self-Hosted: For deterministic metrics scored locally using the SDK’sCustomScoreEvaluationMetric. Your custom logic runs on your infrastructure, and the resulting score is uploaded to the platform.
Evaluation parameters to include in the judge prompt. These parameters are prepended to the judge prompt to construct the final evaluation prompt.
To check the available evaluation parameters, see the Evaluation Parameters section.
Only applicable for AI Evaluation and Human Evaluation metrics.
A list of user group IDs to associate with this metric. Only applicable when
source is human_evaluation.- If user group IDs are specified, only users in those groups can annotate evaluations for this metric.
- If no user group IDs are specified, any user in the organization can annotate.
Tags to categorize the metric.
A brief description of what the metric evaluates.
A URL pointing to more detailed documentation about the metric.