View Source Replicate.Predictions.Behaviour behaviour (Replicate v1.3.0)

Documentation for the Predictions Behaviour

Link to this section Summary

Link to this section Callbacks

@callback cancel(id :: String.t() | Replicate.Predictions.Prediction.t()) ::
  {:ok, Replicate.Predictions.Prediction.t()} | {:error, String.t()}
Link to this callback

create(version, input, webhook, webhook_completed, webook_event_filter)

View Source
@callback create(
  version :: Replicate.Models.Version.t(),
  input :: %{required(String.t()) => any()},
  webhook :: [String.t()],
  webhook_completed :: [String.t()],
  webook_event_filter :: [String.t()]
) :: {:ok, Replicate.Predictions.Prediction.t()} | {:error, String.t()}
@callback create(
  model :: String.t(),
  input :: %{required(String.t()) => any()},
  webhook :: [String.t()],
  webhook_completed :: [String.t()],
  webook_event_filter :: [String.t()]
) :: {:ok, Replicate.Predictions.Prediction.t()} | {:error, String.t()}
@callback get(id :: String.t()) ::
  {:ok, Replicate.Predictions.Prediction.t()} | {:error, String.t()}
@callback get!(id :: String.t()) :: Replicate.Predictions.Prediction.t()
@callback list() :: [Replicate.Predictions.Prediction.t()]