Class ReplicatePrediction
Represents a single prediction object returned by the Replicate API.
A prediction is Replicate's unit of work ??one model run.
After submitting a request via POST /v1/predictions, the API returns
this object immediately with Status set to Starting.
The caller must poll Get until the status
reaches Succeeded or Failed.
See: https://replicate.com/docs/reference/http#predictions.get
Inheritance
ReplicatePrediction
Assembly: Glitch9.AIDevKit.Provider.Replicate.dll
Syntax
public class ReplicatePrediction : IPollingJob
Properties
|
Edit this page
View Source
Error
Human-readable error message describing why the prediction failed.
Only populated when Status is Failed.
Example: "CUDA out of memory"
Declaration
[JsonProperty("error")]
public string Error { get; set; }
Property Value
|
Edit this page
View Source
Id
Unique identifier for this prediction (e.g. "gm3qorzdhgbfurvjtvhg6dckhu").
Use this ID to poll for status or cancel the prediction.
Declaration
[JsonProperty("id")]
public string Id { get; set; }
Property Value
|
Edit this page
View Source
Metrics
Timing metrics reported by Replicate after the prediction completes.
Only populated when Status is Succeeded or Failed.
Declaration
[JsonProperty("metrics")]
public ReplicatePredictionMetrics Metrics { get; set; }
Property Value
|
Edit this page
View Source
Output
Array of CDN output URLs produced by the model.
Only populated when Status is Succeeded.
Each URL points to a file on the replicate.delivery CDN.
The file must be downloaded separately ??Replicate does not return raw bytes.
Files are retained for approximately 1 hour after generation.
Example: ["https://replicate.delivery/pbxt/abc123.../out-0.png"]
Declaration
[JsonProperty("output")]
public string[] Output { get; set; }
Property Value
|
Edit this page
View Source
Status
Current lifecycle state of the prediction.
Transitions: Starting ??Processing ??Succeeded | Failed | Canceled
Declaration
[JsonProperty("status")]
public PredictionStatus Status { get; set; }
Property Value
|
Edit this page
View Source
Urls
Convenience URLs for polling and cancellation.
Populated immediately on the initial POST /v1/predictions response.
Declaration
[JsonProperty("urls")]
public ReplicatePredictionUrls Urls { get; set; }
Property Value
Methods
|
Edit this page
View Source
IsCompleted()
Declaration
public bool IsCompleted()
Returns
|
Edit this page
View Source
TryGetError(out string)
Declaration
public bool TryGetError(out string error)
Parameters
| Type |
Name |
Description |
| string |
error |
|
Returns
Implements
Extension Methods