Enable access to reasoning_text and tool_calls in post-hoc LLM judges via flexeval_file.#285
Merged
Conversation
reasoning_text and tool_calls in post-hoc LLM judges via flexeval_file.reasoning_text and tool_calls in post-hoc LLM judges via flexeval_file.
yuma-hirakawa
approved these changes
May 13, 2026
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.
flexeval_lmpassesLMOutputobjects toMetric.evaluate(), giving metrics access to the full generation output includingreasoning_textandtool_calls. However,flexeval_file, used for post-hoc evaluation of saved results, only passed the plainlm_outputstring, discarding all other fields. This made it impossible to apply LLM-judge metrics to reasoning content or tool call data after the fact.This PR closes that gap:
flexeval_filenow reconstructsLMOutputfrom the saved fields, making post-hoc evaluation with LLM judges behave consistently with online evaluation viaflexeval_lm.Implementation summary
evaluate_from_data()now reconstructsLMOutputobjects from flat eval data dicts, picking upraw_lm_output,reasoning_text,finish_reason,tool_calls, andtool_call_validation_resultfieldsChatLLMScore,ChatLLMGEvalScore,ChatLLMLabel) now receiveLMOutputobjects directly instead of plain strings, enabling Jinja2 templates to access fields like{{ lm_output.reasoning_text }}LMOutput.__str__so that existing templates using{{ lm_output }}continue to render thetextfield without modification (backward compatibility)