@@ -21,9 +21,8 @@ class LangGraphRolloutProcessor(RolloutProcessor):
2121 def __init__ (
2222 self ,
2323 * ,
24- # Prefer factory that accepts RolloutProcessorConfig for parity with Pydantic pattern.
25- # For backward compatibility, factories accepting a Dict[str, Any] (graph kwargs) are still supported.
26- graph_factory : Callable [[Any ], Any ],
24+ # Factory must accept RolloutProcessorConfig (parity with Pydantic AI processor)
25+ graph_factory : Callable [[RolloutProcessorConfig ], Any ],
2726 to_input : Optional [Callable [[EvaluationRow ], Dict [str , Any ]]] = None ,
2827 apply_result : Optional [Callable [[EvaluationRow , Any ], EvaluationRow ]] = None ,
2928 build_graph_kwargs : Optional [Callable [[CompletionParams ], Dict [str , Any ]]] = None ,
@@ -126,12 +125,8 @@ def __call__(self, rows: List[EvaluationRow], config: RolloutProcessorConfig) ->
126125 if config .completion_params :
127126 graph_config = build_kwargs (config .completion_params )
128127
129- # (Re)build the graph for this call. Prefer passing full config to factory;
130- # fall back to old dict-based factories if needed.
131- try :
132- graph_target = self ._graph_factory (config ) # type: ignore[arg-type]
133- except TypeError :
134- graph_target = self ._graph_factory (graph_config or {})
128+ # (Re)build the graph for this call using the full typed config.
129+ graph_target = self ._graph_factory (config )
135130
136131 # Build per-invoke config if provided; otherwise reuse graph_config for backwards compat
137132 invoke_config : Optional [Dict [str , Any ]] = None
0 commit comments