eta.core.planning.merge_plan_steps

merge_plan_steps(plan, ds)[source]

Merge steps in the plan that are equivalent or unifiable.

Parameters:
Returns:

The updated plan, if successful.

Return type:

PlanNode or None

Notes

TODO: the behavior of this function is currently hard-coded to merge directly adjacent reply-to steps in the plan. It should be generalized using a transducer that maps a plan to a new plan with merged steps, possibly making use of retrieved equivalency knowledge (allowing for, e.g., a neural network or LLM to potentially perform this step instead).