5
5
6
6
from labelbox .schema .tool_building .tool_type import ToolType
7
7
from labelbox .schema .tool_building .variant import (
8
- Variant ,
9
8
VariantWithActions ,
10
9
)
11
10
12
11
12
+ class FactCheckingActions (Enum ):
13
+ WRITE_JUSTIFICATION = "justification"
14
+
15
+
13
16
class UnsupportedStepActions (Enum ):
14
- WRITE_JUSTIFICATION = "writeJustification "
17
+ WRITE_JUSTIFICATION = "justification "
15
18
16
19
17
20
class CanConfidentlyAssessStepActions (Enum ):
18
- WRITE_JUSTIFICATION = "writeJustification "
21
+ WRITE_JUSTIFICATION = "justification "
19
22
20
23
21
24
class NoFactualInformationStepActions (Enum ):
22
- WRITE_JUSTIFICATION = "writeJustification "
25
+ WRITE_JUSTIFICATION = "justification "
23
26
24
27
25
28
@dataclass
@@ -29,43 +32,53 @@ class FactCheckingVariants:
29
32
NOTE do not change the variants directly
30
33
"""
31
34
32
- accurate_step : Variant = field (
33
- default_factory = lambda : Variant (id = 0 , name = "Accurate" )
35
+ accurate_step : VariantWithActions = field (
36
+ default_factory = lambda : VariantWithActions (
37
+ id = 0 ,
38
+ name = "Accurate" ,
39
+ _available_actions = {action .value for action in FactCheckingActions },
40
+ actions = [action .value for action in FactCheckingActions ],
41
+ )
34
42
)
35
- inaccurate_step : Variant = field (
36
- default_factory = lambda : Variant (id = 1 , name = "Inaccurate" )
43
+
44
+ inaccurate_step : VariantWithActions = field (
45
+ default_factory = lambda : VariantWithActions (
46
+ id = 1 ,
47
+ name = "Inaccurate" ,
48
+ _available_actions = {action .value for action in FactCheckingActions },
49
+ actions = [action .value for action in FactCheckingActions ],
50
+ )
37
51
)
38
- disputed_step : Variant = field (
39
- default_factory = lambda : Variant (id = 2 , name = "Disputed" )
52
+ disputed_step : VariantWithActions = field (
53
+ default_factory = lambda : VariantWithActions (
54
+ id = 2 ,
55
+ name = "Disputed" ,
56
+ _available_actions = {action .value for action in FactCheckingActions },
57
+ actions = [action .value for action in FactCheckingActions ],
58
+ )
40
59
)
41
60
unsupported_step : VariantWithActions = field (
42
61
default_factory = lambda : VariantWithActions (
43
62
id = 3 ,
44
63
name = "Unsupported" ,
45
- _available_actions = {
46
- action .value for action in UnsupportedStepActions
47
- },
48
- actions = [UnsupportedStepActions .WRITE_JUSTIFICATION .value ],
64
+ _available_actions = set (),
65
+ actions = [],
49
66
)
50
67
)
51
68
cant_confidently_assess_step : VariantWithActions = field (
52
69
default_factory = lambda : VariantWithActions (
53
70
id = 4 ,
54
71
name = "Can't confidently assess" ,
55
- _available_actions = {
56
- action .value for action in CanConfidentlyAssessStepActions
57
- },
58
- actions = [CanConfidentlyAssessStepActions .WRITE_JUSTIFICATION .value ],
72
+ _available_actions = set (),
73
+ actions = [],
59
74
)
60
75
)
61
76
no_factual_information_step : VariantWithActions = field (
62
77
default_factory = lambda : VariantWithActions (
63
78
id = 5 ,
64
79
name = "No factual information" ,
65
- _available_actions = {
66
- action .value for action in NoFactualInformationStepActions
67
- },
68
- actions = [NoFactualInformationStepActions .WRITE_JUSTIFICATION .value ],
80
+ _available_actions = set (),
81
+ actions = [],
69
82
)
70
83
)
71
84
@@ -90,11 +103,11 @@ def from_dict(cls, dictionary: List[Dict[str, Any]]):
90
103
91
104
for variant in dictionary :
92
105
if variant ["id" ] == 0 :
93
- accurate_step = Variant (** variant )
106
+ accurate_step = VariantWithActions (** variant )
94
107
elif variant ["id" ] == 1 :
95
- inaccurate_step = Variant (** variant )
108
+ inaccurate_step = VariantWithActions (** variant )
96
109
elif variant ["id" ] == 2 :
97
- disputed_step = Variant (** variant )
110
+ disputed_step = VariantWithActions (** variant )
98
111
elif variant ["id" ] == 3 :
99
112
unsupported_step = VariantWithActions (** variant )
100
113
elif variant ["id" ] == 4 :
0 commit comments