Skip to content

Commit 9592c50

Browse files
committed
docs(gepa): clarify ReAct trace workaround with TODO
Document that this is a workaround for ReAct's multiple predictor calls with partial trajectories. After PR stanfordnlp#8999 merges, we should test if we can remove this and use extract predictor trace directly.
1 parent 0cecb75 commit 9592c50

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dspy/teleprompt/gepa/gepa_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,10 @@ def extract_tools_from_value(value, tools_dict):
383383
for input_value in trace_inputs.values():
384384
extract_tools_from_value(input_value, tools_by_predictor[pred_name])
385385

386-
# For ReAct modules, use LAST extract invocation (has all trajectory data + final outputs)
386+
# TODO: Workaround for ReAct's multiple predictor calls with partial trajectories.
387+
# Using last trace ensures full aggregated trajectory (same as extract predictor).
388+
# After PR #8999 merges (https://github.com/stanfordnlp/dspy/pull/8999), test if we can
389+
# remove this and use extract predictor trace directly like other modules traces.
387390
if pred_name.startswith(REACT_MODULE_PREFIX):
388391
selected = trace_instances[-1]
389392

0 commit comments

Comments
 (0)