Skip to content

Commit 4effec0

Browse files
authored
Fix score_details type from string into object (#32)
* Fix score_details type from string into object * Forbid additional properties in schema on top-level
1 parent d525364 commit 4effec0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

schema/eval.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"model_info",
1414
"evaluation_results"
1515
],
16+
"additionalProperties": false,
1617
"properties": {
1718
"schema_version": {
1819
"type": "string",
@@ -264,7 +265,6 @@
264265
}
265266
},
266267
"score_details": {
267-
"type": "string",
268268
"description": "The score for the evaluation and related details",
269269
"required": [
270270
"score"

schema/eval_types.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# generated by datamodel-codegen:
22
# filename: eval.schema.json
3-
# timestamp: 2025-11-18T23:38:04+00:00
3+
# timestamp: 2025-11-26T17:25:26+00:00
44

55
from __future__ import annotations
66

77
from enum import Enum
88
from typing import Any, Dict, List, Optional, Union
99

10-
from pydantic import BaseModel, Field
10+
from pydantic import BaseModel, ConfigDict, Field
1111

1212

1313
class SourceData(BaseModel):
@@ -168,6 +168,9 @@ class DetailedEvaluationResultsPerSample(BaseModel):
168168

169169

170170
class EvaluationLog(BaseModel):
171+
model_config = ConfigDict(
172+
extra='forbid',
173+
)
171174
schema_version: str = Field(
172175
..., description='Version of the schema used for this evaluation data'
173176
)

0 commit comments

Comments
 (0)