Repository navigation
Conversation
This branch has not been deployed
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.
What does this PR do?
Batch evaluation accepts dictionary evaluator results but passes them straight to
_create_score(), which expectsEvaluationattributes. Returning{"name": "quality", "value": 0.75}therefore fails the item with'dict' object has no attribute 'metadata'. A composite evaluator returning a dictionary logs the same error and produces no composite score.Normalize item and composite results with the existing
_normalize_evaluator_result()used by experiments. This converts dictionaries, lists of dictionaries, and mixed dictionary/Evaluationlists intoEvaluationobjects before score creation, while preserving score metadata, comments, type, and config ID.Ten regression cases cover sync/async item evaluators and composites through the batch runner, with local observation fixtures and assertions on the score calls. All ten fail before the runtime change.
Type of change
Verification
The focused suite has 59 passing tests. Ruff, formatting (575 files), mypy, and all pre-commit hooks pass.
The full unit suite also passes: 932 passed, 2 skipped on Python 3.13.5, using four workers. The existing prompt fixture needs
LANGFUSE_PUBLIC_KEYandLANGFUSE_SECRET_KEY; a first run without them had 18 fixture setup errors (914 passed). Rerunning with dummy local test credentials andLANGFUSE_BASE_URL=http://localhost:3000passed the whole suite. No real credentials were used.No Langfuse server or live provider tests were run. Provider instrumentation and generated API files are unchanged.
Checklist
code_review.md.Developed and checked with Codex assistance.


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Batch evaluations now use the existing
_normalize_evaluator_result()helper before creating item and composite scores.Reviews (1) · Last reviewed commit: "fix(evaluations): normalize dictionary r..." · Reviewed by Greptile