9
9
class StepReasoningVariant :
10
10
id : int
11
11
name : str
12
+ actions : List [str ] = field (default_factory = list )
12
13
13
14
def asdict (self ) -> Dict [str , Any ]:
14
- return {"id" : self .id , "name" : self .name }
15
+ return {"id" : self .id , "name" : self .name , "actions" : self . actions }
15
16
16
17
17
18
@dataclass
18
19
class IncorrectStepReasoningVariant :
19
20
id : int
20
21
name : str
21
- regenerate_conversations_after_incorrect_step : Optional [bool ] = True
22
- rate_alternative_responses : Optional [bool ] = True
22
+ regenerate_steps : Optional [bool ] = True
23
+ generate_and_rate_alternative_steps : Optional [bool ] = True
24
+ rewrite_steps : Optional [bool ] = True
25
+ justification : Optional [bool ] = True
23
26
24
27
def asdict (self ) -> Dict [str , Any ]:
25
28
actions = []
26
- if self .regenerate_conversations_after_incorrect_step :
29
+ if self .regenerate_steps :
27
30
actions .append ("regenerateSteps" )
28
- if self .rate_alternative_responses :
31
+ if self .generate_and_rate_alternative_steps :
29
32
actions .append ("generateAndRateAlternativeSteps" )
33
+ if self .rewrite_steps :
34
+ actions .append ("rewriteSteps" )
35
+ if self .justification :
36
+ actions .append ("justification" )
30
37
return {"id" : self .id , "name" : self .name , "actions" : actions }
31
38
32
39
@classmethod
@@ -36,10 +43,11 @@ def from_dict(
36
43
return cls (
37
44
id = dictionary ["id" ],
38
45
name = dictionary ["name" ],
39
- regenerate_conversations_after_incorrect_step = "regenerateSteps"
40
- in dictionary .get ("actions" , []),
41
- rate_alternative_responses = "generateAndRateAlternativeSteps"
46
+ regenerate_steps = "regenerateSteps" in dictionary .get ("actions" , []),
47
+ generate_and_rate_alternative_steps = "generateAndRateAlternativeSteps"
42
48
in dictionary .get ("actions" , []),
49
+ rewrite_steps = "rewriteSteps" in dictionary .get ("actions" , []),
50
+ justification = "justification" in dictionary .get ("actions" , []),
43
51
)
44
52
45
53
@@ -162,20 +170,30 @@ def __post_init__(self):
162
170
"This feature is experimental and subject to change." ,
163
171
)
164
172
165
- def reset_regenerate_conversations_after_incorrect_step (self ):
173
+ def reset_regenerate_steps (self ):
166
174
"""
167
175
For live models, the default acation will invoke the model to generate alternatives if a step is marked as incorrect
168
176
This method will reset the action to not regenerate the conversation
169
177
"""
170
- self .definition .variants .incorrect_step .regenerate_conversations_after_incorrect_step = False
178
+ self .definition .variants .incorrect_step .regenerate_steps = False
171
179
172
- def reset_rate_alternative_responses (self ):
180
+ def reset_generate_and_rate_alternative_steps (self ):
173
181
"""
174
182
For live models, will require labelers to rate the alternatives generated by the model
175
183
"""
176
- self .definition .variants .incorrect_step .rate_alternative_responses = (
177
- False
178
- )
184
+ self .definition .variants .incorrect_step .generate_and_rate_alternative_steps = False
185
+
186
+ def reset_rewrite_steps (self ):
187
+ """
188
+ For live models, will require labelers to rewrite the conversation
189
+ """
190
+ self .definition .variants .incorrect_step .rewrite_steps = False
191
+
192
+ def reset_justification (self ):
193
+ """
194
+ For live models, will require labelers to provide a justification for their evaluation
195
+ """
196
+ self .definition .variants .incorrect_step .justification = False
179
197
180
198
def asdict (self ) -> Dict [str , Any ]:
181
199
return {
0 commit comments