File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ class Prediction(BaseModel):
35
35
error : Optional [str ]
36
36
"""The error encountered during the prediction, if any."""
37
37
38
+ metrics : Optional [Dict [str , Any ]]
39
+ """Metrics for the prediction."""
40
+
38
41
created_at : Optional [str ]
39
42
"""When the prediction was created."""
40
43
Original file line number Diff line number Diff line change @@ -193,6 +193,9 @@ def test_async_timings():
193
193
"output" : "hello world" ,
194
194
"error" : None ,
195
195
"logs" : "" ,
196
+ "metrics" : {
197
+ "predict_time" : 1.2345 ,
198
+ },
196
199
},
197
200
)
198
201
@@ -210,3 +213,4 @@ def test_async_timings():
210
213
assert prediction .created_at == "2022-04-26T20:00:40.658234Z"
211
214
assert prediction .completed_at == "2022-04-26T20:02:27.648305Z"
212
215
assert prediction .output == "hello world"
216
+ assert prediction .metrics ["predict_time" ] == 1.2345
You can’t perform that action at this time.
0 commit comments