Clean ListOutputConverter responses with the shared ResponseTextCleaner - #6975
Open
anjeongkyun wants to merge 2 commits into
Open
anjeongkyun wants to merge 2 commits into
anjeongkyun wants to merge 2 commits into
Conversation
Signed-off-by: anjeongkyun <anwjdrbs123@gmail.com>
Signed-off-by: anjeongkyun <anwjdrbs123@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.
Builds on #6941, which adds
ResponseTextCleaner.defaultCleaner(). Only the last commit here is new.ListOutputConverterdoesn't clean the response at all, so a fenced list comes back with the markers as elements:It fails more quietly than the Map case in #6941: no exception, just extra elements in the caller's list.
I mentioned this in #6941 and left it out because every cleaner in the chain trims, and
csvWithOnlyWhitespaceasserts that" \t\n "converts to a single blank element rather than an empty list. That turned out to be avoidable: cleaning only when the cleaned text is non-empty keeps the blank case on the original string, so that test passes unchanged.No existing test needed changing. The four new cases fail before the change with the markers present in the list, and
mvn -pl spring-ai-model testis green (790 tests).