11# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22
3- from typing import Dict , Union , Optional
3+ from typing import TYPE_CHECKING , Dict , Union , Optional
44from datetime import datetime
55from typing_extensions import Literal
66
7+ from pydantic import Field as FieldInfo
8+ 79from .._models import BaseModel
810
9- __all__ = ["Prediction" , "URLs" ]
11+ __all__ = ["Prediction" , "URLs" , "Metrics" ]
1012
1113
1214class URLs (BaseModel ):
@@ -23,6 +25,23 @@ class URLs(BaseModel):
2325 """An event source to stream the output of the prediction via API"""
2426
2527
28+ class Metrics (BaseModel ):
29+ total_time : Optional [float ] = None
30+ """The total time, in seconds, that the prediction took to complete"""
31+ 32+ if TYPE_CHECKING :
33+ # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
34+ # value to this field, so for compatibility we avoid doing it at runtime.
35+ __pydantic_extra__ : Dict [str , object ] = FieldInfo (init = False ) # pyright: ignore[reportIncompatibleVariableOverride]
36+ 37+ # Stub to indicate that arbitrary properties are accepted.
38+ # To access properties that are not valid identifiers you can use `getattr`, e.g.
39+ # `getattr(obj, '$type')`
40+ def __getattr__ (self , attr : str ) -> object : ...
41+ else :
42+ __pydantic_extra__ : Dict [str , object ]
43+ 44+ 2645class Prediction (BaseModel ):
2746 id : str
2847
@@ -64,7 +83,7 @@ class Prediction(BaseModel):
6483 logs : Optional [str ] = None
6584 """The log output from the model"""
6685
67- metrics : Optional [Dict [ str , object ] ] = None
86+ metrics : Optional [Metrics ] = None
6887 """Additional metrics associated with the prediction"""
6988
7089 started_at : Optional [datetime ] = None
0 commit comments