Search Results for

    Show / Hide Table of Contents

    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
    object
    ReplicatePrediction
    Implements
    IPollingJob
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.Replicate
    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
    Type Description
    string
    | 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
    Type Description
    string
    | 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
    Type Description
    ReplicatePredictionMetrics
    | 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
    Type Description
    string[]
    | 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
    Type Description
    PredictionStatus
    | 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
    Type Description
    ReplicatePredictionUrls

    Methods

    | Edit this page View Source

    IsCompleted()

    Declaration
    public bool IsCompleted()
    Returns
    Type Description
    bool
    | Edit this page View Source

    TryGetError(out string)

    Declaration
    public bool TryGetError(out string error)
    Parameters
    Type Name Description
    string error
    Returns
    Type Description
    bool

    Implements

    IPollingJob

    Extension Methods

    PredictionResponseExtensions.ToGeneratedImageAsync(ReplicatePrediction)
    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation