Skip to main content
The Metrics Service in the Galtea SDK allows you to manage metrics for evaluating your products. This Service is exposed by the galtea.metrics object.
Remember that we will be using the galtea object. More information here.

Quick Example

First, initialize the Galtea SDK:
galtea = Galtea(api_key="YOUR_API_KEY")
Create a metric:
metric = galtea.metrics.create(
    name=metric_name,
    test_type="ACCURACY",
    evaluator_model_name="GPT-4.1",
    source="partial_prompt",
    judge_prompt="Evaluate if the actual_output is polite.",
    evaluation_params=["actual_output"],
    description="Checks politeness",
)
List all metrics:
metrics = galtea.metrics.list(limit=20)
Get a metric by name:
metric = galtea.metrics.get_by_name(name=metric_name)

Service Methods

Metric

Ways to evaluate and score product performance