File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/openai/types/evals/runs Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,17 @@ class Result(BaseModel):
27
27
type : Optional [str ] = None
28
28
"""The grader type (for example, "string-check-grader")."""
29
29
30
- __pydantic_extra__ : Dict [str , object ] = FieldInfo (init = False ) # pyright: ignore[reportIncompatibleVariableOverride]
31
30
if TYPE_CHECKING :
31
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
32
+ # value to this field, so for compatibility we avoid doing it at runtime.
33
+ __pydantic_extra__ : Dict [str , object ] = FieldInfo (init = False ) # pyright: ignore[reportIncompatibleVariableOverride]
34
+
32
35
# Stub to indicate that arbitrary properties are accepted.
33
36
# To access properties that are not valid identifiers you can use `getattr`, e.g.
34
37
# `getattr(obj, '$type')`
35
38
def __getattr__ (self , attr : str ) -> object : ...
39
+ else :
40
+ __pydantic_extra__ : Dict [str , object ]
36
41
37
42
38
43
class SampleInput (BaseModel ):
Original file line number Diff line number Diff line change @@ -27,12 +27,17 @@ class Result(BaseModel):
27
27
type : Optional [str ] = None
28
28
"""The grader type (for example, "string-check-grader")."""
29
29
30
- __pydantic_extra__ : Dict [str , object ] = FieldInfo (init = False ) # pyright: ignore[reportIncompatibleVariableOverride]
31
30
if TYPE_CHECKING :
31
+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
32
+ # value to this field, so for compatibility we avoid doing it at runtime.
33
+ __pydantic_extra__ : Dict [str , object ] = FieldInfo (init = False ) # pyright: ignore[reportIncompatibleVariableOverride]
34
+
32
35
# Stub to indicate that arbitrary properties are accepted.
33
36
# To access properties that are not valid identifiers you can use `getattr`, e.g.
34
37
# `getattr(obj, '$type')`
35
38
def __getattr__ (self , attr : str ) -> object : ...
39
+ else :
40
+ __pydantic_extra__ : Dict [str , object ]
36
41
37
42
38
43
class SampleInput (BaseModel ):
You can’t perform that action at this time.
0 commit comments