kiln_ai.adapters.eval.registry
1from kiln_ai.adapters.eval.base_eval import BaseEval 2from kiln_ai.adapters.eval.g_eval import GEval 3from kiln_ai.datamodel.eval import EvalConfigType 4from kiln_ai.utils.exhaustive_error import raise_exhaustive_enum_error 5 6 7def eval_adapter_from_type(eval_config_type: EvalConfigType) -> type[BaseEval]: 8 match eval_config_type: 9 case EvalConfigType.g_eval: 10 return GEval 11 case EvalConfigType.llm_as_judge: 12 # Also implemented by GEval 13 return GEval 14 case _: 15 # type checking will catch missing cases 16 raise_exhaustive_enum_error(eval_config_type)
def
eval_adapter_from_type( eval_config_type: kiln_ai.datamodel.eval.EvalConfigType) -> type[kiln_ai.adapters.eval.base_eval.BaseEval]:
8def eval_adapter_from_type(eval_config_type: EvalConfigType) -> type[BaseEval]: 9 match eval_config_type: 10 case EvalConfigType.g_eval: 11 return GEval 12 case EvalConfigType.llm_as_judge: 13 # Also implemented by GEval 14 return GEval 15 case _: 16 # type checking will catch missing cases 17 raise_exhaustive_enum_error(eval_config_type)