pydantic-evals 0.4.5__py3-none-any.whl → 0.4.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pydantic-evals might be problematic. Click here for more details.

pydantic_evals/dataset.py CHANGED
@@ -43,7 +43,7 @@ from .evaluators.common import DEFAULT_EVALUATORS
43
43
  from .evaluators.context import EvaluatorContext
44
44
  from .otel import SpanTree
45
45
  from .otel._context_subtree import context_subtree
46
- from .reporting import EvaluationReport, ReportCase
46
+ from .reporting import EvaluationReport, ReportCase, ReportCaseAggregate
47
47
 
48
48
  if sys.version_info < (3, 11):
49
49
  from exceptiongroup import ExceptionGroup # pragma: lax no cover
@@ -83,6 +83,10 @@ DEFAULT_SCHEMA_PATH_TEMPLATE = './{stem}_schema.json'
83
83
  _YAML_SCHEMA_LINE_PREFIX = '# yaml-language-server: $schema='
84
84
 
85
85
 
86
+ _REPORT_CASES_ADAPTER = TypeAdapter(list[ReportCase])
87
+ _REPORT_CASE_AGGREGATE_ADAPTER = TypeAdapter(ReportCaseAggregate)
88
+
89
+
86
90
  class _CaseModel(BaseModel, Generic[InputsT, OutputT, MetadataT], extra='forbid'):
87
91
  """Internal model for a case, used for serialization/deserialization."""
88
92
 
@@ -303,9 +307,9 @@ class Dataset(BaseModel, Generic[InputsT, OutputT, MetadataT], extra='forbid', a
303
307
  ),
304
308
  )
305
309
  # TODO(DavidM): This attribute will be too big in general; remove it once we can use child spans in details panel:
306
- eval_span.set_attribute('cases', report.cases)
310
+ eval_span.set_attribute('cases', _REPORT_CASES_ADAPTER.dump_python(report.cases))
307
311
  # TODO(DavidM): Remove this 'averages' attribute once we compute it in the details panel
308
- eval_span.set_attribute('averages', report.averages())
312
+ eval_span.set_attribute('averages', _REPORT_CASE_AGGREGATE_ADAPTER.dump_python(report.averages()))
309
313
  return report
310
314
 
311
315
  def evaluate_sync(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-evals
3
- Version: 0.4.5
3
+ Version: 0.4.6
4
4
  Summary: Framework for evaluating stochastic code execution, especially code making use of LLMs
5
5
  Project-URL: Homepage, https://ai.pydantic.dev/evals
6
6
  Project-URL: Source, https://github.com/pydantic/pydantic-ai
@@ -32,7 +32,7 @@ Requires-Python: >=3.9
32
32
  Requires-Dist: anyio>=0
33
33
  Requires-Dist: eval-type-backport>=0; python_version < '3.11'
34
34
  Requires-Dist: logfire-api>=1.2.0
35
- Requires-Dist: pydantic-ai-slim==0.4.5
35
+ Requires-Dist: pydantic-ai-slim==0.4.6
36
36
  Requires-Dist: pydantic>=2.10
37
37
  Requires-Dist: pyyaml>=6.0.2
38
38
  Requires-Dist: rich>=13.9.4
@@ -1,6 +1,6 @@
1
1
  pydantic_evals/__init__.py,sha256=OKRbfhdc8UZPzrPJMZUQwvzIxLhXmEZxz1ZuD921fy4,839
2
2
  pydantic_evals/_utils.py,sha256=PfhmPbdQp-q90s568LuG45zDDXxgO13BEz8MQJK8qw4,2922
3
- pydantic_evals/dataset.py,sha256=SY0k2htYG0d0KRRem3pnQdN7rPztJ_TCFnCb0zkXbCk,46477
3
+ pydantic_evals/dataset.py,sha256=yk6nHzzbEJqh9p3Y_MuBQyP0szp5oh-oFUDavi4N9D8,46699
4
4
  pydantic_evals/generation.py,sha256=Yd1rfbsDjjBBHDk-1KDu48hlITjM2-74rTnPBD_sqbA,3494
5
5
  pydantic_evals/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  pydantic_evals/evaluators/__init__.py,sha256=uj110viFiDvqrIcuDcWexk_uBgJqhKMGPHT2YvDb7LA,624
@@ -17,7 +17,7 @@ pydantic_evals/otel/_errors.py,sha256=aW1414eTofpA7R_DUgOeT-gj7YA6OXmm8Y4oYeFukD
17
17
  pydantic_evals/otel/span_tree.py,sha256=LV5Hsyo4riJzevHyBz8wxP82S-ry5zeKYi9bKWjGCS8,23057
18
18
  pydantic_evals/reporting/__init__.py,sha256=k_3tteqXGh0yGvgpN68gB0CjG9wzrakzDTve2GHend4,42148
19
19
  pydantic_evals/reporting/render_numbers.py,sha256=8SKlK3etbD7HnSWWHCE993ceCNLZCepVQ-SsqUIhyxk,6916
20
- pydantic_evals-0.4.5.dist-info/METADATA,sha256=6axvUhXnQNjpGjtEIsUv2FHDNQnOQeBMEZmaqzfoo_s,7938
21
- pydantic_evals-0.4.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
- pydantic_evals-0.4.5.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
23
- pydantic_evals-0.4.5.dist-info/RECORD,,
20
+ pydantic_evals-0.4.6.dist-info/METADATA,sha256=zw53LmYNzSu9Zvg1oC3Xjhv4X7XOdBeIVE45MNRJvz4,7938
21
+ pydantic_evals-0.4.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
+ pydantic_evals-0.4.6.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
23
+ pydantic_evals-0.4.6.dist-info/RECORD,,