pyrit.identifiers.EvaluationIdentity#

class EvaluationIdentity(identifier: ComponentIdentifier)[source]#

Bases: ABC

Wraps a ComponentIdentifier with domain-specific eval-hash configuration.

Subclasses must set the two ClassVar frozensets:

  • TARGET_CHILD_KEYS — child names whose operational params should be stripped (e.g., {"prompt_target", "converter_target"}).

  • BEHAVIORAL_CHILD_PARAMS — param allowlist applied to those target children (e.g., {"model_name", "temperature", "top_p"}).

The concrete eval_hash property delegates to the module-level compute_eval_hash free function.

__init__(identifier: ComponentIdentifier) None[source]#

Wrap a ComponentIdentifier and eagerly compute its eval hash.

Methods

__init__(identifier)

Wrap a ComponentIdentifier and eagerly compute its eval hash.

Attributes

eval_hash

Behavioral equivalence hash for evaluation grouping.

identifier

The underlying component identity.

TARGET_CHILD_KEYS

BEHAVIORAL_CHILD_PARAMS

BEHAVIORAL_CHILD_PARAMS: ClassVar[frozenset[str]]#
TARGET_CHILD_KEYS: ClassVar[frozenset[str]]#
property eval_hash: str#

Behavioral equivalence hash for evaluation grouping.

property identifier: ComponentIdentifier#

The underlying component identity.