Strip structural tags from PlanReActPlanner response parts - #6655
Open
guptaishaan wants to merge 1 commit into
Open
Strip structural tags from PlanReActPlanner response parts#6655guptaishaan wants to merge 1 commit into
guptaishaan wants to merge 1 commit into
Conversation
`PlanReActPlanner.process_planning_response` was leaving raw structural markers Signed-off-by: Ishaan <ishaangupta0408@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PlanReActPlanner.process_planning_responsewas leaving raw structural markers(
/*PLANNING*/,/*REASONING*/,/*ACTION*/,/*REPLANNING*/,/*FINAL_ANSWER*/) in the text of the returnedtypes.Partobjects.Consumers had to parse those markers themselves to distinguish reasoning from
the final answer, which is exactly the fragile hand-rolling that standardized
content blocks are meant to avoid.
This change strips the leading structural tag from each text part before it is
returned. The
part.thought = Trueflag already serves as themachine-readable indicator that a part contains reasoning rather than a
user-visible answer, so no new fields are needed. The
/*FINAL_ANSWER*/separator is also stripped from the reasoning text when a single part contains
both sections.
Two regression tests are added to
test_plan_re_act_planner.pyto verify thatno tag appears in the text of any returned part.
Fixes #3378