File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from typing import Any
22from lf_toolkit .evaluation import Result as LFResult
3- from .schemas import FSA
3+ from .schemas import FSA , FSAFrontend
44from .schemas .result import Result
55from .correction import analyze_fsa_correction
66
77def validate_fsa (value : str | dict ) -> FSA :
88 """Parse a FSA from JSON string or dict."""
99 if isinstance (value , str ):
10- return FSA .model_validate_json (value )
11- return FSA .model_validate (value )
10+ return FSAFrontend .model_validate_json (value ). toFSA ( )
11+ return FSAFrontend .model_validate (value ). toFSA ( )
1212
1313def evaluation_function (
1414 response : Any = None ,
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ class Config:
6969 }
7070
7171 @classmethod
72- def from_flattened (cls , data : dict ) -> FSA :
72+ def toFSA (cls , data : dict ) -> FSA :
7373 """
7474 Convert frontend FSA payload (with transitions as "from|symbol|to")
7575 into the FSABackend model with proper Transition objects.
You can’t perform that action at this time.
0 commit comments