-
Notifications
You must be signed in to change notification settings - Fork 50
Fix CI #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
+16
−26
Conversation
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
## Summary
Fixes a bug in `Score.as_dict()` where the `name` field was missing when
serializing, causing "Object of type Score is not JSON serializable"
errors when returning Score objects from Python scorers.
## Problem
The API expects Score objects to have `name`, `score`, and `metadata`
fields, but `as_dict()` was only returning `score` and `metadata`. This
caused the following error when using online scorers:
```
Cannot log [{"name":"...","score":1,"metadata":{...}},...] as a score
Object of type Score is not JSON serializable
```
## Solution
Updated `Score.as_dict()` to include the `name` field:
```python
def as_dict(self):
return {
"name": self.name, # ← ADDED
"score": self.score,
"metadata": self.metadata,
}
```
## Changes
- Updated `py/autoevals/score.py`: Fixed `Score.as_dict()` method
This matches the fix in braintrust-sdk (PR
braintrustdata/braintrust-sdk#1103) and ensures Score objects serialize
correctly with all required fields.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Alex Jean-Baptiste Jr <alex.jean-baptiste@braintrustdata.com>
Braintrust eval report
|
ibolmo
commented
Dec 29, 2025
| package_dir={"": "py"}, | ||
| include_package_data=True, | ||
| packages=setuptools.find_packages(where="py"), | ||
| python_requires=">=3.8.0", |
Collaborator
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically #154 will be the official deprecation of 3.8 and 3.9.
Braintrust eval reportAutoevals (pnpm-10-1767046473)
|
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.
No description provided.