1414"""
1515
1616import logging
17- import warnings
1817from typing import TYPE_CHECKING , Any , Optional
1918
19+ from pyrit .common .deprecation import print_deprecation_message
2020from pyrit .executor .attack import AttackExecutor , AttackStrategy
2121from pyrit .executor .attack .core .attack_executor import AttackExecutorResult
2222from pyrit .identifiers import build_atomic_attack_identifier
@@ -74,8 +74,8 @@ def __init__(
7474 to ``atomic_attack_name``.
7575 attack_technique: An AttackTechnique bundling the attack strategy and optional
7676 technique seeds. Preferred over the deprecated ``attack`` parameter.
77- attack: Deprecated. The configured attack strategy to execute. Use
78- ``attack_technique`` instead.
77+ attack: ** Deprecated.** Will be removed in v0.16.0. The configured attack
78+ strategy to execute. Use ``attack_technique`` instead.
7979 seed_groups: List of seed attack groups. Each seed group must
8080 have an objective set.
8181 adversarial_chat: Optional chat target for generating
@@ -99,10 +99,10 @@ def __init__(
9999 if attack_technique is not None :
100100 self ._attack_technique = attack_technique
101101 elif attack is not None :
102- warnings . warn (
103- "The 'attack' parameter is deprecated. Use 'attack_technique=AttackTechnique (attack=...)' instead. " ,
104- DeprecationWarning ,
105- stacklevel = 2 ,
102+ print_deprecation_message (
103+ old_item = "AtomicAttack (attack=...)" ,
104+ new_item = "AtomicAttack(attack_technique=AttackTechnique(attack=...))" ,
105+ removed_in = "0.16.0" ,
106106 )
107107 self ._attack_technique = AttackTechnique (attack = attack )
108108 else :
0 commit comments