FEAT: Add Image functionality to TAP
Description
This PR adds a code cell to tree_of_attacks_with_pruning.ipynb to demonstrate an image target example and modifies tree_of_attacks.py to adapt the Tree of Attacks orchestrator for image targets, particularly adding a dictionary to map content_policy_violation errors to an objective_score of 0.0, which ensure nodes are kept in the completed nodes list until the branch width limit is exceeded to prevent premature pruning.
Related Issue
Closes: #585
Tests and Documentation
No tests included in this commit.
Thanks for all the comments. I'll go through them and push changes soon!
I added two unit tests to cover the pruning logic, ensuring blocked responses are scored as 0.0 and pruning only occurs when we exceed tree_width. I also updated the example in tree_of_attacks_with_pruning.py, which used to show how the old TreeOfAttacksWithPruningOrchestrator worked with text targets. I replaced it with the new TAPAttack class to reflect the current implementation, which hopefully makes the documentation more complete.