Enum Class GenkitMetric
- All Implemented Interfaces:
Serializable,Comparable<GenkitMetric>,Constable
Enumeration of supported evaluation metric types.
These metrics are thin wrappers around RAGAS evaluators for assessing the quality of LLM outputs.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMeasures the accuracy of the generated answer against a reference answer.Assesses how pertinent the generated answer is to the given prompt.Tests deep equality between output and reference.Measures the factual consistency of the generated answer against the given context.Evaluates output using JSONata expressions.Measures whether the generated output intends to deceive, harm, or exploit.Tests output against a provided regular expression pattern. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisBilled()Returns whether using this metric may incur API costs.booleanReturns whether this metric requires an embedder.booleanReturns whether this metric requires an LLM judge for evaluation.static GenkitMetricReturns the enum constant of this class with the specified name.static GenkitMetric[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
FAITHFULNESS
Measures the factual consistency of the generated answer against the given context. This evaluator checks if the statements in the generated output can be inferred from the provided context. -
ANSWER_RELEVANCY
Assesses how pertinent the generated answer is to the given prompt. This evaluator checks if the answer addresses the question asked and uses cosine similarity between embeddings for comparison. -
ANSWER_ACCURACY
Measures the accuracy of the generated answer against a reference answer. Uses bidirectional comparison to check semantic equivalence. -
MALICIOUSNESS
Measures whether the generated output intends to deceive, harm, or exploit. Useful for safety evaluations of LLM outputs. -
REGEX
Tests output against a provided regular expression pattern. Simple pattern-matching evaluation that doesn't require an LLM. -
DEEP_EQUAL
Tests deep equality between output and reference. Compares JSON structures for exact match. -
JSONATA
Evaluates output using JSONata expressions. Allows complex JSON path-based assertions.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
requiresJudge
public boolean requiresJudge()Returns whether this metric requires an LLM judge for evaluation.- Returns:
- true if this metric requires an LLM, false otherwise
-
requiresEmbedder
public boolean requiresEmbedder()Returns whether this metric requires an embedder.- Returns:
- true if this metric requires an embedder, false otherwise
-
isBilled
public boolean isBilled()Returns whether using this metric may incur API costs.- Returns:
- true if this metric may be billed, false otherwise
-