@@ -9,7 +9,7 @@ def validate_fsa(value: str | dict) -> FSA:
99 """Parse a FSA from JSON string or dict."""
1010 if isinstance (value , str ):
1111 return FSAFrontend .model_validate_json (value ).toFSA ()
12- return FSAFrontend .model_validate (value ).toFSA ()
12+ return FSAFrontend .model_validate (value ).toFSA (), FSAFrontend . model_validate ( value ). config
1313
1414def evaluation_function (
1515 response : Any = None ,
@@ -33,16 +33,9 @@ def evaluation_function(
3333 f"Missing FSA data: response or answer is None\n "
3434 f"response: { response } \n answer: { answer } "
3535 )
36- # Extract and remove config from answer
37- raw_config = "{}"
38- if isinstance (answer , dict ):
39- raw_config = answer .pop ("config" , "{}" )
40-
41- config = json .loads (raw_config )
42-
4336 # Parse FSAs
44- student_fsa = validate_fsa (response )
45- expected_fsa = validate_fsa (answer )
37+ student_fsa , student_config = validate_fsa (response )
38+ expected_fsa , expected_config = validate_fsa (answer )
4639
4740 require_minimal = params .get ("require_minimal" , False ) if isinstance (params , dict ) else False
4841
@@ -53,7 +46,7 @@ def evaluation_function(
5346 feedback_items = [(
5447 "error" ,
5548 f"Invalid FSA format: { str (e )} \n \n "
56- f"response: { response } \n answer: { answer } \n params: { params } \n \n config: { config } "
49+ f"response: { response } \n answer: { answer } \n params: { params } \n \n student config: { student_config } \n \n expected config: { expected_config } "
5750 )]
5851 )
5952
0 commit comments