[fix][plan] Fix parsing exception in ChatModelAction#634
Merged
wenjin272 merged 3 commits intoapache:mainfrom Apr 22, 2026
Merged
[fix][plan] Fix parsing exception in ChatModelAction#634wenjin272 merged 3 commits intoapache:mainfrom
wenjin272 merged 3 commits intoapache:mainfrom
Conversation
1c567d0 to
18f2803
Compare
Collaborator
|
Hi, @twosom, thanks for you work, LGTM. Could you also add similar logic for the Python chat model action? We should maintain consistent behavior across built-in actions to avoid unexpected outcomes. |
Contributor
Author
Thank you for your comment @wenjin272. Yes, I will add similar logic to Python and write test cases as well. |
Collaborator
|
LGTM |
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.
Linked issue: #633
Purpose of change
The ChatModelAction currently fails with a JsonParseException when an LLM returns a structured output wrapped in Markdown code blocks (e.g.,
json ...). This happens because Jackson's ObjectMapper expects a valid JSON start character ({ or [) but encounters a backtick (`) instead.so, I added a utility method to extract raw JSON string from LLM responses that include Markdown decorators.
Tests
Added some unit tests for clean llm response
API
Documentation
doc-neededdoc-not-neededdoc-included