GH-6322: Populate feedback and expose raw LLM response in evaluators#6330
Open
kuntal1461 wants to merge 1 commit into
Open
GH-6322: Populate feedback and expose raw LLM response in evaluators#6330kuntal1461 wants to merge 1 commit into
kuntal1461 wants to merge 1 commit into
Conversation
496f190 to
709babc
Compare
… in evaluators FactCheckingEvaluator and RelevancyEvaluator were hardcoding the feedback field to "" and discarding the LLM response text entirely. - Set feedback to the raw LLM response string in both evaluators - Add llm_raw_response entry to metadata for structured key-based access - Expose LLM_RAW_RESPONSE_METADATA_KEY constant on both classes so callers can read metadata without magic strings - Add .strip() to the yes/no check to tolerate trailing whitespace/newlines from LLMs, fixing silent failures with custom prompts - Null-safe handling of LLM response (empty string fallback) - Update evaluate() Javadoc to document the new feedback/metadata contract - Add unit tests covering yes, no, whitespace trim, and null LLM responses Signed-off-by: kuntal1461 <kuntal.1461@gmail.com>
709babc to
9d2b444
Compare
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.
Fixes #6322.
Summary
FactCheckingEvaluator and RelevancyEvaluator were hardcoding the feedback field to empty string and discarding the LLM response text, making it impossible for users to understand why an evaluation passed or failed.
No changes to EvaluationResponse, EvaluationRequest, or the Evaluator interface. Fully backward-compatible.
Test plan