nat.eval.red_teaming_evaluator.filter_conditions#
Classes#
Filter conditions for selecting intermediate steps from a trajectory. |
Module Contents#
- class IntermediateStepsFilterCondition(/, **data: Any)#
Bases:
pydantic.BaseModelFilter conditions for selecting intermediate steps from a trajectory.
This model encapsulates the filtering logic used to select specific intermediate steps for evaluation. Multiple filter conditions can be defined to evaluate different parts of a trajectory separately.
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.- event_type: nat.data_models.intermediate_step.IntermediateStepType | str | None = None#
- filter_trajectory(
- trajectory: list[nat.data_models.intermediate_step.IntermediateStep],
Filter a trajectory based on these conditions.
- Args:
trajectory: List of intermediate steps to filter
- Returns:
List of filtered intermediate steps matching the conditions
- classmethod default() IntermediateStepsFilterCondition#