-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprediction.py
More file actions
68 lines (45 loc) · 1.8 KB
/
prediction.py
File metadata and controls
68 lines (45 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Dict, Union, Optional
from datetime import datetime
from typing_extensions import Literal
from .._models import BaseModel
__all__ = ["Prediction", "URLs"]
class URLs(BaseModel):
cancel: str
"""Cancel the prediction"""
get: str
"""Retrieve the latest state of the prediction"""
stream: Optional[str] = None
"""An event source to stream the output of the prediction"""
class Prediction(BaseModel):
id: str
created_at: datetime
"""The time that the prediction was created"""
data_removed: bool
"""Whether the prediction output has been deleted"""
error: Optional[str] = None
"""An error string if the model status is `"failed"`"""
input: Dict[str, object]
"""The prediction input"""
model: str
"""The name of the model that created the prediction"""
output: object
"""
The prediction output, which can be any JSON-serializable value, depending on
the model
"""
status: Literal["starting", "processing", "succeeded", "failed", "canceled"]
urls: URLs
"""API endpoints for working with the prediction"""
version: Union[str, Literal["hidden"]]
"""The ID of the model version that created the prediction"""
completed_at: Optional[datetime] = None
"""The time that the model completed the prediction and all outputs were uploaded"""
deployment: Optional[str] = None
"""The name of the deployment that created the prediction"""
logs: Optional[str] = None
"""The log output from the model"""
metrics: Optional[Dict[str, object]] = None
"""Additional metrics associated with the prediction"""
started_at: Optional[datetime] = None
"""The time that the model began the prediction"""