You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// The replicate input schema, for example ReplicateSDXLInputSchema
20
+
/// TThe input schema depends on what model you are running. To see the available inputs, click the "API" tab on the model you are running or get the model version and look at its `openapi_schema` property. For example, `stability-ai/sdxl` takes `prompt` as an input.
14
21
publicletinput:Encodable
15
22
16
-
/// The version of the model to run
23
+
/// You do not need to set this field if you are using an official model.
24
+
/// For community models, set it to the ID of the model version that you want to run.
/// One of `starting`, `processing`, `succeeded`, `failed`, `canceled`
56
+
/// One of `starting`, `processing`, `succeeded`, `failed`, `canceled`.
57
+
///
58
+
/// In the `succeeded` case, the `output` property on this type will be an object containing the output of the model.
59
+
/// In the `failed` case, `error` property on this type will contain the error encountered during the prediction.
32
60
publicletstatus:Status?
33
61
34
62
/// URLs to cancel the prediction or get the result from the prediction
@@ -37,9 +65,20 @@ public struct ReplicatePredictionResponseBody<T: Decodable>: Decodable {
37
65
/// The version of the model that ran
38
66
publicletversion:String?
39
67
68
+
/// For compatibility with an older release of the libary
69
+
publicvarpredictionResultURL:URL?{
70
+
return urls?.get
71
+
}
72
+
40
73
privateenumCodingKeys:String,CodingKey{
41
74
case completedAt ="completed_at"
75
+
case createdAt ="created_at"
76
+
case dataRemoved ="data_removed"
42
77
case error
78
+
case id
79
+
case logs
80
+
case metrics
81
+
case model
43
82
case output
44
83
case startedAt ="started_at"
45
84
case status
@@ -48,19 +87,42 @@ public struct ReplicatePredictionResponseBody<T: Decodable>: Decodable {
48
87
}
49
88
}
50
89
51
-
extensionReplicatePredictionResponseBody{
90
+
extensionReplicatePrediction{
52
91
publicstructActionURLs:Decodable{
53
92
publicletcancel:URL?
54
93
publicletget:URL?
55
94
}
56
95
}
57
96
58
-
extensionReplicatePredictionResponseBody{
97
+
extensionReplicatePrediction{
98
+
publicstructMetrics:Decodable{
99
+
publicletpredictTime:Double
100
+
101
+
enumCodingKeys:String,CodingKey{
102
+
case predictTime ="predict_time"
103
+
}
104
+
}
105
+
}
106
+
107
+
extensionReplicatePrediction{
59
108
publicenumStatus:String,Decodable{
109
+
/// The prediction is starting up. If this status lasts longer than a few seconds, then it's typically because a new worker is being started to run the prediction.
60
110
case starting
111
+
112
+
/// The `predict()` method of the model is currently running.
61
113
case processing
114
+
115
+
/// The prediction completed successfully.
62
116
case succeeded
117
+
118
+
/// The prediction encountered an error during processing.
0 commit comments