Spaces:
Sleeping
Sleeping
Commit ·
e090821
1
Parent(s): 2a11723
feat(models): add AttackAction model with intensity and framing fields
Browse files
models.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from enum import Enum
|
|
|
|
| 2 |
|
| 3 |
class StrategyType(str, Enum):
|
| 4 |
ROLEPLAY = "roleplay"
|
|
@@ -9,10 +10,15 @@ class StrategyType(str, Enum):
|
|
| 9 |
ENCODING = "encoding"
|
| 10 |
MULTI_TURN = "multi_turn"
|
| 11 |
|
| 12 |
-
|
| 13 |
class TargetCategory(str, Enum):
|
| 14 |
PRIVACY = "privacy"
|
| 15 |
MISINFORMATION = "misinformation"
|
| 16 |
HARMFUL_INSTRUCTIONS = "harmful_instructions"
|
| 17 |
MANIPULATION = "manipulation"
|
| 18 |
ILLEGAL_ACTIVITY = "illegal_activity"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from enum import Enum
|
| 2 |
+
from pydantic import BaseModel, Field
|
| 3 |
|
| 4 |
class StrategyType(str, Enum):
|
| 5 |
ROLEPLAY = "roleplay"
|
|
|
|
| 10 |
ENCODING = "encoding"
|
| 11 |
MULTI_TURN = "multi_turn"
|
| 12 |
|
|
|
|
| 13 |
class TargetCategory(str, Enum):
|
| 14 |
PRIVACY = "privacy"
|
| 15 |
MISINFORMATION = "misinformation"
|
| 16 |
HARMFUL_INSTRUCTIONS = "harmful_instructions"
|
| 17 |
MANIPULATION = "manipulation"
|
| 18 |
ILLEGAL_ACTIVITY = "illegal_activity"
|
| 19 |
+
|
| 20 |
+
class AttackAction(BaseModel):
|
| 21 |
+
strategy_type: StrategyType
|
| 22 |
+
target_category: TargetCategory
|
| 23 |
+
intensity: float = Field(ge=0.0, le=1.0)
|
| 24 |
+
framing: str = Field(max_length=500)
|