-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Include report averages #3053
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
base: main
Are you sure you want to change the base?
Include report averages #3053
Conversation
Docs Preview
|
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.
@cetra3 A few comments. More generally, was this added for a specific frontend feature that will look at these attrs and subfields, or more just because it's useful info?
) | ||
if (averages := report.averages()) is not None and averages.assertions is not None: | ||
experiment_metadata = {'n_cases': len(self.cases), 'averages': averages} | ||
eval_span.set_attribute('experiment.metadata', experiment_metadata) |
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.
Can you add a logfire.
prefix here since it's not general OTel but specific to our platform?
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.
I'd argue it's specific to pydantic evals, rather than logfire
itself?
We use the experiment.metadata
field to ingest information about the test run. Are you saying we should change this to logfire.experiment.metadata
? or are you saying underneath experiment.metadata
we should have a logfire field.
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.
@cetra3 Yeah I was suggesting (based on @alexmojaki suggestion in Slack) to change it to logfire.experiment.metadata
. But I see your (implied) point that even though right now only Logfire will use these attributes, they could be useful to users sending pydantic_evals
data to different platform as well.
@alexmojaki What do you think about a pydantic_evals
prefix?
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.
Everything here is specific to pydantic evals. This is particularly specific not just to logfire but to fusionfire popped attributes. n_cases is being repeated here so that it can be displayed cheaply in the frontend. We may add or remove things here freely depending on what the frontend needs, it's not intended to be queried. I think logfire.
makes sense for that.
trace_id=trace_id, | ||
) | ||
if (averages := report.averages()) is not None and averages.assertions is not None: | ||
experiment_metadata = {'n_cases': len(self.cases), 'averages': averages} |
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.
From the test below, it looks like we already had n_cases
in here, do we need to repeat it? Or could we drop it there and have it just under the metadata?
'experiment.metadata': { | ||
'type': 'object', | ||
'properties': { | ||
'averages': { |
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.
I'd expect n_cases
to also be listed here
'logfire.msg': 'evaluate mock_async_task', | ||
'experiment.metadata': { | ||
'n_cases': 2, | ||
'averages': { |
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.
If we're going to be using this on the frontend, I don't know if it's wise to pass along the entire ReportCaseAggregate
object or just the subset we need
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.
@cetra3 A few comments. More generally, was this added for a specific frontend feature that will look at these attrs and subfields, or more just because it's useful info?
Allows the evals page in logfire to present some nice stats in the main comparison table: