nat.data_models.evaluator#
Evaluation input data models and evaluator configs.
Attributes#
Classes#
Subclass of Pydantic BaseModel that allows for specifying the object type. Use in Pydantic discriminated unions. |
|
Base config for evaluators that use an LLM as a judge. |
|
A single input item for evaluation. |
|
Container for evaluation input items. |
|
Structural contract for a single evaluation output item. |
|
Structural contract for a collection of evaluation output items. |
Module Contents#
- class EvaluatorBaseConfig(/, **data: Any)#
Bases:
nat.data_models.common.TypedBaseModel,nat.data_models.common.BaseModelRegistryTagSubclass of Pydantic BaseModel that allows for specifying the object type. Use in Pydantic discriminated unions.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.
- class EvaluatorLLMConfig(/, **data: Any)#
Bases:
EvaluatorBaseConfig,nat.data_models.retry_mixin.RetryMixinBase config for evaluators that use an LLM as a judge.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.
- EvaluatorBaseConfigT#
- class EvalInputItem(/, **data: Any)#
Bases:
pydantic.BaseModelA single input item for evaluation.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- id: Any = None#
- input_obj: Any = None#
- expected_output_obj: Any = None#
- output_obj: Any = None#
- expected_trajectory: list[nat.data_models.intermediate_step.IntermediateStep] = None#
- trajectory: list[nat.data_models.intermediate_step.IntermediateStep] = None#
- full_dataset_entry: Any = None#
- copy_with_updates(**updates) EvalInputItem#
Copy EvalInputItem with optional field updates.
- class EvalInput(/, **data: Any)#
Bases:
pydantic.BaseModelContainer for evaluation input items.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- eval_input_items: list[EvalInputItem] = None#
- class EvalOutputItemLike#
Bases:
ProtocolStructural contract for a single evaluation output item.
- id: Any#
- score: Any#
- reasoning: Any#
- class EvalOutputLike#
Bases:
ProtocolStructural contract for a collection of evaluation output items.
- average_score: Any#
- eval_output_items: collections.abc.Sequence[EvalOutputItemLike]#